Class AbstractAuxiliaryCacheMonitor
java.lang.Object
java.lang.Thread
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheMonitor
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
LateralCacheMonitor
,RemoteCacheFailoverRunner
,RemoteCacheMonitor
,RemoteHttpCacheMonitor
Used to monitor and repair any failed connection for the lateral cache service. By default the
monitor operates in a failure driven mode. That is, it goes into a wait state until there is an
error. Upon the notification of a connection error, the monitor changes to operate in a time
driven mode. That is, it attempts to recover the connections on a periodic basis. When all failed
connections are restored, it changes back to the failure driven mode.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicBoolean
Must make sure AbstractAuxiliaryCacheMonitor is started before any error can be detected!protected static long
How long to wait between runsprotected final Log
The loggerFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
dispose()
Clean up all resources before shutdownprotected abstract void
doWork()
do actual workvoid
Notifies the cache monitor that an error occurred, and kicks off the error recovery process.void
Notifies the cache monitor that the service shall shut downvoid
run()
Main processing method for the AbstractAuxiliaryCacheMonitor objectstatic void
setIdlePeriod
(long idlePeriod) Configures the idle period between repairs.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
-
Field Details
-
log
The logger -
idlePeriod
How long to wait between runs -
allright
Must make sure AbstractAuxiliaryCacheMonitor is started before any error can be detected!
-
-
Constructor Details
-
AbstractAuxiliaryCacheMonitor
Constructor- Parameters:
name
- the thread name
-
-
Method Details
-
setIdlePeriod
Configures the idle period between repairs.- Parameters:
idlePeriod
- The new idlePeriod value
-
notifyError
Notifies the cache monitor that an error occurred, and kicks off the error recovery process. -
notifyShutdown
Notifies the cache monitor that the service shall shut down -
dispose
Clean up all resources before shutdown -
doWork
do actual work -
run
Main processing method for the AbstractAuxiliaryCacheMonitor object
-