Examples of InterProcessMutex


Examples of org.apache.curator.framework.recipes.locks.InterProcessMutex

        this.client = client;
        this.listener = new WrappedListener(this, listener);
        hasLeadership = false;

        this.executorService = executorService;
        mutex = new InterProcessMutex(client, leaderPath)
        {
            @Override
            protected byte[] getLockNodeBytes()
            {
                return (id.length() > 0) ? getIdBytes(id) : null;
View Full Code Here

Examples of org.apache.curator.framework.recipes.locks.InterProcessMutex

    }

    @Override
    public Object lockRoot(int id) {
        try {
            final InterProcessMutex mutex = new InterProcessMutex(client, ROOT_LOCKS + '/' + id);
            mutex.acquire();
            return mutex;
        } catch (Exception ex) {
            throw Throwables.propagate(ex);
        }
    }
View Full Code Here

Examples of org.apache.curator.framework.recipes.locks.InterProcessMutex

    }

    @Override
    public void unlockRoot(Object lock) {
        try {
            final InterProcessMutex mutex = (InterProcessMutex) lock;
            mutex.release();
        } catch (Exception ex) {
            throw Throwables.propagate(ex);
        }
    }
View Full Code Here

Examples of org.apache.curator.framework.recipes.locks.InterProcessMutex

        synchronized (locks) {
            assertValid();
            if (locks.containsKey(path)) {
                return locks.get(path);
            } else {
                locks.put(path, new InterProcessMutex(curator.get(), path));
                return locks.get(path);
            }
        }
    }
View Full Code Here

Examples of org.apache.curator.framework.recipes.locks.InterProcessMutex

    }

    @Override
    public PseudoLock newPseudoLock() throws Exception
    {
        InterProcessMutex   lock = new InterProcessMutex(client, lockPath);
        return new ZookeeperPseudoLock(lock);
    }
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.