/** * Get a node's data and set a watch. * * @param path * @param watcher * @param stat * @return * @throws InterruptedException * @throws KeeperException */ public Object getData(Object path, final Closure watcher, Stat stat) throws InterruptedException, KeeperException { return deserialize( zookeeper.getData( getPathAsString(path), new Watcher() { public void process(WatchedEvent event) { watcher.call(event); } }, stat)); }
/** * Get a specific version of the node's data. * * @param path * @param stat * @return * @throws InterruptedException * @throws KeeperException */ public Object getData(Object path, Stat stat) throws InterruptedException, KeeperException { return deserialize(zookeeper.getData(getPathAsString(path), false, stat)); }