Java 类org.apache.curator.framework.recipes.leader.CancelLeadershipException 实例源码

项目:snowflake    文件:SnowflakeServer.java   
@Override
public void stateChanged(CuratorFramework curatorFramework, ConnectionState connectionState) {
    if (curatorFramework.getConnectionStateErrorPolicy().isErrorState(connectionState)) {
        reset();
        throw new CancelLeadershipException();
    }
}
项目:mycat-src-1.6.1-RELEASE    文件:DistributedSequenceHandler.java   
@Override
public void stateChanged(CuratorFramework client, ConnectionState newState) {
    if (newState == ConnectionState.SUSPENDED || newState == ConnectionState.LOST) {
        this.isLeader = false;
        leaderExecutor.shutdownNow();
        throw new CancelLeadershipException();
    }
}
项目:dble    文件:DistributedSequenceHandler.java   
@Override
public void stateChanged(CuratorFramework framework, ConnectionState newState) {
    if (newState == ConnectionState.SUSPENDED || newState == ConnectionState.LOST) {
        this.isLeader = false;
        leaderExecutor.shutdownNow();
        throw new CancelLeadershipException();
    }
}