Package com.hazelcast.concurrent.lock

Examples of com.hazelcast.concurrent.lock.LockStoreImpl


        this.originalCaller = originalCaller;
    }

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        lockStore.addAwait(key, conditionId, originalCaller, threadId);
        lockStore.unlock(key, originalCaller, threadId);
        response = true;
    }
View Full Code Here


            return getLockStore().getBackupCount();
        }
    }

    public final int getAsyncBackupCount() {
        LockStoreImpl lockStore = getLockStore();
        if (asyncBackup) {
            return lockStore.getBackupCount() + lockStore.getAsyncBackupCount();
        } else {
            return lockStore.getAsyncBackupCount();
        }
    }
View Full Code Here

        this.originalCallerUuid = originalCallerUuid;
    }

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        response = lockStore.lock(key, originalCallerUuid, threadId, ttl);
    }
View Full Code Here

            unlock();
        }
    }

    protected final 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);
        }
    }

    protected final 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.runOperationOnCallingThread(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.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

        return LockDataSerializerHook.IS_LOCKED;
    }

    @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

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.