public interface Watcher
WatchManager
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CATEGORY |
static java.lang.String |
ELEMENT_TYPE |
Modifier and Type | Method and Description |
---|---|
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.
|
Source |
getSource()
Returns the Source being monitored.
|
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.
|
static final java.lang.String CATEGORY
static final java.lang.String ELEMENT_TYPE
java.util.List<ConfigurationListener> getListeners()
void modified()
boolean isModified()
long getLastModified()
void watching(Source source)
source
- the Source that is being watched.Source getSource()
Watcher newWatcher(Reconfigurable reconfigurable, java.util.List<ConfigurationListener> listeners, long lastModifiedMillis)
reconfigurable
- The Reconfigurable.listeners
- the listeners.lastModifiedMillis
- The time the resource was last modified in milliseconds.