Class RemoteCacheFailoverRunner<K,V>
- All Implemented Interfaces:
Runnable
It works by switching out the RemoteCacheNoWait inside the Facade.
Client (i.e.) the CompositeCache has reference to a RemoteCacheNoWaitFacade. This facade is created by the RemoteCacheFactory. The factory maintains a set of managers, one for each remote server. Typically, there will only be one manager.
If you use multiple remote servers, you may want to set one or more as failovers. If a local cache cannot connect to the primary server, or looses its connection to the primary server, it will attempt to restore that Connection in the background. If failovers are defined, the Failover runner will try to connect to a failover until the primary is restored.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheMonitor
allright, idlePeriod, log
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteCacheFailoverRunner
(RemoteCacheNoWaitFacade<K, V> facade, RemoteCacheFactory cacheFactory) Deprecated.Constructor for the RemoteCacheFailoverRunner object. -
Method Summary
Methods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheMonitor
notifyError, notifyShutdown, setIdlePeriod
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
-
Constructor Details
-
RemoteCacheFailoverRunner
public RemoteCacheFailoverRunner(RemoteCacheNoWaitFacade<K, V> facade, RemoteCacheFactory cacheFactory) Deprecated.Constructor for the RemoteCacheFailoverRunner object. This allows the FailoverRunner to modify the facade that the CompositeCache references.- Parameters:
facade
- the facade the CompositeCache talks to.cacheFactory
- the cache factory instance
-
-
Method Details
-
dispose
Deprecated.Clean up all resources before shutdown- Specified by:
dispose
in classAbstractAuxiliaryCacheMonitor
-
doWork
Deprecated.do actual work- Specified by:
doWork
in classAbstractAuxiliaryCacheMonitor
-
run
Deprecated.Main processing method for the RemoteCacheFailoverRunner object.If we do not have a connection with any failover server, this will try to connect one at a time. If no connection can be made, it goes to sleep for a while (20 seconds).
Once a connection with a failover is made, we will try to reconnect to the primary server.
The primary server is the first server defines in the FailoverServers list.
- Specified by:
run
in interfaceRunnable
- Overrides:
run
in classAbstractAuxiliaryCacheMonitor
-