|
||||||||||
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.LateralTCPDiscoveryListener
public class LateralTCPDiscoveryListener
This knows how to add and remove discovered services. It observers UDP discovery events.
We can have one listener per region, or one shared by all regions.
Field Summary | |
---|---|
protected ICacheEventLogger |
cacheEventLogger
The event logger. |
protected IElementSerializer |
elementSerializer
The serializer. |
Constructor Summary | |
---|---|
protected |
LateralTCPDiscoveryListener(ICompositeCacheManager cacheMgr,
ICacheEventLogger cacheEventLogger,
IElementSerializer elementSerializer)
This plugs into the udp discovery system. |
Method Summary | |
---|---|
void |
addDiscoveredService(DiscoveredService service)
Creates the lateral cache if needed. |
protected boolean |
addNoWait(LateralCacheNoWait noWait)
When a broadcast is received from the UDP Discovery receiver, for each cacheName in the message, the add no wait will be called here. |
boolean |
addNoWaitFacade(String cacheName,
LateralCacheNoWaitFacade facade)
Adds a nowait facade under this cachename. |
boolean |
containsNoWait(String cacheName,
LateralCacheNoWait noWait)
Allows us to see if the facade is present and if it has the no wait. |
boolean |
containsNoWaitFacade(String cacheName)
Allows us to see if the facade is present. |
void |
removeDiscoveredService(DiscoveredService service)
Removes the lateral cache. |
protected boolean |
removeNoWait(LateralCacheNoWait noWait)
Look up the facade for the name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ICacheEventLogger cacheEventLogger
protected IElementSerializer elementSerializer
Constructor Detail |
---|
protected LateralTCPDiscoveryListener(ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer)
cacheMgr
- cacheEventLogger
- elementSerializer
- Method Detail |
---|
public boolean addNoWaitFacade(String cacheName, LateralCacheNoWaitFacade facade)
This adds nowaits to a facade for the region name. If the region has no facade, then it is not configured to use the lateral cache, and no facade will be created.
cacheName
- - the region namefacade
- - facade (for region) => multiple lateral clients.
public boolean containsNoWaitFacade(String cacheName)
cacheName
- - facades are for a region
public boolean containsNoWait(String cacheName, LateralCacheNoWait noWait)
cacheName
- - facades are for a regionnoWait
- - is this no wait in the facade
protected boolean addNoWait(LateralCacheNoWait noWait)
Each region has a facade. The facade contains a list of end points--the other tcp lateral services.
noWait
-
protected boolean removeNoWait(LateralCacheNoWait noWait)
noWait
-
public void addDiscoveredService(DiscoveredService service)
We could go to the composite cache manager and get the the cache for the region. This would force a full configuration of the region. One advantage of this would be that the creation of the later would go through the factory, which would add the item to the no wait list. But we don't want to do this. This would force this client to have all the regions as the other. This might not be desired. We don't want to send or receive for a region here that is either not used or not configured to use the lateral.
Right now, I'm afraid that the region will get puts if another instance has the region configured to use the lateral and our address is configured. This might be a bug, but it shouldn't happen with discovery.
addDiscoveredService
in interface IDiscoveryListener
service
- public void removeDiscoveredService(DiscoveredService service)
We need to tell the manager that this instance is bad, so it will reconnect the sender if it comes back.
removeDiscoveredService
in interface IDiscoveryListener
service
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |