org.apache.jcs.auxiliary.lateral
Class LateralCacheMonitor

java.lang.Object
  extended by org.apache.jcs.auxiliary.lateral.LateralCacheMonitor
All Implemented Interfaces:
java.lang.Runnable

public class LateralCacheMonitor
extends java.lang.Object
implements java.lang.Runnable

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.


Constructor Summary
LateralCacheMonitor(ILateralCacheManager manager)
          Constructor for the LateralCacheMonitor object
 
Method Summary
protected static void forceShortIdlePeriod(long idlePeriod)
          Allows close classes, ie testers to set the idle period to something testable.
 void notifyError()
          Notifies the cache monitor that an error occurred, and kicks off the error recovery process.
 void run()
          Main processing method for the LateralCacheMonitor object
static void setIdlePeriod(long idlePeriod)
          Configures the idle period between repairs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LateralCacheMonitor

public LateralCacheMonitor(ILateralCacheManager manager)
Constructor for the LateralCacheMonitor object

It's the clients responsibility to decide how many of these there will be.

Parameters:
manager -
Method Detail

setIdlePeriod

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

Parameters:
idlePeriod - The new idlePeriod value

forceShortIdlePeriod

protected static void forceShortIdlePeriod(long idlePeriod)
Allows close classes, ie testers to set the idle period to something testable.

Parameters:
idlePeriod -

notifyError

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


run

public void run()
Main processing method for the LateralCacheMonitor object

Specified by:
run in interface java.lang.Runnable


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.