Package com.qfs.msg

Interface IWatcherService

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
WatcherService

public interface IWatcherService extends Closeable
Watcher service to subscribe to the events of a path.
Author:
ActiveViam
  • Method Details

    • register

      WatchKey register(IWatcher watcher, Path path)
      Register a watcher of a path. When events related to this path are detected by the service, the watcher will be called back.
      Parameters:
      watcher - The watcher to register.
      path - The path to watch.
      Returns:
      the watchKey
    • unregister

      void unregister(IWatcher watcher)
      Unregisters the given watcher.
      Parameters:
      watcher - The watcher to unregister from this watcher service.
    • registerAll

      void registerAll(IWatcher watcher, Path path)
      Register recursively all the directories.
      Parameters:
      watcher - the watcher
      path - the directory that may contain other subdirectories
    • pauseWatcher

      void pauseWatcher(IWatcher watcher)
      Pauses the processing of events for a given watcher.
      Parameters:
      watcher - The watcher for which to stop processing events.
    • resumeWatcher

      void resumeWatcher(IWatcher watcher)
      Resumes the processing of events for a given watcher.
      Parameters:
      watcher - The watcher for which to resume processing events.
    • isWatcherPaused

      boolean isWatcherPaused(IWatcher watcher)
      Says if the processing of events for a given watcher is paused.
      Parameters:
      watcher - The watcher of which to check the status.
      Returns:
      true if the processing of events of the given watcher is paused, false otherwise.