我想使用ZooKeeper
public class ResourceMonitor implements Watcher {
String name = "/zk_test3";
ZooKeeper zk;
public ResourceMonitor() throws IOException {
zk = new ZooKeeper("localhost:8000", 3000, this);
}
public void waitAndGet() {
}
public void release() {
//remove children
}
public void process(WatchedEvent event) {
System.out.println("ResourceMonitor:" + event.toString());
}
}
我是ZooKeeper的新手,并没有在ZooKeeper收据中找到这样的例子。