Search in sources :

Example 11 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class BeforeAwaitOperation method run.

@Override
public void run() throws Exception {
    LockStoreImpl lockStore = getLockStore();
    lockStore.addAwait(key, conditionId, getCallerUuid(), threadId);
    lockStore.unlock(key, getCallerUuid(), threadId, getReferenceCallId());
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl)

Example 12 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class GetLockCountOperation method run.

@Override
public void run() throws Exception {
    LockStoreImpl lockStore = getLockStore();
    response = lockStore.getLockCount(key);
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl)

Example 13 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class AwaitBackupOperation method run.

@Override
public void run() throws Exception {
    LockStoreImpl lockStore = getLockStore();
    lockStore.lock(key, originalCaller, threadId, getReferenceCallId(), leaseTime);
    ConditionKey conditionKey = new ConditionKey(namespace.getObjectName(), key, conditionId, originalCaller, threadId);
    lockStore.removeSignalKey(conditionKey);
    lockStore.removeAwait(key, conditionId, originalCaller, threadId);
    response = true;
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl) ConditionKey(com.hazelcast.concurrent.lock.ConditionKey)

Example 14 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class AwaitOperation method runExpired.

void runExpired() {
    LockStoreImpl lockStore = getLockStore();
    boolean locked = lockStore.lock(key, getCallerUuid(), threadId, getReferenceCallId(), leaseTime);
    assert locked : "Expired await operation should have acquired the lock!";
    sendResponse(false);
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl)

Example 15 with LockStoreImpl

use of com.hazelcast.concurrent.lock.LockStoreImpl in project hazelcast by hazelcast.

the class BaseSignalOperation method run.

@Override
public void run() throws Exception {
    response = true;
    LockStoreImpl lockStore = getLockStore();
    int signalCount = all ? Integer.MAX_VALUE : 1;
    lockStore.signal(key, conditionId, signalCount, namespace.getObjectName());
}
Also used : LockStoreImpl(com.hazelcast.concurrent.lock.LockStoreImpl)

Aggregations

LockStoreImpl (com.hazelcast.concurrent.lock.LockStoreImpl)23 LockServiceImpl (com.hazelcast.concurrent.lock.LockServiceImpl)2 LockStoreContainer (com.hazelcast.concurrent.lock.LockStoreContainer)2 ILogger (com.hazelcast.logging.ILogger)2 ConditionKey (com.hazelcast.concurrent.lock.ConditionKey)1 LockResource (com.hazelcast.concurrent.lock.LockResource)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 MultiMap (com.hazelcast.core.MultiMap)1 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)1 ParallelTest (com.hazelcast.test.annotation.ParallelTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1