|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.auxiliary.remote.AbsractRemoteCacheListener
public abstract class AbsractRemoteCacheListener
Shared listener base.
Field Summary | |
---|---|
protected ICompositeCacheManager |
cacheMgr
The cache manager used to put items in different 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 |
Constructor Summary | |
---|---|
AbsractRemoteCacheListener(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. |
String |
getLocalHostAddress()
This is for debugging. |
int |
getRemoteType()
Gets the remoteType attribute of the RemoteCacheListener object |
void |
handleDispose(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(String cacheName,
Serializable key)
Calls localRemove on the CompositeCache. |
void |
handleRemoveAll(String cacheName)
Calls localRemoveAll on the CompositeCache. |
void |
setListenerId(long id)
Let the remote cache set a listener_id. |
String |
toString()
For easier debugging. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener |
---|
dispose |
Field Detail |
---|
protected transient ICompositeCacheManager cacheMgr
protected IRemoteCacheAttributes irca
protected int puts
protected int removes
protected long listenerId
Constructor Detail |
---|
public AbsractRemoteCacheListener(IRemoteCacheAttributes irca, ICompositeCacheManager cacheMgr)
The constructor exports this object, making it available to receive incoming calls. The callback port is anonymous unless a local port value was specified in the configuration.
irca
- cacheMgr
- Method Detail |
---|
public void setListenerId(long id) throws IOException
setListenerId
in interface IRemoteCacheListener
setListenerId
in interface ICacheListener
id
- The new listenerId value
IOException
public long getListenerId() throws IOException
getListenerId
in interface IRemoteCacheListener
getListenerId
in interface ICacheListener
IOException
public int getRemoteType() throws IOException
getRemoteType
in interface IRemoteCacheListener
IOException
public void handlePut(ICacheElement cb) throws IOException
If remove on put is not configured, then update the item.
handlePut
in interface ICacheListener
cb
-
IOException
public void handleRemove(String cacheName, Serializable key) throws IOException
handleRemove
in interface ICacheListener
cacheName
- key
-
IOException
public void handleRemoveAll(String cacheName) throws IOException
handleRemoveAll
in interface ICacheListener
cacheName
-
IOException
public void handleDispose(String cacheName) throws IOException
ICacheListener
handleDispose
in interface ICacheListener
cacheName
-
IOException
protected void ensureCacheManager()
public String getLocalHostAddress() throws IOException
getLocalHostAddress
in interface IRemoteCacheListener
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |