Class AbstractWatcher

java.lang.Object
org.apache.logging.log4j.core.util.AbstractWatcher
All Implemented Interfaces:
Watcher
Direct Known Subclasses:
ConfigurationFileWatcher, HttpWatcher, WrappedFileWatcher

public abstract class AbstractWatcher extends Object implements Watcher
Watcher for configuration files. Causes a reconfiguration when a file changes.
  • Constructor Details

  • Method Details

    • getListeners

      public List<ConfigurationListener> getListeners()
      Description copied from interface: Watcher
      Returns the list of listeners for this configuration.
      Specified by:
      getListeners in interface Watcher
      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
    • getConfiguration

      public Configuration 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 interface Watcher
      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 interface Watcher
      Returns:
      true if the configuration was modified, false otherwise.
    • watching

      public void watching(Source source)
      Description copied from interface: Watcher
      Called when the Watcher is registered.
      Specified by:
      watching in interface Watcher
      Parameters:
      source - the Source that is being watched.
    • getSource

      public Source getSource()
      Description copied from interface: Watcher
      Returns the Source being monitored.
      Specified by:
      getSource in interface Watcher
      Returns:
      the Source.