public class WatchManager extends AbstractLifeCycle
Modifier and Type | Class and Description |
---|---|
private class |
WatchManager.FileMonitor |
private class |
WatchManager.WatchRunnable |
LifeCycle.State
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.ScheduledFuture<?> |
future |
private int |
intervalSeconds |
private static Logger |
logger |
private ConfigurationScheduler |
scheduler |
private java.util.concurrent.ConcurrentMap<java.io.File,WatchManager.FileMonitor> |
watchers |
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
Constructor and Description |
---|
WatchManager(ConfigurationScheduler scheduler) |
Modifier and Type | Method and Description |
---|---|
int |
getIntervalSeconds() |
java.util.Map<java.io.File,FileWatcher> |
getWatchers() |
void |
setIntervalSeconds(int intervalSeconds) |
void |
start() |
boolean |
stop(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current
thread is interrupted, whichever happens first.
|
void |
watchFile(java.io.File file,
FileWatcher watcher) |
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
private static Logger logger
private final java.util.concurrent.ConcurrentMap<java.io.File,WatchManager.FileMonitor> watchers
private int intervalSeconds
private java.util.concurrent.ScheduledFuture<?> future
private final ConfigurationScheduler scheduler
public WatchManager(ConfigurationScheduler scheduler)
public void setIntervalSeconds(int intervalSeconds)
public int getIntervalSeconds()
public void start()
start
in interface LifeCycle
start
in class AbstractLifeCycle
public boolean stop(long timeout, java.util.concurrent.TimeUnit timeUnit)
LifeCycle2
stop
in interface LifeCycle2
stop
in class AbstractLifeCycle
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentpublic void watchFile(java.io.File file, FileWatcher watcher)
public java.util.Map<java.io.File,FileWatcher> getWatchers()