Package com.hazelcast.concurrent.lock

Examples of com.hazelcast.concurrent.lock.ConditionKey


    }

    @Override
    public final WaitNotifyKey getNotifiedKey() {
        LockStoreImpl lockStore = getLockStore();
        ConditionKey conditionKey = lockStore.getSignalKey(key);
        if (conditionKey == null) {
            return new LockWaitNotifyKey(namespace, key);
        } else {
            return conditionKey;
        }
View Full Code Here


                signalCount = 1;
            }
        } else {
            signalCount = 0;
        }
        ConditionKey notifiedKey = new ConditionKey(namespace.getObjectName(), key, conditionId);
        for (int i = 0; i < signalCount; i++) {
            lockStore.registerSignalKey(notifiedKey);
        }
        response = true;
    }
View Full Code Here

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        lockStore.lock(key, originalCaller, threadId);
        ConditionKey conditionKey = new ConditionKey(namespace.getObjectName(), key, conditionId);
        lockStore.removeSignalKey(conditionKey);
        lockStore.removeAwait(key, conditionId, originalCaller, threadId);
        response = true;
    }
View Full Code Here

        }
    }

    @Override
    public ConditionKey getWaitKey() {
        return new ConditionKey(namespace.getObjectName(), key, conditionId);
    }
View Full Code Here

    @Override
    public boolean shouldWait() {
        LockStoreImpl lockStore = getLockStore();
        boolean canAcquireLock = lockStore.canAcquireLock(key, getCallerUuid(), threadId);

        ConditionKey signalKey = lockStore.getSignalKey(key);
        if (signalKey != null && conditionId.equals(signalKey.getConditionId()) && canAcquireLock) {
            return false;
        }

        boolean shouldWait = firstRun || !canAcquireLock;
        firstRun = false;
View Full Code Here

        }
    }

    @Override
    public ConditionKey getWaitKey() {
        return new ConditionKey(namespace.getObjectName(), key, conditionId);
    }
View Full Code Here

    @Override
    public boolean shouldWait() {
        LockStoreImpl lockStore = getLockStore();
        boolean canAcquireLock = lockStore.canAcquireLock(key, getCallerUuid(), threadId);

        ConditionKey signalKey = lockStore.getSignalKey(key);
        if (signalKey != null && conditionId.equals(signalKey.getConditionId()) && canAcquireLock) {
            return false;
        }

        boolean shouldWait = firstRun || !canAcquireLock;
        firstRun = false;
View Full Code Here

    }

    @Override
    public final WaitNotifyKey getNotifiedKey() {
        LockStoreImpl lockStore = getLockStore();
        ConditionKey conditionKey = lockStore.getSignalKey(key);
        if (conditionKey == null) {
            return new LockWaitNotifyKey(namespace, key);
        } else {
            return conditionKey;
        }
View Full Code Here

    }

    @Override
    public final WaitNotifyKey getNotifiedKey() {
        LockStoreImpl lockStore = getLockStore();
        ConditionKey conditionKey = lockStore.getSignalKey(key);
        if (conditionKey == null) {
            return new LockWaitNotifyKey(namespace, key);
        } else {
            return conditionKey;
        }
View Full Code Here

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        lockStore.lock(key, originalCaller, threadId);
        ConditionKey conditionKey = new ConditionKey(namespace.getObjectName(), key, conditionId);
        lockStore.removeSignalKey(conditionKey);
        lockStore.removeAwait(key, conditionId, originalCaller, threadId);
        response = true;
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.concurrent.lock.ConditionKey

Copyright © 2018 www.massapicom. 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.