|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.auxiliary.remote.RemoteCacheListener
Registered with RemoteCache server. The server updates the local caches via this listener. Each server asings a unique listener id for a listener.
One listener is used per remote cache server. The same listener is used for all the regions that talk to a particular server.
Field Summary | |
protected ICompositeCacheManager |
cacheMgr
The cache manager used to put items in differnt regions. |
protected IRemoteCacheAttributes |
irca
The remote cache configuration object. |
protected long |
listenerId
This is set by the remote cache server. |
protected int |
puts
Number of put requests received. |
protected int |
removes
Number of remove requests received. |
Fields inherited from interface org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener |
CLIENT_LISTENER, SERVER_LISTENER |
Fields inherited from interface org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheConstants |
REMOTE_ALLOW_CLUSTER_GET, REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_PORT, REMOTE_CACHE_SERVICE_VAL, REMOTE_LOCAL_CLUSTER_CONSISTENCY, TOMCAT_ON, TOMCAT_XML |
Constructor Summary | |
RemoteCacheListener(IRemoteCacheAttributes irca,
ICompositeCacheManager cacheMgr)
Only need one since it does work for all regions, just reference by multiple region names. |
Method Summary | |
protected void |
ensureCacheManager()
Gets the cacheManager attribute of the RemoteCacheListener object. |
long |
getListenerId()
Gets the listenerId attribute of the RemoteCacheListener object. |
int |
getRemoteType()
Gets the remoteType attribute of the RemoteCacheListener object |
void |
handleDispose(java.lang.String cacheName)
Notifies the subscribers for freeing up the named cache. |
void |
handlePut(ICacheElement cb)
If this is configured to remove on put, then remove the element since it has been updated elsewhere. |
void |
handleRemove(java.lang.String cacheName,
java.io.Serializable key)
Notifies the subscribers for a cache entry removal. |
void |
handleRemoveAll(java.lang.String cacheName)
Notifies the subscribers for a cache remove-all. |
void |
setListenerId(long id)
let the remote cache set a listener_id. |
java.lang.String |
toString()
For easier debugging. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected transient ICompositeCacheManager cacheMgr
protected IRemoteCacheAttributes irca
protected int puts
protected int removes
protected long listenerId
Constructor Detail |
public RemoteCacheListener(IRemoteCacheAttributes irca, ICompositeCacheManager cacheMgr)
The constructor exports this object, making it available to receive incoming calls. The calback port is anonymous unless a local port vlaue was specified in the configurtion.
irca
- cacheMgr
- Method Detail |
public void setListenerId(long id) throws java.io.IOException
setListenerId
in interface IRemoteCacheListener
id
- The new listenerId value
java.io.IOException
public long getListenerId() throws java.io.IOException
getListenerId
in interface IRemoteCacheListener
java.io.IOException
public int getRemoteType() throws java.io.IOException
getRemoteType
in interface IRemoteCacheListener
java.io.IOException
public void handlePut(ICacheElement cb) throws java.io.IOException
If remove on put is not ocnfigured, then update the item.
handlePut
in interface ICacheListener
cb
-
java.io.IOException
public void handleRemove(java.lang.String cacheName, java.io.Serializable key) throws java.io.IOException
ICacheListener
handleRemove
in interface ICacheListener
cacheName
- key
-
java.io.IOException
public void handleRemoveAll(java.lang.String cacheName) throws java.io.IOException
ICacheListener
handleRemoveAll
in interface ICacheListener
cacheName
-
java.io.IOException
public void handleDispose(java.lang.String cacheName) throws java.io.IOException
ICacheListener
handleDispose
in interface ICacheListener
cacheName
-
java.io.IOException
protected void ensureCacheManager()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |