@Test public void testListener() throws Exception { String path = "/test/listener"; final AtomicInteger at = new AtomicInteger(-1); final Watcher watcher = new Watcher() { @Override public void process(WatchedEvent event) { Event.EventType t = event.getType(); at.set(t.getIntValue()); String p = event.getPath(); List<String> s = getChildren(client, p, this); getData(client, p, this); exists(client, p, this); LOG.info("value={}, {}, {}, children:{}", t.getIntValue(), t, p, s); } }; exists(client, path, watcher); LOG.info("create {}", path); ensure(client, path); busyWait(); getChildren(client, path, watcher); assertThat(at.get(), is(NodeCreated.getIntValue())); LOG.info("setData {}", path); setData(client, path, newBytes("a=5")); busyWait(); assertThat(at.get(), is(NodeDataChanged.getIntValue())); String child = ZKPaths.makePath(path, "child"); LOG.info("create {}", child); create(client, child, newBytes("b=1")); busyWait(); assertThat(at.get(), is(NodeChildrenChanged.getIntValue())); LOG.info("setData {}", child); setData(client, child, newBytes("b=2")); busyWait(); LOG.info("delete {}", child); delete(client, child); busyWait(); assertThat(at.get(), is(NodeChildrenChanged.getIntValue())); LOG.info("delete {}", path); delete(client, path); busyWait(); assertThat(at.get(), is(NodeDeleted.getIntValue())); create(client, path); busyWait(); assertThat(at.get(), is(NodeCreated.getIntValue())); }
public String getPath() { return path; }
RemoteConfig extends ChangeableConfig { public String getPath() { return path; } }
RemoteConfig extends ChangeableConfig { public String getPath() { return path; } RemoteConfig(String name, String path, List<String> paths, CuratorFramework client); }
RemoteConfig extends ChangeableConfig { public String getPath() { return path; } RemoteConfig(String name, String path, List<String> paths, CuratorFramework client); void start(); String getPath(); CuratorFramework getClient(); @Override String toString(); }
RemoteConfig extends ChangeableConfig { public String getPath() { return path; } RemoteConfig(String name, String path, List<String> paths, CuratorFramework client); void start(); String getPath(); CuratorFramework getClient(); @Override String toString();  }