Class RemoteCacheFactory
java.lang.Object
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheFactory
org.apache.commons.jcs3.auxiliary.remote.RemoteCacheFactory
- All Implemented Interfaces:
AuxiliaryCacheFactory
The RemoteCacheFactory creates remote caches for the cache hub. It returns a no wait facade which
is a wrapper around a no wait. The no wait object is either an active connection to a remote
cache or a balking zombie if the remote cache is not accessible. It should be transparent to the
clients.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<K,
V> AuxiliaryCache<K, V> createCache
(AuxiliaryCacheAttributes iaca, ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) For LOCAL clients we get a handle to all the failovers, but we do not register a listener with them.void
dispose()
Dispose of this factory, clean up shared resourcesgetManager
(IRemoteCacheAttributes cattr) Returns an instance of RemoteCacheManager for the given connection parameters.getManager
(IRemoteCacheAttributes cattr, ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) Returns an instance of RemoteCacheManager for the given connection parameters.void
Initialize this factoryMethods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheFactory
getName, setName
-
Constructor Details
-
RemoteCacheFactory
public RemoteCacheFactory()
-
-
Method Details
-
createCache
public <K,V> AuxiliaryCache<K,V> createCache(AuxiliaryCacheAttributes iaca, ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) For LOCAL clients we get a handle to all the failovers, but we do not register a listener with them. We create the RemoteCacheManager, but we do not get a cache.The failover runner will get a cache from the manager. When the primary is restored it will tell the manager for the failover to deregister the listener.
- Parameters:
iaca
-cacheMgr
-cacheEventLogger
-elementSerializer
-- Returns:
- AuxiliaryCache
-
getManager
Returns an instance of RemoteCacheManager for the given connection parameters.Host and Port uniquely identify a manager instance.
- Parameters:
cattr
-- Returns:
- The instance value or null if no such manager exists
-
getManager
public RemoteCacheManager getManager(IRemoteCacheAttributes cattr, ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) Returns an instance of RemoteCacheManager for the given connection parameters.Host and Port uniquely identify a manager instance.
If the connection cannot be established, zombie objects will be used for future recovery purposes.
- Parameters:
cattr
- the cache configuration objectcacheMgr
- the cache managercacheEventLogger
- the event loggerelementSerializer
- the serializer to use for sending and receiving- Returns:
- The instance value, never null
-
initialize
Description copied from interface:AuxiliaryCacheFactory
Initialize this factory- See Also:
-
dispose
Description copied from interface:AuxiliaryCacheFactory
Dispose of this factory, clean up shared resources- See Also:
-