|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jcs.auxiliary.remote.RemoteCache
public class RemoteCache
Client proxy for an RMI remote cache. This handles gets, updates, and removes. It also initiates failover recovery when an error is encountered.
| Field Summary |
|---|
| Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType |
|---|
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE |
| Constructor Summary | |
|---|---|
RemoteCache(IRemoteCacheAttributes cattr,
IRemoteCacheService remote,
IRemoteCacheListener listener)
Constructor for the RemoteCache object. |
|
| Method Summary | |
|---|---|
void |
dispose()
Synchronously dispose the remote cache; if failed, replace the remote handle with a zombie. |
void |
fixCache(IRemoteCacheService remote)
Replaces the current remote cache service handle with the given handle. |
ICacheElement |
get(java.io.Serializable key)
Synchronously get from the remote cache; if failed, replace the remote handle with a zombie. |
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 |
IElementAttributes |
getElementAttributes()
Gets the attributes attribute of the RemoteCache object. |
IElementSerializer |
getElementSerializer()
|
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 |
int |
getSize()
Returns the current cache size. |
IStats |
getStatistics()
Returns the historical and statistical data for a region's auxiliary cache. |
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. |
boolean |
remove(java.io.Serializable key)
Synchronously remove from the remote cache; if failed, replace the remote handle with a zombie. |
void |
removeAll()
Synchronously removeAll from the remote cache; if failed, replace the remote handle with a zombie. |
void |
setElementAttributes(IElementAttributes attr)
Sets the attributes attribute of the RemoteCache object. |
void |
setElementSerializer(IElementSerializer elementSerializer)
|
void |
setListenerId(long id)
let the remote cache set a listener_id. |
java.lang.String |
toString()
Debugging info. |
void |
update(ICacheElement ce)
Serializes the object and then calls update on the remote server with the byte array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteCache(IRemoteCacheAttributes cattr,
IRemoteCacheService remote,
IRemoteCacheListener listener)
cattr - remote - listener - | Method Detail |
|---|
public void setElementAttributes(IElementAttributes attr)
attr - The new attributes valuepublic IElementAttributes getElementAttributes()
public void update(ICacheElement ce)
throws java.io.IOException
(non-Javadoc)
update in interface AuxiliaryCacheupdate in interface ICachejava.io.IOExceptionICache.update(org.apache.jcs.engine.behavior.ICacheElement)
public ICacheElement get(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 serilaized form. Cluster cients cannot deserialize objects. Cluster clients get ICacheElementSerialized objects from other remote servers.
get in interface AuxiliaryCacheget in interface ICachekey -
java.io.IOException
public ICacheElement getUsingPool(java.io.Serializable key)
throws java.io.IOException
key -
java.io.IOException
public java.util.Set getGroupKeys(java.lang.String groupName)
throws java.rmi.RemoteException
getGroupKeys in interface AuxiliaryCachegroupName -
java.rmi.RemoteException
public boolean remove(java.io.Serializable key)
throws java.io.IOException
remove in interface AuxiliaryCacheremove in interface ICachekey -
java.io.IOException
public void removeAll()
throws java.io.IOException
removeAll in interface AuxiliaryCacheremoveAll in interface ICachejava.io.IOException
public void dispose()
throws java.io.IOException
dispose in interface AuxiliaryCachedispose in interface ICachejava.io.IOExceptionpublic int getStatus()
getStatus in interface AuxiliaryCachegetStatus in interface ICachepublic java.lang.String getStats()
getStats in interface ICachepublic IStats getStatistics()
AuxiliaryCache
getStatistics in interface AuxiliaryCachepublic int getSize()
getSize in interface AuxiliaryCachegetSize in interface ICachepublic int getCacheType()
getCacheType in interface ICacheTypepublic java.lang.String getCacheName()
getCacheName in interface AuxiliaryCachegetCacheName in interface ICachepublic void fixCache(IRemoteCacheService remote)
fixCache in interface IRemoteCacheClientremote - IRemoteCacheService -- the remote server or proxy to the remote serverpublic AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
AuxiliaryCache
getAuxiliaryCacheAttributes in interface AuxiliaryCachepublic void setListenerId(long id)
id - The new listenerId valuepublic long getListenerId()
getListenerId in interface IRemoteCacheClientpublic IRemoteCacheListener getListener()
getListener in interface IRemoteCacheClientpublic void setElementSerializer(IElementSerializer elementSerializer)
elementSerializer - The elementSerializer to set.public IElementSerializer getElementSerializer()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||