Search in sources :

Example 1 with AwaitOperation

use of com.hazelcast.concurrent.countdownlatch.operations.AwaitOperation in project hazelcast by hazelcast.

the class CountDownLatchProxy method await.

@Override
public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
    checkNotNull(unit, "unit can't be null");
    Operation op = new AwaitOperation(name, unit.toMillis(timeout)).setPartitionId(partitionId);
    Future<Boolean> f = invokeOnPartition(op);
    try {
        return f.get();
    } catch (ExecutionException e) {
        throw rethrowAllowInterrupted(e);
    }
}
Also used : AwaitOperation(com.hazelcast.concurrent.countdownlatch.operations.AwaitOperation) CountDownOperation(com.hazelcast.concurrent.countdownlatch.operations.CountDownOperation) Operation(com.hazelcast.spi.Operation) GetCountOperation(com.hazelcast.concurrent.countdownlatch.operations.GetCountOperation) AwaitOperation(com.hazelcast.concurrent.countdownlatch.operations.AwaitOperation) SetCountOperation(com.hazelcast.concurrent.countdownlatch.operations.SetCountOperation) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

AwaitOperation (com.hazelcast.concurrent.countdownlatch.operations.AwaitOperation)1 CountDownOperation (com.hazelcast.concurrent.countdownlatch.operations.CountDownOperation)1 GetCountOperation (com.hazelcast.concurrent.countdownlatch.operations.GetCountOperation)1 SetCountOperation (com.hazelcast.concurrent.countdownlatch.operations.SetCountOperation)1 Operation (com.hazelcast.spi.Operation)1 ExecutionException (java.util.concurrent.ExecutionException)1