|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPListener
Listens for connections from other TCP lateral caches and handles them.
| Nested Class Summary | |
class |
LateralTCPListener.ConnectionHandler
Separate thread run when a command comes into the LateralTCPReceiver. |
class |
LateralTCPListener.ListenerThread
Processes commands from the server socket. |
| Field Summary | |
protected static java.util.HashMap |
instances
Map of available instances, keyed by port |
| Constructor Summary | |
protected |
LateralTCPListener(ITCPLateralCacheAttributes ilca)
Only need one since it does work for all regions, just reference by multiple region names. |
| Method Summary | |
protected CompositeCache |
getCache(java.lang.String name)
Gets the cacheManager attribute of the LateralCacheTCPListener object. |
ICompositeCacheManager |
getCacheManager()
|
static ILateralCacheListener |
getInstance(ITCPLateralCacheAttributes ilca,
ICompositeCacheManager cacheMgr)
Gets the instance attribute of the LateralCacheTCPListener class. |
long |
getListenerId()
Gets the listenerId attribute of the LateralCacheTCPListener object |
int |
getPutCnt()
This is roughly the number of updates the lateral has received. |
int |
getRemoveCnt()
|
ITCPLateralCacheAttributes |
getTcpLateralCacheAttributes()
|
void |
handleDispose(java.lang.String cacheName)
Notifies the subscribers for freeing up the named cache. |
java.io.Serializable |
handleGet(java.lang.String cacheName,
java.io.Serializable key)
|
void |
handlePut(ICacheElement element)
Notifies the subscribers for a cache entry update. |
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 |
init()
This starts the ListenerThread on the specified port. |
void |
setCacheManager(ICompositeCacheManager cacheMgr)
|
void |
setListenerId(long id)
let the lateral cache set a listener_id. |
void |
setTcpLateralCacheAttributes(ITCPLateralCacheAttributes tcpLateralCacheAttributes)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final java.util.HashMap instances
| Constructor Detail |
protected LateralTCPListener(ITCPLateralCacheAttributes ilca)
ilca - | Method Detail |
public static ILateralCacheListener getInstance(ITCPLateralCacheAttributes ilca,
ICompositeCacheManager cacheMgr)
ilca - ITCPLateralCacheAttributescacheMgr -
public void init()
init in interface ILateralCacheListener
public void setListenerId(long id)
throws java.io.IOException
By default, the listener id is the vmid.
The service should set this value. This value will never be changed by a server we connect to. It needs to be non static, for unit tests.
The service will use the value it sets in all send requests to the sender.
setListenerId in interface ICacheListenerid - The new listenerId value
java.io.IOException
public long getListenerId()
throws java.io.IOException
getListenerId in interface ICacheListenerjava.io.IOException
public void handlePut(ICacheElement element)
throws java.io.IOException
ICacheListener
handlePut in interface ICacheListenerelement -
java.io.IOException
public void handleRemove(java.lang.String cacheName,
java.io.Serializable key)
throws java.io.IOException
ICacheListener
handleRemove in interface ICacheListenercacheName - key -
java.io.IOException
public void handleRemoveAll(java.lang.String cacheName)
throws java.io.IOException
ICacheListener
handleRemoveAll in interface ICacheListenercacheName -
java.io.IOException
public java.io.Serializable handleGet(java.lang.String cacheName,
java.io.Serializable key)
throws java.io.IOException
cacheName - key -
java.io.IOException
public void handleDispose(java.lang.String cacheName)
throws java.io.IOException
ICacheListener
handleDispose in interface ICacheListenercacheName -
java.io.IOExceptionprotected CompositeCache getCache(java.lang.String name)
Normally this is set by the factory. If it wasn't set the listener defaults to the expected singleton behavior of the cache amanger.
name -
public int getPutCnt()
public int getRemoveCnt()
public void setCacheManager(ICompositeCacheManager cacheMgr)
setCacheManager in interface ILateralCacheListenercacheMgr - The cacheMgr to set.public ICompositeCacheManager getCacheManager()
getCacheManager in interface ILateralCacheListenerpublic void setTcpLateralCacheAttributes(ITCPLateralCacheAttributes tcpLateralCacheAttributes)
tcpLateralCacheAttributes - The tcpLateralCacheAttributes to set.public ITCPLateralCacheAttributes getTcpLateralCacheAttributes()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||