public class WrappedFileWatcher extends AbstractWatcher implements FileWatcher
AbstractWatcher.ReconfigurationRunnable| Modifier and Type | Field and Description |
|---|---|
private long |
lastModifiedMillis |
private FileWatcher |
watcher |
CATEGORY, ELEMENT_TYPE| Constructor and Description |
|---|
WrappedFileWatcher(FileWatcher watcher) |
WrappedFileWatcher(FileWatcher watcher,
Configuration configuration,
Reconfigurable reconfigurable,
java.util.List<ConfigurationListener> configurationListeners,
long lastModifiedMillis) |
| Modifier and Type | Method and Description |
|---|---|
void |
fileModified(java.io.File file)
Called when a
WatchManager detects that the given File changed. |
long |
getLastModified()
Returns the time the source was last modified or 0 if it is not available.
|
java.util.List<ConfigurationListener> |
getListeners()
Returns the list of listeners for this configuration.
|
boolean |
isModified()
Periodically called to determine if the configuration has been modified.
|
void |
modified()
Called when the configuration has been modified.
|
Watcher |
newWatcher(Reconfigurable reconfigurable,
java.util.List<ConfigurationListener> listeners,
long lastModifiedMillis)
Creates a new Watcher by copying the original and using the new Reconfigurable and listeners.
|
void |
watching(Source source)
Called when the Watcher is registered.
|
getConfiguration, getSourceprivate final FileWatcher watcher
private volatile long lastModifiedMillis
public WrappedFileWatcher(FileWatcher watcher, Configuration configuration, Reconfigurable reconfigurable, java.util.List<ConfigurationListener> configurationListeners, long lastModifiedMillis)
public WrappedFileWatcher(FileWatcher watcher)
public long getLastModified()
WatchergetLastModified in interface WatchergetLastModified in class AbstractWatcherpublic void fileModified(java.io.File file)
FileWatcherWatchManager detects that the given File changed.fileModified in interface FileWatcherfile - the file that changed.WatchManagerpublic boolean isModified()
WatcherisModified in interface WatcherisModified in class AbstractWatcherpublic java.util.List<ConfigurationListener> getListeners()
WatchergetListeners in interface WatchergetListeners in class AbstractWatcherpublic void modified()
Watchermodified in interface Watchermodified in class AbstractWatcherpublic void watching(Source source)
Watcherwatching in interface Watcherwatching in class AbstractWatchersource - the Source that is being watched.public Watcher newWatcher(Reconfigurable reconfigurable, java.util.List<ConfigurationListener> listeners, long lastModifiedMillis)
WatchernewWatcher in interface Watcherreconfigurable - The Reconfigurable.listeners - the listeners.lastModifiedMillis - The time the resource was last modified in milliseconds.