コード例 #1
0
  @Override
  protected void doStop() throws Exception {
    if (managedClient) {
      client.close();
    }

    super.doStop();
  }
コード例 #2
0
  private void watch() throws Exception {
    if (isRunAllowed()) {
      if (leader.get()) {
        setIndex(client.refresh(servicePath, ttl).send().get());
      }

      LOGGER.debug(
          "Watch (path={}, isLeader={}, index={})", servicePath, leader.get(), index.get());

      client
          .get(servicePath)
          .waitForChange(index.get())
          .timeout(ttl / 3, TimeUnit.SECONDS)
          .send()
          .addListener(this);
    }
  }
コード例 #3
0
  @Override
  protected void doStop() throws Exception {
    if (client != null) {
      client.close();
    }

    super.doStop();
  }