Class AbstractWatcher
java.lang.Object
org.apache.logging.log4j.core.util.AbstractWatcher
- All Implemented Interfaces:
Watcher
- Direct Known Subclasses:
ConfigurationFileWatcher, HttpWatcher, WrappedFileWatcher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelper class for triggering a reconfiguration in a background thread. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Configurationprivate final List<ConfigurationListener> private final Reconfigurableprivate Sourceprivate final Log4jThreadFactoryFields inherited from interface 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Watcher
newWatcher
-
Field Details
-
reconfigurable
-
configurationListeners
-
threadFactory
-
configuration
-
source
-
-
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
-
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
-
getSource
-