@Override public void takeLeadership(CuratorFramework client) throws Exception { latch = new CountDownLatch(1); listener.isLeader(); // it will release the leadership if return; latch.await(); } });
@Override public void takeLeadership(CuratorFramework client) throws Exception { latch = new CountDownLatch(1); listener.isLeader(); // it will release the leadership if return; latch.await(); } });