Package com.hazelcast.concurrent.semaphore.operations

Examples of com.hazelcast.concurrent.semaphore.operations.AcquireOperation


            public IdentifiedDataSerializable create(int typeId) {
                switch (typeId) {
                    case ACQUIRE_BACKUP_OPERATION:
                        return new AcquireBackupOperation();
                    case ACQUIRE_OPERATION:
                        return new AcquireOperation();
                    case AVAILABLE_OPERATION:
                        return new AvailableOperation();
                    case DEAD_MEMBER_BACKUP_OPERATION:
                        return new DeadMemberBackupOperation();
                    case DRAIN_BACKUP_OPERATION:
View Full Code Here


    @Override
    public void acquire(int permits) throws InterruptedException {
        isNotNegative(permits, "permits");
        try {
            AcquireOperation operation = new AcquireOperation(name, permits, -1);
            InternalCompletableFuture<Object> future = invoke(operation);
            future.get();
        } catch (Throwable t) {
            throw rethrowAllowInterrupted(t);
        }
View Full Code Here

    @Override
    public boolean tryAcquire(int permits, long timeout, TimeUnit unit) throws InterruptedException {
        isNotNegative(permits, "permits");
        try {
            AcquireOperation operation = new AcquireOperation(name, permits, unit.toMillis(timeout));
            Future<Boolean> future = invoke(operation);
            return future.get();
        } catch (Throwable t) {
            throw rethrowAllowInterrupted(t);
        }
View Full Code Here

        this.timeout = timeout;
    }

    @Override
    protected Operation prepareOperation() {
        return new AcquireOperation(name, permitCount, timeout);
    }
View Full Code Here

        this.timeout = timeout;
    }

    @Override
    protected Operation prepareOperation() {
        return new AcquireOperation(name, permitCount, timeout);
    }
View Full Code Here

        super(name, 1);
    }

    @Override
    protected Operation prepareOperation() {
        return new AcquireOperation(name, permitCount, timeout);
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.concurrent.semaphore.operations.AcquireOperation

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.