Exemplo n.º 1
0
  public void displayConfig() {
    try {
      String value = store.read(ConfigUpdater.CONFIG, this);

      System.out.printf("取出值 %s from %s\n", ConfigUpdater.CONFIG, value);
    } catch (KeeperException e) {
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
Exemplo n.º 2
0
 public ConfigWatcher(String host) throws IOException, InterruptedException {
   store = new ActiveKeyValueStore();
   store.connect(host);
 }