Class PersistentWatcher

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class PersistentWatcher
    extends Object
    implements Closeable
    A managed persistent watcher. The watch will be managed such that it stays set through connection lapses, etc.
    • Constructor Detail

      • PersistentWatcher

        public PersistentWatcher​(CuratorFramework client,
                                 String basePath,
                                 boolean recursive)
        Parameters:
        client - client
        basePath - path to set the watch on
        recursive - ZooKeeper persistent watches can optionally be recursive
    • Method Detail

      • start

        public void start()
        Start watching
      • getListenable

        public Listenable<org.apache.zookeeper.Watcher> getListenable()
        Container for setting listeners
        Returns:
        listener container
      • getResetListenable

        public Listenable<Runnable> getResetListenable()
        Listeners are called when the persistent watcher has been successfully registered or re-registered after a connection disruption
        Returns:
        listener container