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
Nested ClassesModifier and TypeClassDescriptionstatic classHelper 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
ConstructorsConstructorDescriptionAbstractWatcher(Configuration configuration, Reconfigurable reconfigurable, List<ConfigurationListener> configurationListeners) -
Method Summary
Modifier and TypeMethodDescriptionabstract longReturns 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 booleanPeriodically called to determine if the configuration has been modified.voidmodified()Called when the configuration has been modified.voidCalled when the Watcher is registered.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:WatcherReturns the list of listeners for this configuration.- Specified by:
getListenersin interfaceWatcher- Returns:
- The list of listeners.
-
modified
public void modified()Description copied from interface:WatcherCalled when the configuration has been modified. -
getConfiguration
-
getLastModified
public abstract long getLastModified()Description copied from interface:WatcherReturns the time the source was last modified or 0 if it is not available.- Specified by:
getLastModifiedin interfaceWatcher- Returns:
- the time the source was last modified.
-
isModified
public abstract boolean isModified()Description copied from interface:WatcherPeriodically called to determine if the configuration has been modified.- Specified by:
isModifiedin interfaceWatcher- Returns:
- true if the configuration was modified, false otherwise.
-
watching
Description copied from interface:WatcherCalled when the Watcher is registered. -
getSource
Description copied from interface:WatcherReturns the Source being monitored.
-