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(org.apache.curator.framework.CuratorFramework client, String basePath, boolean recursive) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Remove the watcherorg.apache.curator.framework.listen.Listenable<org.apache.zookeeper.Watcher> Container for setting listenersorg.apache.curator.framework.listen.Listenable<Runnable> Listeners are called when the persistent watcher has been successfully registered or re-registered after a connection disruptionvoidstart()Start watching
-
Constructor Details
-
PersistentWatcher
public PersistentWatcher(org.apache.curator.framework.CuratorFramework client, String basePath, boolean recursive) - 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
public org.apache.curator.framework.listen.Listenable<org.apache.zookeeper.Watcher> 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
-