public class RemoteCacheManager extends Object implements AuxiliaryCacheManager, IShutdownObserver
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.
Modifier and Type | Method and Description |
---|---|
<K,V> void |
addRemoteCacheListener(IRemoteCacheAttributes cattr,
IRemoteCacheListener<K,V> listener)
Adds the remote cache listener to the underlying cache-watch service.
|
void |
fixCaches(ICacheServiceNonLocal<?,?> remoteService,
IRemoteCacheObserver remoteWatch)
Fixes up all the caches managed by this cache manager.
|
void |
freeCache(String name)
Releases.
|
<K,V> RemoteCacheNoWait<K,V> |
getCache(IRemoteCacheAttributes cattr)
Gets a RemoteCacheNoWait from the RemoteCacheManager.
|
<K,V> RemoteCacheNoWait<K,V> |
getCache(String cacheName)
Returns a remote cache for the given cache name.
|
IRemoteCacheAttributes |
getDefaultCattr()
Gets the defaultCattr attribute of the RemoteCacheManager object.
|
static RemoteCacheManager |
getInstance(IRemoteCacheAttributes cattr,
ICompositeCacheManager cacheMgr,
ICacheEventLogger cacheEventLogger,
IElementSerializer elementSerializer)
Returns an instance of RemoteCacheManager for the given connection parameters.
|
String |
getStats()
Gets the stats attribute of the RemoteCacheManager object
|
protected void |
logApplicationEvent(String source,
String eventName,
String optionalDetails)
Logs an event if an event logger is configured.
|
void |
release()
Shutdown all.
|
void |
removeRemoteCacheListener(IRemoteCacheAttributes cattr)
Stops a listener.
|
<K,V> void |
removeRemoteCacheListener(IRemoteCacheAttributes cattr,
IRemoteCacheListener<K,V> listener)
Removes a listener.
|
void |
removeRemoteCacheListener(String cacheName)
Stops a listener.
|
void |
shutdown()
Shutdown callback from composite cache manager.
|
public IRemoteCacheAttributes getDefaultCattr()
public <K,V> void addRemoteCacheListener(IRemoteCacheAttributes cattr, IRemoteCacheListener<K,V> listener) throws IOException
cattr
- The feature to be added to the RemoteCacheListener attributelistener
- The feature to be added to the RemoteCacheListener attributeIOException
public <K,V> void removeRemoteCacheListener(IRemoteCacheAttributes cattr, IRemoteCacheListener<K,V> listener) throws IOException
cattr
- listener
- IOException
public void removeRemoteCacheListener(IRemoteCacheAttributes cattr) throws IOException
cattr
- IOException
public void removeRemoteCacheListener(String cacheName) throws IOException
cacheName
- IOException
public static RemoteCacheManager getInstance(IRemoteCacheAttributes cattr, ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer)
Host and Port uniquely identify a manager instance.
Also starts up the monitoring daemon, if not already started.
If the connection cannot be established, zombie objects will be used for future recovery purposes.
cattr
- cacheMgr
- cacheEventLogger
- elementSerializer
- public <K,V> RemoteCacheNoWait<K,V> getCache(String cacheName)
getCache
in interface AuxiliaryCacheManager
cacheName
- public <K,V> RemoteCacheNoWait<K,V> getCache(IRemoteCacheAttributes cattr)
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.
cattr
- public void freeCache(String name) throws IOException
name
- IOException
public String getStats()
public void release()
public void fixCaches(ICacheServiceNonLocal<?,?> remoteService, IRemoteCacheObserver remoteWatch)
remoteService
- remoteWatch
- public void shutdown()
shutdown
in interface IShutdownObserver
IShutdownObserver.shutdown()
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.