|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jcs.utils.discovery.UDPDiscoveryService
public class UDPDiscoveryService
This service creates a listener that can create lateral caches and add them to the no wait list.
It also creates a sender that periodically broadcasts its availability.
The sender also broadcasts a request for other caches to broadcast their addresses.
| Constructor Summary | |
|---|---|
UDPDiscoveryService(UDPDiscoveryAttributes attributes,
ICacheEventLogger cacheEventLogger)
|
|
| Method Summary | |
|---|---|
boolean |
addDiscoveryListener(IDiscoveryListener listener)
Adds a listener. |
protected void |
addOrUpdateService(DiscoveredService discoveredService)
Add a service to the list. |
void |
addParticipatingCacheName(String cacheName)
Adds a region to the list that is participating in discovery. |
protected void |
finalize()
Call shutdown to be safe. |
protected ArrayList<String> |
getCacheNames()
Get all the cache names we have facades for. |
Set<IDiscoveryListener> |
getCopyOfDiscoveryListeners()
|
Set<DiscoveredService> |
getDiscoveredServices()
|
UDPDiscoveryAttributes |
getUdpDiscoveryAttributes()
|
void |
removeDiscoveredService(DiscoveredService service)
Removes the discovered service from the list and calls the discovery listener. |
boolean |
removeDiscoveryListener(IDiscoveryListener listener)
Removes a listener. |
protected void |
serviceRequestBroadcast()
Send a passive broadcast in response to a request broadcast. |
void |
setDiscoveredServices(Set<DiscoveredService> discoveredServices)
|
void |
setScheduledExecutorService(ScheduledExecutorService scheduledExecutor)
Inject an instance of a central ScheduledExecutorService |
void |
setUdpDiscoveryAttributes(UDPDiscoveryAttributes attr)
|
void |
shutdown()
Shuts down the receiver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UDPDiscoveryService(UDPDiscoveryAttributes attributes,
ICacheEventLogger cacheEventLogger)
attributes - cacheEventLogger - | Method Detail |
|---|
public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutor)
IRequireScheduler
setScheduledExecutorService in interface IRequireSchedulerIRequireScheduler.setScheduledExecutorService(java.util.concurrent.ScheduledExecutorService)protected void serviceRequestBroadcast()
public void addParticipatingCacheName(String cacheName)
cacheName - public void removeDiscoveredService(DiscoveredService service)
service - protected void addOrUpdateService(DiscoveredService discoveredService)
discoveredService - discovered serviceprotected ArrayList<String> getCacheNames()
public void setUdpDiscoveryAttributes(UDPDiscoveryAttributes attr)
attr - The UDPDiscoveryAttributes to set.public UDPDiscoveryAttributes getUdpDiscoveryAttributes()
public void shutdown()
shutdown in interface IShutdownObserver
protected void finalize()
throws Throwable
finalize in class ObjectThrowable - on errorpublic void setDiscoveredServices(Set<DiscoveredService> discoveredServices)
discoveredServices - The discoveredServices to set.public Set<DiscoveredService> getDiscoveredServices()
public Set<IDiscoveryListener> getCopyOfDiscoveryListeners()
public boolean addDiscoveryListener(IDiscoveryListener listener)
listener -
public boolean removeDiscoveryListener(IDiscoveryListener listener)
listener -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||