Search in sources :

Example 1 with SignalOperation

use of com.hazelcast.concurrent.lock.operations.SignalOperation in project hazelcast by hazelcast.

the class ConditionSignalMessageTask method prepareOperation.

@Override
protected Operation prepareOperation() {
    final Data key = serializationService.toData(parameters.lockName);
    final InternalLockNamespace namespace = new InternalLockNamespace(parameters.lockName);
    return new SignalOperation(namespace, key, parameters.threadId, parameters.name, false);
}
Also used : InternalLockNamespace(com.hazelcast.concurrent.lock.InternalLockNamespace) SignalOperation(com.hazelcast.concurrent.lock.operations.SignalOperation) Data(com.hazelcast.nio.serialization.Data)

Example 2 with SignalOperation

use of com.hazelcast.concurrent.lock.operations.SignalOperation in project hazelcast by hazelcast.

the class ConditionSignalAllMessageTask method prepareOperation.

@Override
protected Operation prepareOperation() {
    final Data key = serializationService.toData(parameters.lockName);
    final InternalLockNamespace namespace = new InternalLockNamespace(parameters.lockName);
    return new SignalOperation(namespace, key, parameters.threadId, parameters.name, true);
}
Also used : InternalLockNamespace(com.hazelcast.concurrent.lock.InternalLockNamespace) SignalOperation(com.hazelcast.concurrent.lock.operations.SignalOperation) Data(com.hazelcast.nio.serialization.Data)

Example 3 with SignalOperation

use of com.hazelcast.concurrent.lock.operations.SignalOperation in project hazelcast by hazelcast.

the class ConditionImpl method signal.

private void signal(boolean all) {
    long threadId = ThreadUtil.getThreadId();
    Data key = lockProxy.getKeyData();
    SignalOperation op = new SignalOperation(namespace, key, threadId, conditionId, all);
    InternalCompletableFuture f = invoke(op);
    f.join();
}
Also used : SignalOperation(com.hazelcast.concurrent.lock.operations.SignalOperation) InternalCompletableFuture(com.hazelcast.spi.InternalCompletableFuture) Data(com.hazelcast.nio.serialization.Data)

Aggregations

SignalOperation (com.hazelcast.concurrent.lock.operations.SignalOperation)3 Data (com.hazelcast.nio.serialization.Data)3 InternalLockNamespace (com.hazelcast.concurrent.lock.InternalLockNamespace)2 InternalCompletableFuture (com.hazelcast.spi.InternalCompletableFuture)1