|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jcs.auxiliary.AbstractAuxiliaryCache<K,V>
org.apache.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging<K,V>
org.apache.jcs.auxiliary.remote.AbstractRemoteAuxiliaryCache<K,V>
public abstract class AbstractRemoteAuxiliaryCache<K extends Serializable,V extends Serializable>
Abstract base for remote caches. I'm trying to break out and reuse common functionality.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.jcs.engine.behavior.ICacheType |
|---|
ICacheType.CacheType |
| Field Summary | |
|---|---|
protected String |
cacheName
The cacheName |
| Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache |
|---|
cacheEventLogger, elementSerializer, keyMatcher |
| Constructor Summary | |
|---|---|
AbstractRemoteAuxiliaryCache(IRemoteCacheAttributes cattr,
ICacheServiceNonLocal<K,V> remote,
IRemoteCacheListener<K,V> listener)
Creates the base. |
|
| Method Summary | |
|---|---|
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> |
getGroupKeys(String groupName)
Returns all the keys for a group. |
Set<String> |
getGroupNames()
Returns all the group names for a 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 Map<K,ICacheElement<K,V>> |
processGetMultiple(Set<K> keys)
Gets multiple items from the cache based on the given set of keys. |
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)
|
| 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 String cacheName
| Constructor Detail |
|---|
public AbstractRemoteAuxiliaryCache(IRemoteCacheAttributes cattr,
ICacheServiceNonLocal<K,V> remote,
IRemoteCacheListener<K,V> listener)
cattr - remote - listener - | Method Detail |
|---|
protected void processDispose()
throws IOException
processDispose in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>IOException
protected 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 extends Serializable,V extends Serializable>key -
IOException
public ICacheElement<K,V> getUsingPool(K key)
throws IOException
key -
IOException
public Map<K,ICacheElement<K,V>> processGetMatching(String pattern)
throws IOException
processGetMatching in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>pattern -
IOException
protected Map<K,ICacheElement<K,V>> processGetMultiple(Set<K> keys)
throws IOException
processGetMultiple in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>keys -
IOException
protected boolean processRemove(K key)
throws IOException
processRemove in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>key -
IOException
protected void processRemoveAll()
throws IOException
processRemoveAll in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>IOException
protected void processUpdate(ICacheElement<K,V> ce)
throws IOException
processUpdate in class AbstractAuxiliaryCacheEventLogging<K extends Serializable,V extends Serializable>ce -
IOException
public Set<K> getGroupKeys(String groupName)
throws RemoteException,
IOException
getGroupKeys in interface AuxiliaryCache<K extends Serializable,V extends Serializable>groupName -
RemoteException
IOException
public Set<String> getGroupNames()
throws RemoteException,
IOException
getGroupNames in interface AuxiliaryCache<K extends Serializable,V extends Serializable>RemoteException
IOExceptionpublic IRemoteCacheListener<K,V> getListener()
getListener in interface IRemoteCacheClient<K extends Serializable,V extends Serializable>public void setListenerId(long id)
id - The new listenerId valuepublic long getListenerId()
getListenerId in interface IRemoteCacheClient<K extends Serializable,V extends Serializable>public int getSize()
getSize in interface ICache<K extends Serializable,V extends Serializable>
protected abstract void handleException(Exception ex,
String msg,
String eventName)
throws IOException
ex - msg - eventName -
IOExceptionpublic String getStats()
getStats in interface ICache<K extends Serializable,V extends Serializable>public IStats getStatistics()
getStatistics in interface AuxiliaryCache<K extends Serializable,V extends Serializable>public CacheStatus getStatus()
getStatus in interface ICache<K extends Serializable,V extends Serializable>public void fixCache(ICacheServiceNonLocal<?,?> restoredRemote)
fixCache in interface IRemoteCacheClient<K extends Serializable,V extends Serializable>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 extends Serializable,V extends Serializable>protected void setRemoteCacheService(ICacheServiceNonLocal<K,V> remote)
remote - the remote to setprotected ICacheServiceNonLocal<K,V> getRemoteCacheService()
public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
AuxiliaryCache
getAuxiliaryCacheAttributes in interface AuxiliaryCache<K extends Serializable,V extends Serializable>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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||