public abstract class AbstractRemoteAuxiliaryCache<K,V> extends AbstractAuxiliaryCacheEventLogging<K,V> implements IRemoteCacheClient<K,V>
ICacheType.CacheType| Modifier and Type | Field and Description |
|---|---|
protected String |
cacheName
The cacheName
|
NAME_COMPONENT_DELIMITER| Constructor and Description |
|---|
AbstractRemoteAuxiliaryCache(IRemoteCacheAttributes cattr,
ICacheServiceNonLocal<K,V> remote,
IRemoteCacheListener<K,V> listener)
Creates the base.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fixCache(ICacheServiceNonLocal<?,?> restoredRemote)
Replaces the current remote cache service handle with the given handle.
|
AuxiliaryCacheAttributes |
getAuxiliaryCacheAttributes()
This returns the generic attributes for an auxiliary cache.
|
String |
getCacheName()
Gets the cacheName attribute of the RemoteCache object.
|
ICacheType.CacheType |
getCacheType()
Gets the cacheType attribute of the RemoteCache object
|
Set<K> |
getKeySet()
Return the keys in this cache.
|
IRemoteCacheListener<K,V> |
getListener()
Allows other member of this package to access the listener.
|
long |
getListenerId()
Gets the listenerId attribute of the RemoteCacheListener object
|
protected IRemoteCacheAttributes |
getRemoteCacheAttributes() |
protected IRemoteCacheListener<K,V> |
getRemoteCacheListener() |
protected ICacheServiceNonLocal<K,V> |
getRemoteCacheService() |
int |
getSize()
Returns the current cache size.
|
IStats |
getStatistics() |
String |
getStats()
Gets the stats attribute of the RemoteCache object.
|
CacheStatus |
getStatus()
Returns the cache status.
|
ICacheElement<K,V> |
getUsingPool(K key)
This allows gets to timeout in case of remote server machine shutdown.
|
protected abstract void |
handleException(Exception ex,
String msg,
String eventName)
Custom exception handling some children.
|
protected void |
processDispose()
Synchronously dispose the remote cache; if failed, replace the remote handle with a zombie.
|
protected ICacheElement<K,V> |
processGet(K key)
Synchronously get from the remote cache; if failed, replace the remote handle with a zombie.
|
Map<K,ICacheElement<K,V>> |
processGetMatching(String pattern)
Calls get matching on the server.
|
protected boolean |
processRemove(K key)
Synchronously remove from the remote cache; if failed, replace the remote handle with a
zombie.
|
protected void |
processRemoveAll()
Synchronously removeAll from the remote cache; if failed, replace the remote handle with a
zombie.
|
protected void |
processUpdate(ICacheElement<K,V> ce)
Serializes the object and then calls update on the remote server with the byte array.
|
void |
setListenerId(long id)
let the remote cache set a listener_id.
|
protected void |
setRemoteCacheAttributes(IRemoteCacheAttributes remoteCacheAttributes) |
protected void |
setRemoteCacheListener(IRemoteCacheListener<K,V> remoteCacheListener) |
protected void |
setRemoteCacheService(ICacheServiceNonLocal<K,V> remote) |
dispose, disposeWithEventLogging, get, getMatching, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, remove, removeAll, removeAllWithEventLogging, removeWithEventLogging, update, updateWithEventLoggingcreateICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getEventLoggingExtraInfo, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, processGetMultiple, setCacheEventLogger, setElementSerializer, setKeyMatcherclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetCacheEventLogger, setElementSerializerdispose, get, getMatching, getMultiple, remove, removeAll, setKeyMatcher, updateprotected final String cacheName
public AbstractRemoteAuxiliaryCache(IRemoteCacheAttributes cattr, ICacheServiceNonLocal<K,V> remote, IRemoteCacheListener<K,V> listener)
cattr - remote - listener - protected void processDispose()
throws IOException
processDispose in class AbstractAuxiliaryCacheEventLogging<K,V>IOExceptionprotected ICacheElement<K,V> processGet(K key) throws IOException
Use threadpool to timeout if a value is set for GetTimeoutMillis
If we are a cluster client, we need to leave the Element in its serialized form. Cluster clients cannot deserialize objects. Cluster clients get ICacheElementSerialized objects from other remote servers.
processGet in class AbstractAuxiliaryCacheEventLogging<K,V>key - IOExceptionpublic ICacheElement<K,V> getUsingPool(K key) throws IOException
key - IOExceptionpublic Map<K,ICacheElement<K,V>> processGetMatching(String pattern) throws IOException
processGetMatching in class AbstractAuxiliaryCacheEventLogging<K,V>pattern - IOExceptionprotected boolean processRemove(K key) throws IOException
processRemove in class AbstractAuxiliaryCacheEventLogging<K,V>key - IOExceptionprotected void processRemoveAll()
throws IOException
processRemoveAll in class AbstractAuxiliaryCacheEventLogging<K,V>IOExceptionprotected void processUpdate(ICacheElement<K,V> ce) throws IOException
processUpdate in class AbstractAuxiliaryCacheEventLogging<K,V>ce - IOExceptionpublic Set<K> getKeySet() throws IOException
getKeySet in interface AuxiliaryCache<K,V>IOException - if access to the auxiliary cache failsAuxiliaryCache.getKeySet()public IRemoteCacheListener<K,V> getListener()
getListener in interface IRemoteCacheClient<K,V>public void setListenerId(long id)
id - The new listenerId valuepublic long getListenerId()
getListenerId in interface IRemoteCacheClient<K,V>public int getSize()
protected abstract void handleException(Exception ex, String msg, String eventName) throws IOException
ex - msg - eventName - IOExceptionpublic String getStats()
public IStats getStatistics()
getStatistics in interface AuxiliaryCache<K,V>public CacheStatus getStatus()
public void fixCache(ICacheServiceNonLocal<?,?> restoredRemote)
fixCache in interface IRemoteCacheClient<K,V>restoredRemote - ICacheServiceNonLocal -- the remote server or proxy to the remote serverpublic ICacheType.CacheType getCacheType()
getCacheType in interface ICacheTypepublic String getCacheName()
getCacheName in interface ICache<K,V>protected void setRemoteCacheService(ICacheServiceNonLocal<K,V> remote)
remote - the remote to setprotected ICacheServiceNonLocal<K,V> getRemoteCacheService()
public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
AuxiliaryCachegetAuxiliaryCacheAttributes in interface AuxiliaryCache<K,V>protected void setRemoteCacheAttributes(IRemoteCacheAttributes remoteCacheAttributes)
remoteCacheAttributes - the remoteCacheAttributes to setprotected IRemoteCacheAttributes getRemoteCacheAttributes()
protected void setRemoteCacheListener(IRemoteCacheListener<K,V> remoteCacheListener)
remoteCacheListener - the remoteCacheListener to setprotected IRemoteCacheListener<K,V> getRemoteCacheListener()
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.