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
URISyntaxException
public void setDiscoveryListener(DiscoveryListener listener)
DiscoveryAgent
setDiscoveryListener
in interface DiscoveryAgent
listener
- the listener to notify on discovery events, or null to clear.public DiscoveryListener getDiscoveryListener()
public boolean isSchedulerRequired()
DiscoveryAgent
isSchedulerRequired
in interface DiscoveryAgent
public void setScheduler(ScheduledExecutorService scheduler)
DiscoveryAgent
setScheduler
in interface DiscoveryAgent
scheduler
- An initialized Scheduler service that this agent can use for its work.public void start() throws IOException, IllegalStateException
DiscoveryAgent
start
in interface DiscoveryAgent
IOException
- if an IO error occurs while starting the agent.IllegalStateException
- if the agent is not properly configured.public void close()
DiscoveryAgent
close
in interface DiscoveryAgent
public void suspend()
DiscoveryAgent
suspend
in interface DiscoveryAgent
public void resume()
DiscoveryAgent
resume
in interface DiscoveryAgent
public 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.