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

public abstract class AbstractAuxiliaryCacheMonitor extends Thread
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.
  • Field Details

    • log

      protected final Log log
      The logger
    • idlePeriod

      protected static long idlePeriod
      How long to wait between runs
    • allright

      Must make sure AbstractAuxiliaryCacheMonitor is started before any error can be detected!
  • Constructor Details

  • Method Details

    • setIdlePeriod

      public static void setIdlePeriod(long idlePeriod)
      Configures the idle period between repairs.

      Parameters:
      idlePeriod - The new idlePeriod value
    • notifyError

      public void notifyError()
      Notifies the cache monitor that an error occurred, and kicks off the error recovery process.
    • notifyShutdown

      public void notifyShutdown()
      Notifies the cache monitor that the service shall shut down
    • dispose

      protected abstract void dispose()
      Clean up all resources before shutdown
    • doWork

      protected abstract void doWork()
      do actual work
    • run

      public void run()
      Main processing method for the AbstractAuxiliaryCacheMonitor object
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread