public abstract class AbstractRemoteAuxiliaryCache extends AbstractAuxiliaryCacheEventLogging implements IRemoteCacheClient
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
cacheName
The cacheName
|
cacheEventLogger, elementSerializer, keyMatcher
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
Constructor and Description |
---|
AbstractRemoteAuxiliaryCache(IRemoteCacheAttributes cattr,
IRemoteCacheService remote,
IRemoteCacheListener listener)
Creates the base.
|
Modifier and Type | Method and Description |
---|---|
void |
fixCache(IRemoteCacheService restoredRemote)
Replaces the current remote cache service handle with the given handle.
|
AuxiliaryCacheAttributes |
getAuxiliaryCacheAttributes()
This returns the generic attributes for an auxiliary cache.
|
java.lang.String |
getCacheName()
Gets the cacheName attribute of the RemoteCache object.
|
int |
getCacheType()
Gets the cacheType attribute of the RemoteCache object
|
java.util.Set |
getGroupKeys(java.lang.String groupName)
Returns all the keys for a group.
|
IRemoteCacheListener |
getListener()
Allows other member of this package to access the listerner.
|
long |
getListenerId()
Gets the listenerId attribute of the RemoteCacheListener object
|
protected IRemoteCacheAttributes |
getRemoteCacheAttributes() |
protected IRemoteCacheListener |
getRemoteCacheListener() |
protected IRemoteCacheService |
getRemoteCacheService() |
int |
getSize()
Returns the current cache size.
|
IStats |
getStatistics() |
java.lang.String |
getStats()
Gets the stats attribute of the RemoteCache object.
|
int |
getStatus()
Returns the cache status.
|
ICacheElement |
getUsingPool(java.io.Serializable key)
This allows gets to timeout in case of remote server machine shutdown.
|
protected abstract void |
handleException(java.lang.Exception ex,
java.lang.String msg,
java.lang.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 |
processGet(java.io.Serializable key)
Synchronously get from the remote cache; if failed, replace the remote handle with a zombie.
|
java.util.Map |
processGetMatching(java.lang.String pattern)
Calls get matching on the server.
|
protected java.util.Map |
processGetMultiple(java.util.Set keys)
Gets multiple items from the cache based on the given set of keys.
|
protected boolean |
processRemove(java.io.Serializable 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 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 remoteCacheListener) |
protected void |
setRemoteCacheService(IRemoteCacheService remote) |
dispose, disposeWithEventLogging, get, getMatching, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, remove, removeAll, removeAllWithEventLogging, removeWithEventLogging, update, updateWithEventLogging
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getEventLoggingExtraInfo, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, setCacheEventLogger, setElementSerializer, setKeyMatcher
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setCacheEventLogger, setElementSerializer
dispose, get, getMatching, getMultiple, remove, removeAll, setKeyMatcher, update
public AbstractRemoteAuxiliaryCache(IRemoteCacheAttributes cattr, IRemoteCacheService remote, IRemoteCacheListener listener)
cattr
- remote
- listener
- protected void processDispose() throws java.io.IOException
processDispose
in class AbstractAuxiliaryCacheEventLogging
java.io.IOException
protected ICacheElement processGet(java.io.Serializable key) throws java.io.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
key
- java.io.IOException
public ICacheElement getUsingPool(java.io.Serializable key) throws java.io.IOException
key
- java.io.IOException
public java.util.Map processGetMatching(java.lang.String pattern) throws java.io.IOException
processGetMatching
in class AbstractAuxiliaryCacheEventLogging
pattern
- java.io.IOException
protected java.util.Map processGetMultiple(java.util.Set keys) throws java.io.IOException
processGetMultiple
in class AbstractAuxiliaryCacheEventLogging
keys
- java.io.IOException
protected boolean processRemove(java.io.Serializable key) throws java.io.IOException
processRemove
in class AbstractAuxiliaryCacheEventLogging
key
- java.io.IOException
protected void processRemoveAll() throws java.io.IOException
processRemoveAll
in class AbstractAuxiliaryCacheEventLogging
java.io.IOException
protected void processUpdate(ICacheElement ce) throws java.io.IOException
processUpdate
in class AbstractAuxiliaryCacheEventLogging
ce
- java.io.IOException
public java.util.Set getGroupKeys(java.lang.String groupName) throws java.rmi.RemoteException, java.io.IOException
getGroupKeys
in interface AuxiliaryCache
groupName
- java.rmi.RemoteException
java.io.IOException
public IRemoteCacheListener getListener()
getListener
in interface IRemoteCacheClient
public void setListenerId(long id)
id
- The new listenerId valuepublic long getListenerId()
getListenerId
in interface IRemoteCacheClient
public int getSize()
protected abstract void handleException(java.lang.Exception ex, java.lang.String msg, java.lang.String eventName) throws java.io.IOException
ex
- msg
- eventName
- java.io.IOException
public java.lang.String getStats()
public IStats getStatistics()
getStatistics
in interface AuxiliaryCache
public int getStatus()
public void fixCache(IRemoteCacheService restoredRemote)
fixCache
in interface IRemoteCacheClient
restoredRemote
- IRemoteCacheService -- the remote server or proxy to the remote serverpublic int getCacheType()
getCacheType
in interface ICacheType
public java.lang.String getCacheName()
getCacheName
in interface ICache
protected void setRemoteCacheService(IRemoteCacheService remote)
remote
- the remote to setprotected IRemoteCacheService getRemoteCacheService()
public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
AuxiliaryCache
getAuxiliaryCacheAttributes
in interface AuxiliaryCache
protected void setRemoteCacheAttributes(IRemoteCacheAttributes remoteCacheAttributes)
remoteCacheAttributes
- the remoteCacheAttributes to setprotected IRemoteCacheAttributes getRemoteCacheAttributes()
protected void setRemoteCacheListener(IRemoteCacheListener remoteCacheListener)
remoteCacheListener
- the remoteCacheListener to setprotected IRemoteCacheListener getRemoteCacheListener()
Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.