Note: PersistentWatcher requires ZooKeeper 3.6+.
A managed persistent persistent watcher. The watch will be managed such that it stays set through connection lapses, etc.
public PersistentWatcher(CuratorFramework client, String basePath, boolean recursive) Parameters: client - the client basePath - path to set the watch on recursive - ZooKeeper persistent watches can optionally be recursive
The instance must be started by calling start(). Call close() when you want to remove the watch.
PersistentWatcher presents two listener types:
PersistentWatcher instances internally monitor connection losses, etc. automatically resetting on reconnection.