コード例 #1
0
 public void run() {
   try {
     if (isRegistered()) {
       register();
     }
   } catch (IOException e) {
     Log.info("Failed to reRegister " + e.getMessage());
   }
 }
コード例 #2
0
 public void init() {
   if (zk != null) {
     try {
       zk.close();
     } catch (InterruptedException e) {
       logger.warn("can not interrupted ", e);
     }
   }
   zk = ZooKeeperFactory.newZooKeeper(watcher);
 }