Examples of LockStoreImpl


Examples of com.hazelcast.concurrent.lock.LockStoreImpl

        return LockDataSerializerHook.GET_REMAINING_LEASETIME;
    }

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

Examples of com.hazelcast.concurrent.lock.LockStoreImpl

    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

Examples of com.hazelcast.concurrent.lock.LockStoreImpl

        this.version = version;
    }

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        int lockVersion = lockStore.getVersion(key);
        if (version == lockVersion) {
            forceUnlock();
        } else {
            ILogger logger = getLogger();
            if (logger.isFinestEnabled()) {
View Full Code Here

Examples of com.hazelcast.concurrent.lock.LockStoreImpl

    }

    @Override
    public void beforeRun() throws Exception {
        if (!expired) {
            LockStoreImpl lockStore = getLockStore();
            lockStore.startAwaiting(key, conditionId, getCallerUuid(), threadId);
        }
    }
View Full Code Here

Examples of com.hazelcast.concurrent.lock.LockStoreImpl

        }
    }

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        if (!lockStore.lock(key, getCallerUuid(), threadId)) {
            throw new IllegalMonitorStateException(
                    "Current thread is not owner of the lock! -> " + lockStore.getOwnerInfo(key));
        }

        if (expired) {
            response = false;
        } else {
            lockStore.removeSignalKey(getWaitKey());
            lockStore.removeAwait(key, conditionId, getCallerUuid(), threadId);
            response = true;
        }
    }
View Full Code Here

Examples of com.hazelcast.concurrent.lock.LockStoreImpl

        return new ConditionKey(namespace.getObjectName(), key, conditionId);
    }

    @Override
    public boolean shouldWait() {
        LockStoreImpl lockStore = getLockStore();

        ConditionKey signalKey = lockStore.getSignalKey(key);
        if (signalKey == null) {
            return true;
        }

        boolean canAcquireLock = lockStore.canAcquireLock(key, getCallerUuid(), threadId);

        if (!canAcquireLock) {
            return true;
        }
View Full Code Here

Examples of com.hazelcast.concurrent.lock.LockStoreImpl

    }

    @Override
    public void onWaitExpire() {
        expired = true;
        LockStoreImpl lockStore = getLockStore();
        lockStore.removeSignalKey(getWaitKey());
        lockStore.removeAwait(key, conditionId, getCallerUuid(), threadId);

        boolean locked = lockStore.lock(key, getCallerUuid(), threadId);
        if (locked) {
            ResponseHandler responseHandler = getResponseHandler();
            // expired & acquired lock, send FALSE
            responseHandler.sendResponse(false);
        } else {
            // expired but could not acquire lock, no response atm
            lockStore.registerExpiredAwaitOp(this);
        }
    }
View Full Code Here

Examples of com.hazelcast.concurrent.lock.LockStoreImpl

        this.conditionId = conditionId;
    }

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

Examples of com.hazelcast.concurrent.lock.LockStoreImpl

        }
    }

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

Examples of com.hazelcast.concurrent.lock.LockStoreImpl

        this.originalCallerUuid = originalCallerUuid;
    }

    @Override
    public void run() throws Exception {
        LockStoreImpl lockStore = getLockStore();
        if (force) {
            response = lockStore.forceUnlock(key);
        } else {
            response = lockStore.unlock(key, originalCallerUuid, threadId);
        }
        lockStore.pollExpiredAwaitOp(key);
    }
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.