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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisWatcherPaused(IWatcher watcher)Says if the processing of events for a given watcher is paused.voidpauseWatcher(IWatcher watcher)Pauses the processing of events for a given watcher.WatchKeyregister(IWatcher watcher, Path path)Register a watcher of a path.voidregisterAll(IWatcher watcher, Path path)Register recursively all the directories.voidresumeWatcher(IWatcher watcher)Resumes the processing of events for a given watcher.voidunregister(IWatcher watcher)Unregisters the given watcher.
-
-
-
Method Detail
-
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 watcherpath- 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:
trueif the processing of events of the given watcher is paused,falseotherwise.
-
-