Class PersistentWatcher
java.lang.Object
org.apache.curator.framework.recipes.watch.PersistentWatcher
- All Implemented Interfaces:
Closeable,AutoCloseable
A managed persistent watcher. The watch will be managed such that it stays set through
connection lapses, etc.
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentWatcher(CuratorFramework client, String basePath, boolean recursive) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Remove the watcherListenable<org.apache.zookeeper.Watcher> Container for setting listenersListeners are called when the persistent watcher has been successfully registered or re-registered after a connection disruptionvoidstart()Start watching
-
Constructor Details
-
PersistentWatcher
- Parameters:
client- clientbasePath- path to set the watch onrecursive- ZooKeeper persistent watches can optionally be recursive
-
-
Method Details
-
start
public void start()Start watching -
close
public void close()Remove the watcher- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getListenable
Container for setting listeners- Returns:
- listener container
-
getResetListenable
Listeners are called when the persistent watcher has been successfully registered or re-registered after a connection disruption- Returns:
- listener container
-