|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.auxiliary.AbstractAuxiliaryCache
org.apache.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging
org.apache.jcs.auxiliary.remote.AbstractRemoteAuxiliaryCache
public abstract class AbstractRemoteAuxiliaryCache
Abstract base for remote caches. I'm trying to break out and reuse common functionality.
Field Summary | |
---|---|
protected java.lang.String |
cacheName
The cacheName |
Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache |
---|
cacheEventLogger, elementSerializer, keyMatcher |
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType |
---|
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE |
Constructor Summary | |
---|---|
AbstractRemoteAuxiliaryCache(IRemoteCacheAttributes cattr,
IRemoteCacheService remote,
IRemoteCacheListener listener)
Creates the base. |
Method Summary | |
---|---|
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)
|
Methods inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging |
---|
dispose, disposeWithEventLogging, get, getMatching, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, remove, removeAll, removeAllWithEventLogging, removeWithEventLogging, update, updateWithEventLogging |
Methods inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache |
---|
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getEventLoggingExtraInfo, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, setCacheEventLogger, setElementSerializer, setKeyMatcher |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.jcs.auxiliary.AuxiliaryCache |
---|
setCacheEventLogger, setElementSerializer |
Methods inherited from interface org.apache.jcs.engine.behavior.ICache |
---|
dispose, get, getMatching, getMultiple, remove, removeAll, setKeyMatcher, update |
Field Detail |
---|
protected final java.lang.String cacheName
Constructor Detail |
---|
public AbstractRemoteAuxiliaryCache(IRemoteCacheAttributes cattr, IRemoteCacheService remote, IRemoteCacheListener listener)
cattr
- remote
- listener
- Method Detail |
---|
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()
getSize
in interface ICache
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()
getStats
in interface ICache
public IStats getStatistics()
getStatistics
in interface AuxiliaryCache
public int getStatus()
getStatus
in interface ICache
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |