private void reset() throws Exception { if ( (state.get() == State.STARTED) && isConnected.get() ) { client.checkExists().usingWatcher(watcher).inBackground(backgroundCallback).forPath(path); } }
/** * Register Data call back for the path * * @param path */ @SuppressWarnings("restriction") public void registerDataCallBack(String path) { try { transport.getZKHandle().getData().usingWatcher(watcher).inBackground((BackgroundCallback) watcher) .forPath(path); } catch (Exception e) { LOGGER.error( "Exception in setting data call back for path :" + path , e); } }
/** * Register callback notifications when child node added/deleted for a znode * * @param path */ @SuppressWarnings("restriction") public void registerChildrenCallback(String path) { try { transport.getZKHandle().getChildren().usingWatcher(watcher).inBackground((BackgroundCallback)watcher).forPath(path); } catch (Exception e) { LOGGER.error( "Exception while registering childrencallback for " + path, e); } }
void refresh(final RefreshMode mode) throws Exception { ensurePath.ensure(client.getZookeeperClient()); final BackgroundCallback callback = new BackgroundCallback() { @Override public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { processChildren(event.getChildren(), mode); } }; client.getChildren().usingWatcher(childrenWatcher).inBackground(callback).forPath(path); }
client.getData().decompressed().usingWatcher(dataWatcher).inBackground(getDataCallback).forPath(fullPath); client.getData().usingWatcher(dataWatcher).inBackground(getDataCallback).forPath(fullPath); client.checkExists().usingWatcher(dataWatcher).inBackground(existsCallback).forPath(fullPath);
private synchronized void sync(boolean watched) throws Exception { if ( watched ) { client.getChildren().usingWatcher(watcher).inBackground(callback).forPath(path); } else { client.getChildren().inBackground(callback).forPath(path); } }
client.checkExists().usingWatcher(watcher).inBackground(callback).forPath(ZKPaths.makePath(latchPath, watchPath));
client.getData().decompressed().usingWatcher(watcher).inBackground(backgroundCallback).forPath(path); client.getData().usingWatcher(watcher).inBackground(backgroundCallback).forPath(path);