@Override protected void doStop() throws Exception { if (managedClient) { client.close(); } super.doStop(); }
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); } }
@Override protected void doStop() throws Exception { if (client != null) { client.close(); } super.doStop(); }