public abstract class AbstractWatcher extends java.lang.Object implements Watcher
Modifier and Type | Class and Description |
---|---|
static class |
AbstractWatcher.ReconfigurationRunnable
Helper class for triggering a reconfiguration in a background thread.
|
Modifier and Type | Field and Description |
---|---|
private Configuration |
configuration |
private java.util.List<ConfigurationListener> |
configurationListeners |
private Reconfigurable |
reconfigurable |
private Source |
source |
private Log4jThreadFactory |
threadFactory |
CATEGORY, ELEMENT_TYPE
Constructor and Description |
---|
AbstractWatcher(Configuration configuration,
Reconfigurable reconfigurable,
java.util.List<ConfigurationListener> configurationListeners) |
Modifier and Type | Method and Description |
---|---|
Configuration |
getConfiguration() |
abstract 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.
|
abstract boolean |
isModified()
Periodically called to determine if the configuration has been modified.
|
void |
modified()
Called when the configuration has been modified.
|
void |
watching(Source source)
Called when the Watcher is registered.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newWatcher
private final Reconfigurable reconfigurable
private final java.util.List<ConfigurationListener> configurationListeners
private final Log4jThreadFactory threadFactory
private final Configuration configuration
private Source source
public AbstractWatcher(Configuration configuration, Reconfigurable reconfigurable, java.util.List<ConfigurationListener> configurationListeners)
public java.util.List<ConfigurationListener> getListeners()
Watcher
getListeners
in interface Watcher
public void modified()
Watcher
public Configuration getConfiguration()
public abstract long getLastModified()
Watcher
getLastModified
in interface Watcher
public abstract boolean isModified()
Watcher
isModified
in interface Watcher
public void watching(Source source)
Watcher