Interface Watcher

All Known Implementing Classes:
AbstractWatcher, ConfigurationFileWatcher, HttpWatcher, WrappedFileWatcher

public interface Watcher
Watches for changes in a Source and performs an action when it is modified.
See Also:
  • Field Details

  • Method Details

    • getListeners

      List<ConfigurationListener> getListeners()
      Returns the list of listeners for this configuration.
      The list of listeners.
    • modified

      void modified()
      Called when the configuration has been modified.
    • isModified

      boolean isModified()
      Periodically called to determine if the configuration has been modified.
      true if the configuration was modified, false otherwise.
    • getLastModified

      long getLastModified()
      Returns the time the source was last modified or 0 if it is not available.
      the time the source was last modified.
    • watching

      void watching(Source source)
      Called when the Watcher is registered.
      source - the Source that is being watched.
    • getSource

      Source getSource()
      Returns the Source being monitored.
      the Source.
    • newWatcher

      Watcher newWatcher(Reconfigurable reconfigurable, List<ConfigurationListener> listeners, long lastModifiedMillis)
      Creates a new Watcher by copying the original and using the new Reconfigurable and listeners.
      reconfigurable - The Reconfigurable.
      listeners - the listeners.
      lastModifiedMillis - The time the resource was last modified in milliseconds.
      A new Watcher.