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
ConstructorDescriptionPersistentWatcher
(CuratorFramework client, String basePath, boolean recursive) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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 disruptionvoid
start()
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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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
-