Class WrappedFileWatcher
- java.lang.Object
-
- org.apache.logging.log4j.core.util.AbstractWatcher
-
- org.apache.logging.log4j.core.util.WrappedFileWatcher
-
- All Implemented Interfaces:
FileWatcher
,Watcher
public class WrappedFileWatcher extends AbstractWatcher implements FileWatcher
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.util.AbstractWatcher
AbstractWatcher.ReconfigurationRunnable
-
-
Field Summary
-
Fields inherited from interface org.apache.logging.log4j.core.util.Watcher
CATEGORY, ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description WrappedFileWatcher(FileWatcher watcher)
WrappedFileWatcher(FileWatcher watcher, Configuration configuration, Reconfigurable reconfigurable, List<ConfigurationListener> configurationListeners, long lastModifiedMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fileModified(File file)
Called when aWatchManager
detects that the givenFile
changed.long
getLastModified()
Returns the time the source was last modified or 0 if it is not available.List<ConfigurationListener>
getListeners()
Returns the list of listeners for this configuration.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, 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.-
Methods inherited from class org.apache.logging.log4j.core.util.AbstractWatcher
getConfiguration, getSource
-
-
-
-
Constructor Detail
-
WrappedFileWatcher
public WrappedFileWatcher(FileWatcher watcher, Configuration configuration, Reconfigurable reconfigurable, List<ConfigurationListener> configurationListeners, long lastModifiedMillis)
-
WrappedFileWatcher
public WrappedFileWatcher(FileWatcher watcher)
-
-
Method Detail
-
getLastModified
public 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
- Specified by:
getLastModified
in classAbstractWatcher
- Returns:
- the time the source was last modified.
-
fileModified
public void fileModified(File file)
Description copied from interface:FileWatcher
Called when aWatchManager
detects that the givenFile
changed.- Specified by:
fileModified
in interfaceFileWatcher
- Parameters:
file
- the file that changed.- See Also:
WatchManager
-
isModified
public boolean isModified()
Description copied from interface:Watcher
Periodically called to determine if the configuration has been modified.- Specified by:
isModified
in interfaceWatcher
- Specified by:
isModified
in classAbstractWatcher
- Returns:
- true if the configuration was modified, false otherwise.
-
getListeners
public List<ConfigurationListener> getListeners()
Description copied from interface:Watcher
Returns the list of listeners for this configuration.- Specified by:
getListeners
in interfaceWatcher
- Overrides:
getListeners
in classAbstractWatcher
- Returns:
- The list of listeners.
-
modified
public void modified()
Description copied from interface:Watcher
Called when the configuration has been modified.- Specified by:
modified
in interfaceWatcher
- Overrides:
modified
in classAbstractWatcher
-
watching
public void watching(Source source)
Description copied from interface:Watcher
Called when the Watcher is registered.- Specified by:
watching
in interfaceWatcher
- Overrides:
watching
in classAbstractWatcher
- Parameters:
source
- the Source that is being watched.
-
newWatcher
public Watcher newWatcher(Reconfigurable reconfigurable, List<ConfigurationListener> listeners, long lastModifiedMillis)
Description copied from interface:Watcher
Creates a new Watcher by copying the original and using the new Reconfigurable and listeners.- Specified by:
newWatcher
in interfaceWatcher
- Parameters:
reconfigurable
- The Reconfigurable.listeners
- the listeners.lastModifiedMillis
- The time the resource was last modified in milliseconds.- Returns:
- A new Watcher.
-
-