@Override public void stateChanged(CuratorFramework curatorFramework, ConnectionState connectionState) { if (curatorFramework.getConnectionStateErrorPolicy().isErrorState(connectionState)) { reset(); throw new CancelLeadershipException(); } }
@Override public void stateChanged(CuratorFramework client, ConnectionState newState) { if (newState == ConnectionState.SUSPENDED || newState == ConnectionState.LOST) { this.isLeader = false; leaderExecutor.shutdownNow(); throw new CancelLeadershipException(); } }
@Override public void stateChanged(CuratorFramework framework, ConnectionState newState) { if (newState == ConnectionState.SUSPENDED || newState == ConnectionState.LOST) { this.isLeader = false; leaderExecutor.shutdownNow(); throw new CancelLeadershipException(); } }