Package org.apache.zookeeper
Class ZooKeeper.WatchRegistration
java.lang.Object
org.apache.zookeeper.ZooKeeper.WatchRegistration
- Enclosing class:
ZooKeeper
Register a watcher for a particular path.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetWatches
(int rc) void
register
(int rc) Register the watcher with the set of watches on path.protected boolean
shouldAddWatch
(int rc) Determine whether the watch should be added based on return code.
-
Constructor Details
-
WatchRegistration
-
-
Method Details
-
getWatches
-
register
public void register(int rc) Register the watcher with the set of watches on path.- Parameters:
rc
- the result code of the operation that attempted to add the watch on the path.
-
shouldAddWatch
protected boolean shouldAddWatch(int rc) Determine whether the watch should be added based on return code.- Parameters:
rc
- the result code of the operation that attempted to add the watch on the node- Returns:
- true if the watch should be added, otw false
-