Package com.hazelcast.core

Examples of com.hazelcast.core.ILock.newCondition()


    public void test() {
        HazelcastInstance[] instances = createHazelcastInstanceFactory(INSTANCE_COUNT).newInstances();
        HazelcastInstance hz = instances[0];
        //Hazelcast.newHazelcastInstance();
        ILock lock = hz.getLock(randomString());
        ICondition condition = lock.newCondition(randomString());

        ConsumerThread[] consumers = new ConsumerThread[CONSUMER_COUNT];
        for (int k = 0; k < consumers.length; k++) {
            ConsumerThread thread = new ConsumerThread(1, lock, condition);
            thread.start();
View Full Code Here


    public void testNewConditionWithoutNameIsNotSupported() {
        HazelcastInstance instance = createHazelcastInstance();

        ILock lock = instance.getLock(randomString());

        lock.newCondition();
    }

    @Test(timeout = 60000, expected = NullPointerException.class)
    public void testNewCondition_whenNullName() {
        HazelcastInstance instance = createHazelcastInstance();
View Full Code Here

    public void testNewCondition_whenNullName() {
        HazelcastInstance instance = createHazelcastInstance();

        ILock lock = instance.getLock(randomString());

        lock.newCondition(null);
    }

    @Test(timeout = 60000)
    public void testMultipleConditionsForSameLock() throws InterruptedException {
        HazelcastInstance instance = createHazelcastInstance();
View Full Code Here

    @Test(timeout = 60000)
    public void testMultipleConditionsForSameLock() throws InterruptedException {
        HazelcastInstance instance = createHazelcastInstance();

        final ILock lock = instance.getLock(randomString());
        final ICondition condition0 = lock.newCondition(randomString());
        final ICondition condition1 = lock.newCondition(randomString());

        final CountDownLatch latch = new CountDownLatch(2);
        final CountDownLatch syncLatch = new CountDownLatch(2);
View Full Code Here

    public void testMultipleConditionsForSameLock() throws InterruptedException {
        HazelcastInstance instance = createHazelcastInstance();

        final ILock lock = instance.getLock(randomString());
        final ICondition condition0 = lock.newCondition(randomString());
        final ICondition condition1 = lock.newCondition(randomString());

        final CountDownLatch latch = new CountDownLatch(2);
        final CountDownLatch syncLatch = new CountDownLatch(2);

        createThreadWaitsForCondition(latch, lock, condition0, syncLatch).start();
View Full Code Here

    @Test(timeout = 60000)
    public void testSignalAll() throws InterruptedException {
        HazelcastInstance instance = createHazelcastInstance();

        final ILock lock = instance.getLock(randomString());
        final ICondition condition = lock.newCondition(randomString());

        final CountDownLatch latch = new CountDownLatch(2);
        final CountDownLatch syncLatch = new CountDownLatch(2);

        createThreadWaitsForCondition(latch, lock, condition, syncLatch).start();
View Full Code Here

    @Test(timeout = 60000)
    public void testSignalAll_whenMultipleConditions() throws InterruptedException {
        HazelcastInstance instance = createHazelcastInstance();

        final ILock lock = instance.getLock(randomString());
        final ICondition condition0 = lock.newCondition(randomString());
        final ICondition condition1 = lock.newCondition(randomString());

        final CountDownLatch latch = new CountDownLatch(10);
        final CountDownLatch syncLatch = new CountDownLatch(2);
View Full Code Here

    public void testSignalAll_whenMultipleConditions() throws InterruptedException {
        HazelcastInstance instance = createHazelcastInstance();

        final ILock lock = instance.getLock(randomString());
        final ICondition condition0 = lock.newCondition(randomString());
        final ICondition condition1 = lock.newCondition(randomString());

        final CountDownLatch latch = new CountDownLatch(10);
        final CountDownLatch syncLatch = new CountDownLatch(2);

        createThreadWaitsForCondition(latch, lock, condition0, syncLatch).start();
View Full Code Here

    public void testSameConditionRetrievedMultipleTimesForSameLock() throws InterruptedException {
        HazelcastInstance instance = createHazelcastInstance();

        final ILock lock = instance.getLock(randomString());
        String name = randomString();
        final ICondition condition0 = lock.newCondition(name);
        final ICondition condition1 = lock.newCondition(name);

        final CountDownLatch latch = new CountDownLatch(2);
        final CountDownLatch syncLatch = new CountDownLatch(2);
View Full Code Here

        HazelcastInstance instance = createHazelcastInstance();

        final ILock lock = instance.getLock(randomString());
        String name = randomString();
        final ICondition condition0 = lock.newCondition(name);
        final ICondition condition1 = lock.newCondition(name);

        final CountDownLatch latch = new CountDownLatch(2);
        final CountDownLatch syncLatch = new CountDownLatch(2);

        createThreadWaitsForCondition(latch, lock, condition0, syncLatch).start();
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.