public class FileWatcherDiscoveryAgent extends Object implements DiscoveryAgent
| Constructor and Description |
|---|
FileWatcherDiscoveryAgent(URI discoveryURI) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stops the agent after which no new remote peers will be found.
|
DiscoveryListener |
getDiscoveryListener() |
URI |
getDiscvoeryURI() |
int |
getUpdateInterval() |
boolean |
isSchedulerRequired()
Indicates if this DiscoveryAgent requires a ScheduledExecutorService in order
to perform its discovery work.
|
void |
resume()
Resumes discovery by this agent if it was previously suspended.
|
void |
setDiscoveryListener(DiscoveryListener listener)
Sets the discovery listener
|
void |
setScheduler(ScheduledExecutorService scheduler)
Provider a ScheduledExecutorService to the DiscoveryAgent that requires a
scheduler to perform its discovery work.
|
void |
setUpdateInterval(int updateInterval) |
void |
start()
Starts the agent after which new remote peers can start to be found.
|
void |
suspend()
Suspends the Agent which suppresses any new attempts to discover remote
peers until the agent is resumed.
|
String |
toString() |
public FileWatcherDiscoveryAgent(URI discoveryURI) throws URISyntaxException
URISyntaxExceptionpublic void setDiscoveryListener(DiscoveryListener listener)
DiscoveryAgentsetDiscoveryListener in interface DiscoveryAgentlistener - the listener to notify on discovery events, or null to clear.public DiscoveryListener getDiscoveryListener()
public boolean isSchedulerRequired()
DiscoveryAgentisSchedulerRequired in interface DiscoveryAgentpublic void setScheduler(ScheduledExecutorService scheduler)
DiscoveryAgentsetScheduler in interface DiscoveryAgentscheduler - An initialized Scheduler service that this agent can use for its work.public void start()
throws IOException,
IllegalStateException
DiscoveryAgentstart in interface DiscoveryAgentIOException - if an IO error occurs while starting the agent.IllegalStateException - if the agent is not properly configured.public void close()
DiscoveryAgentclose in interface DiscoveryAgentpublic void suspend()
DiscoveryAgentsuspend in interface DiscoveryAgentpublic void resume()
DiscoveryAgentresume in interface DiscoveryAgentpublic URI getDiscvoeryURI()
public int getUpdateInterval()
public void setUpdateInterval(int updateInterval)
updateInterval - the update interval to use for watching resources for changes.Copyright © 2013–2016 The Apache Software Foundation. All rights reserved.