public class RemoteCacheManager extends Object
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 | Constructor and Description |
---|---|
protected |
RemoteCacheManager(IRemoteCacheAttributes cattr,
ICompositeCacheManager cacheMgr,
RemoteCacheMonitor monitor,
ICacheEventLogger cacheEventLogger,
IElementSerializer elementSerializer)
Constructs an instance to with the given remote connection parameters.
|
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.
|
boolean |
canFixCaches()
Returns true if the connection to the remote host can be
successfully re-established.
|
void |
fixCaches()
Fixes up all the caches managed by this cache manager.
|
<K,V> RemoteCacheNoWait<K,V> |
getCache(IRemoteCacheAttributes cattr)
Gets a RemoteCacheNoWait from the RemoteCacheManager.
|
protected void |
lookupRemoteService()
Lookup remote service from registry
|
protected <K,V> RemoteCacheNoWait<K,V> |
newRemoteCacheNoWait(IRemoteCacheAttributes cattr)
Create new RemoteCacheNoWait instance
|
void |
release()
Shutdown all.
|
void |
removeRemoteCacheListener(IRemoteCacheAttributes cattr)
Removes a listener.
|
protected RemoteCacheManager(IRemoteCacheAttributes cattr, ICompositeCacheManager cacheMgr, RemoteCacheMonitor monitor, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer)
cattr
- cache attributescacheMgr
- the cache hubmonitor
- the cache monitor thread for error notificationscacheEventLogger
- elementSerializer
- protected void lookupRemoteService() throws IOException
IOException
- if the remote service could not be foundpublic <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 void removeRemoteCacheListener(IRemoteCacheAttributes cattr) throws IOException
cattr
- IOException
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
- protected <K,V> RemoteCacheNoWait<K,V> newRemoteCacheNoWait(IRemoteCacheAttributes cattr)
cattr
- the cache configurationpublic void release()
public void fixCaches()
public boolean canFixCaches()
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.