public class UDPDiscoveryService extends java.lang.Object implements IShutdownObserver
It also creates a sender that periodically broadcasts its availability.
The sender also broadcasts a request for other caches to broadcast their addresses.
Modifier and Type | Field and Description |
---|---|
protected ICacheEventLogger |
cacheEventLogger
The event logger.
|
protected IElementSerializer |
elementSerializer
The serializer.
|
Constructor and Description |
---|
UDPDiscoveryService(java.lang.String discoveryAddress,
int discoveryPort,
int servicePort,
ICompositeCacheManager cacheMgr,
ICacheEventLogger cacheEventLogger,
IElementSerializer elementSerializer) |
Modifier and Type | Method and Description |
---|---|
protected void |
addNoWait(LateralCacheNoWait noWait)
This adds nowaits to a facde for the region name.
|
boolean |
addNoWaitFacade(LateralCacheNoWaitFacade facade,
java.lang.String cacheName)
Adds a nowait facade under this cachename.
|
protected java.util.ArrayList |
getCacheNames()
Get all the cache names we have facades for.
|
protected java.lang.String |
getDiscoveryAddress() |
protected int |
getDiscoveryPort() |
protected int |
getServicePort() |
ITCPLateralCacheAttributes |
getTcpLateralCacheAttributes() |
protected void |
serviceRequestBroadcast()
Send a passive broadcast in response to a request broadcast.
|
protected void |
setDiscoveryAddress(java.lang.String discoveryAddress) |
protected void |
setDiscoveryPort(int discoveryPort) |
protected void |
setServicePort(int servicePort) |
void |
setTcpLateralCacheAttributes(ITCPLateralCacheAttributes tCPLateralCacheAttributes) |
void |
shutdown()
Shuts down the receiver.
|
protected ICacheEventLogger cacheEventLogger
protected IElementSerializer elementSerializer
public UDPDiscoveryService(java.lang.String discoveryAddress, int discoveryPort, int servicePort, ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer)
discoveryAddress
- address to multicast todiscoveryPort
- port to multicast toservicePort
- the port this service runs on, the service we are telling other aboutcacheMgr
- cacheEventLogger
- elementSerializer
- public boolean addNoWaitFacade(LateralCacheNoWaitFacade facade, java.lang.String cacheName)
When a broadcast is received from the UDP Discovery receiver, for each cacheName in the message, the add no wait will be called here. To add a no wait, the facade is looked up for this cache name.
facade
- cacheName
- protected void addNoWait(LateralCacheNoWait noWait)
noWait
- protected void serviceRequestBroadcast()
protected java.util.ArrayList getCacheNames()
public void shutdown()
shutdown
in interface IShutdownObserver
protected void setDiscoveryAddress(java.lang.String discoveryAddress)
discoveryAddress
- The discoveryAddress to set.protected java.lang.String getDiscoveryAddress()
protected void setDiscoveryPort(int discoveryPort)
discoveryPort
- The discoveryPort to set.protected int getDiscoveryPort()
protected void setServicePort(int servicePort)
servicePort
- The servicePort to set.protected int getServicePort()
public void setTcpLateralCacheAttributes(ITCPLateralCacheAttributes tCPLateralCacheAttributes)
tCPLateralCacheAttributes
- The tCPLateralCacheAttributes to set.public ITCPLateralCacheAttributes getTcpLateralCacheAttributes()
Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.