class PendingWatcher extends Object implements org.apache.zookeeper.Watcher
ZooKeeper starts its event thread within its constructor (and that is an anti-pattern),
and the watcher passed to the constructor might be called back by the event thread before you get
the instance of
ZooKeeper from the constructor. If your watcher calls methods of
ZooKeeper, pass this placeholder to the constructor of the
ZooKeeper, create your
watcher using the instance of
ZooKeeper, and then call the method
|Modifier and Type||Field and Description|
|Constructor and Description|
|Modifier and Type||Method and Description|
Associates the substantial watcher of processing events.
public void process(org.apache.zookeeper.WatchedEvent event)
void prepare(org.apache.zookeeper.Watcher watcher)
watchershould be non-null. This method is expected to call as soon as possible because the event processing, being invoked by the ZooKeeper event thread, is uninterruptibly blocked until this method is called.
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.