Class AbstractWatcher
java.lang.Object
org.apache.logging.log4j.core.util.AbstractWatcher
- All Implemented Interfaces:
Watcher
- Direct Known Subclasses:
ConfigurationFileWatcher
,HttpWatcher
,WrappedFileWatcher
Watcher for configuration files. Causes a reconfiguration when a file changes.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Helper class for triggering a reconfiguration in a background thread. -
Field Summary
Fields inherited from interface org.apache.logging.log4j.core.util.Watcher
CATEGORY, ELEMENT_TYPE
-
Constructor Summary
ConstructorDescriptionAbstractWatcher
(Configuration configuration, Reconfigurable reconfigurable, List<ConfigurationListener> configurationListeners) -
Method Summary
Modifier and TypeMethodDescriptionabstract long
Returns the time the source was last modified or 0 if it is not available.Returns the list of listeners for this configuration.Returns the Source being monitored.abstract boolean
Periodically called to determine if the configuration has been modified.void
modified()
Called when the configuration has been modified.void
Called when the Watcher is registered.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.logging.log4j.core.util.Watcher
newWatcher
-
Constructor Details
-
AbstractWatcher
public AbstractWatcher(Configuration configuration, Reconfigurable reconfigurable, List<ConfigurationListener> configurationListeners)
-
-
Method Details
-
getListeners
Description copied from interface:Watcher
Returns the list of listeners for this configuration.- Specified by:
getListeners
in interfaceWatcher
- Returns:
- The list of listeners.
-
modified
public void modified()Description copied from interface:Watcher
Called when the configuration has been modified. -
getConfiguration
-
getLastModified
public abstract long getLastModified()Description copied from interface:Watcher
Returns the time the source was last modified or 0 if it is not available.- Specified by:
getLastModified
in interfaceWatcher
- Returns:
- the time the source was last modified.
-
isModified
public abstract boolean isModified()Description copied from interface:Watcher
Periodically called to determine if the configuration has been modified.- Specified by:
isModified
in interfaceWatcher
- Returns:
- true if the configuration was modified, false otherwise.
-
watching
Description copied from interface:Watcher
Called when the Watcher is registered. -
getSource
Description copied from interface:Watcher
Returns the Source being monitored.
-