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
  • Constructor Details

  • Method Details

    • 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 interface Watcher
      Specified by:
      getLastModified in class AbstractWatcher
      Returns:
      the time the source was last modified.
    • fileModified

      public void fileModified(File file)
      Description copied from interface: FileWatcher
      Called when a WatchManager detects that the given File changed.
      Specified by:
      fileModified in interface FileWatcher
      Parameters:
      file - the file that changed.
      See Also:
    • isModified

      public boolean isModified()
      Description copied from interface: Watcher
      Periodically called to determine if the configuration has been modified.
      Specified by:
      isModified in interface Watcher
      Specified by:
      isModified in class AbstractWatcher
      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 interface Watcher
      Overrides:
      getListeners in class AbstractWatcher
      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 interface Watcher
      Overrides:
      modified in class AbstractWatcher
    • watching

      public void watching(Source source)
      Description copied from interface: Watcher
      Called when the Watcher is registered.
      Specified by:
      watching in interface Watcher
      Overrides:
      watching in class AbstractWatcher
      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 interface Watcher
      Parameters:
      reconfigurable - The Reconfigurable.
      listeners - the listeners.
      lastModifiedMillis - The time the resource was last modified in milliseconds.
      Returns:
      A new Watcher.