Package org.apache.curator.framework.recipes.leader

Examples of org.apache.curator.framework.recipes.leader.LeaderLatch.addListener()


  {
    final LeaderLatch newLeaderLatch = new LeaderLatch(
        curator, ZKPaths.makePath(zkPaths.getCoordinatorPath(), COORDINATOR_OWNER_NODE), self.getHost()
    );

    newLeaderLatch.addListener(
        new LeaderLatchListener()
        {
          @Override
          public void isLeader()
          {
View Full Code Here


  {
    final LeaderLatch newLeaderLatch = new LeaderLatch(
        curator, ZKPaths.makePath(config.getConnectorPath(), BRIDGE_OWNER_NODE), self.getHost()
    );

    newLeaderLatch.addListener(
        new LeaderLatchListener()
        {
          @Override
          public void isLeader()
          {
View Full Code Here

                public void notLeader()
                {
                    addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, false)));
                }
            };
            leaderLatch.addListener(listener);

            if ( waitForLeadershipMs > 0 )
            {
                leaderLatch.await(waitForLeadershipMs, TimeUnit.MILLISECONDS);
            }
View Full Code Here

            public void notLeader()
            {
                reapingIsActive.set(false);
            }
        };
        localLeaderLatch.addListener(listener);
        return localLeaderLatch;
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.