public abstract class AbsractRemoteCacheListener extends java.lang.Object implements IRemoteCacheListener
| Modifier and Type | Field and Description |
|---|---|
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.
|
CLIENT_LISTENER, SERVER_LISTENER| Constructor and Description |
|---|
AbsractRemoteCacheListener(IRemoteCacheAttributes irca,
ICompositeCacheManager cacheMgr)
Only need one since it does work for all regions, just reference by multiple region names.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
ensureCacheManager()
Gets the cacheManager attribute of the RemoteCacheListener object.
|
long |
getListenerId()
Gets the listenerId attribute of the RemoteCacheListener object.
|
java.lang.String |
getLocalHostAddress()
This is for debugging.
|
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)
Calls localRemove on the CompositeCache.
|
void |
handleRemoveAll(java.lang.String cacheName)
Calls localRemoveAll on the CompositeCache.
|
void |
setListenerId(long id)
Let the remote cache set a listener_id.
|
java.lang.String |
toString()
For easier debugging.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdisposeprotected transient ICompositeCacheManager cacheMgr
protected IRemoteCacheAttributes irca
protected int puts
protected int removes
protected long listenerId
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 - public void setListenerId(long id)
throws java.io.IOException
setListenerId in interface IRemoteCacheListenersetListenerId in interface ICacheListenerid - The new listenerId valuejava.io.IOExceptionpublic long getListenerId()
throws java.io.IOException
getListenerId in interface IRemoteCacheListenergetListenerId in interface ICacheListenerjava.io.IOExceptionpublic int getRemoteType()
throws java.io.IOException
getRemoteType in interface IRemoteCacheListenerjava.io.IOExceptionpublic void handlePut(ICacheElement cb) throws java.io.IOException
If remove on put is not configured, then update the item.
handlePut in interface ICacheListenercb - java.io.IOExceptionpublic void handleRemove(java.lang.String cacheName,
java.io.Serializable key)
throws java.io.IOException
handleRemove in interface ICacheListenercacheName - key - java.io.IOExceptionpublic void handleRemoveAll(java.lang.String cacheName)
throws java.io.IOException
handleRemoveAll in interface ICacheListenercacheName - java.io.IOExceptionpublic void handleDispose(java.lang.String cacheName)
throws java.io.IOException
ICacheListenerhandleDispose in interface ICacheListenercacheName - java.io.IOExceptionprotected void ensureCacheManager()
public java.lang.String getLocalHostAddress()
throws java.io.IOException
getLocalHostAddress in interface IRemoteCacheListenerjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2002-2013 Apache Software Foundation. All Rights Reserved.