Package com.hazelcast.concurrent.lock

Examples of com.hazelcast.concurrent.lock.LockStoreImpl


            unlock();
        }
    }

    private void unlock() {
        LockStoreImpl lockStore = getLockStore();
        boolean unlocked = lockStore.unlock(key, getCallerUuid(), threadId);
        response = unlocked;
        ensureUnlocked(lockStore, unlocked);
    }
View Full Code Here


            throw new IllegalMonitorStateException("Current thread is not owner of the lock! -> " + ownerInfo);
        }
    }

    private void forceUnlock() {
        LockStoreImpl lockStore = getLockStore();
        response = lockStore.forceUnlock(key);
    }
View Full Code Here

        response = lockStore.forceUnlock(key);
    }

    @Override
    public void afterRun() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        AwaitOperation awaitResponse = lockStore.pollExpiredAwaitOp(key);
        if (awaitResponse != null) {
            OperationService operationService = getNodeEngine().getOperationService();
            operationService.runOperation(awaitResponse);
        }
        shouldNotify = awaitResponse == null;
View Full Code Here

        return shouldNotify;
    }

    @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

        this.all = all;
    }

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        awaitCount = lockStore.getAwaitCount(key, conditionId);
        int signalCount;
        if (awaitCount > 0) {
            if (all) {
                signalCount = awaitCount;
            } else {
                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

        this.originalCaller = originalCaller;
    }

    @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

        super(namespace, key, threadId);
    }

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        if (threadId == ANY_THREAD) {
            response = lockStore.isLocked(key);
        } else {
            response = lockStore.isLockedBy(key, getCallerUuid(), threadId);
        }
    }
View Full Code Here

        super(namespace, key, threadId, conditionId, all);
    }

    @Override
    public void beforeRun() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        boolean isLockOwner = lockStore.isLockedBy(key, getCallerUuid(), threadId);
        ensureLockOwner(lockStore, isLockOwner);
    }
View Full Code Here

        super(namespace, key, -1);
    }

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        response = lockStore.getRemainingLeaseTime(key);
    }
View Full Code Here

    protected void readInternal(final ObjectDataInput in) throws IOException {
        super.readInternal(in);
        int len = in.readInt();
        if (len > 0) {
            for (int i = 0; i < len; i++) {
                LockStoreImpl ls = new LockStoreImpl();
                ls.readData(in);
                locks.add(ls);
            }
        }
    }
View Full Code Here

TOP

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

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.