Class RemoteCacheManager
java.lang.Object
org.apache.commons.jcs3.auxiliary.remote.RemoteCacheManager
An instance of RemoteCacheManager corresponds to one remote connection of a specific host and
 port. All RemoteCacheManager instances are monitored by the singleton RemoteCacheMonitor
 monitoring daemon for error detection and recovery.
 
Getting an instance of the remote cache has the effect of getting a handle on the remote server. Listeners are not registered with the server until a cache is requested from the manager.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedRemoteCacheManager(IRemoteCacheAttributes cattr, ICompositeCacheManager cacheMgr, RemoteCacheMonitor monitor, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) Constructs an instance to with the given remote connection parameters.
- 
Method SummaryModifier and TypeMethodDescription<K,V> void addRemoteCacheListener(IRemoteCacheAttributes cattr, IRemoteCacheListener<K, V> listener) Adds the remote cache listener to the underlying cache-watch service.booleanReturns true if the connection to the remote host can be successfully re-established.voidFixes up all the caches managed by this cache manager.<K,V> RemoteCacheNoWait<K, V> getCache(IRemoteCacheAttributes cattr) Gets a RemoteCacheNoWait from the RemoteCacheManager.protected voidLookup remote service from registryprotected <K,V> RemoteCacheNoWait<K, V> Create new RemoteCacheNoWait instancevoidrelease()Shutdown all.voidRemoves a listener.
- 
Constructor Details- 
RemoteCacheManagerprotected RemoteCacheManager(IRemoteCacheAttributes cattr, ICompositeCacheManager cacheMgr, RemoteCacheMonitor monitor, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) Constructs an instance to with the given remote connection parameters. If the connection cannot be made, "zombie" services will be temporarily used until a successful re-connection is made by the monitoring daemon.- Parameters:
- cattr- cache attributes
- cacheMgr- the cache hub
- monitor- the cache monitor thread for error notifications
- cacheEventLogger-
- elementSerializer-
 
 
- 
- 
Method Details- 
lookupRemoteServiceLookup remote service from registry- Throws:
- IOException- if the remote service could not be found
 
- 
addRemoteCacheListenerpublic <K,V> void addRemoteCacheListener(IRemoteCacheAttributes cattr, IRemoteCacheListener<K, V> listener) throws IOExceptionAdds the remote cache listener to the underlying cache-watch service.- Parameters:
- cattr- The feature to be added to the RemoteCacheListener attribute
- listener- The feature to be added to the RemoteCacheListener attribute
- Throws:
- IOException
 
- 
removeRemoteCacheListenerRemoves a listener. When the primary recovers the failover must deregister itself for a region. The failover runner will call this method to de-register. We do not want to deregister all listeners to a remote server, in case a failover is a primary of another region. Having one regions failover act as another servers primary is not currently supported.- Parameters:
- cattr-
- Throws:
- IOException
 
- 
getCacheGets a RemoteCacheNoWait from the RemoteCacheManager. The RemoteCacheNoWait objects are identified by the cache name value of the RemoteCacheAttributes object.If the client is configured to register a listener, this call results on a listener being created if one isn't already registered with the remote cache for this region. - Parameters:
- cattr-
- Returns:
- The cache value
 
- 
newRemoteCacheNoWaitCreate new RemoteCacheNoWait instance- Parameters:
- cattr- the cache configuration
- Returns:
- the instance
 
- 
releaseShutdown all.
- 
fixCachesFixes up all the caches managed by this cache manager.
- 
canFixCachesReturns true if the connection to the remote host can be successfully re-established.- Returns:
- true if we found a failover server
 
 
-