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

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


    private synchronized LeaderLatch startLeaderLatch() throws InterruptedException {
        LeaderLatch latch = _latch; // Read the volatile once
        // Assert not started already.  initLeaderLatch() and closeLeaderLatch() leave the latch in the latent state.
        checkState(latch.getState() == LeaderLatch.State.LATENT);
        try {
            latch.start();
        } catch (InterruptedException ie) {
            throw ie;
        } catch (Throwable t) {
            LOG.error("Exception attempting to acquire leadership: {}", getId(), t);
        }
View Full Code Here


        try
        {
            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);

            final LeaderLatch leaderLatch = new LeaderLatch(entry.getClient(), path, participantId);
            leaderLatch.start();

            Closer closer = new Closer()
            {
                @Override
                public void close()
View Full Code Here

    private synchronized LeaderLatch startLeaderLatch() throws InterruptedException {
        LeaderLatch latch = _latch; // Read the volatile once
        // Assert not started already.  initLeaderLatch() and closeLeaderLatch() leave the latch in the latent state.
        checkState(latch.getState() == LeaderLatch.State.LATENT);
        try {
            latch.start();
        } catch (InterruptedException ie) {
            throw ie;
        } catch (Throwable t) {
            LOG.error("Exception attempting to acquire leadership: {}", getId(), t);
        }
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.