Examples of Permit


Examples of com.hazelcast.concurrent.semaphore.Permit

        return new SemaphoreWaitNotifyKey(name, "acquire");
    }

    @Override
    public boolean shouldWait() {
        Permit permit = getPermit();
        return getWaitTimeout() != 0 && !permit.isAvailable(permitCount);
    }
View Full Code Here

Examples of com.hazelcast.concurrent.semaphore.Permit

        super(name, permitCount, firstCaller);
    }

    @Override
    public void run() throws Exception {
        Permit permit = getPermit();
        permit.release(permitCount, firstCaller);
        response = true;
    }
View Full Code Here

Examples of com.hazelcast.concurrent.semaphore.Permit

        super(name, permitCount);
    }

    @Override
    public void run() throws Exception {
        Permit permit = getPermit();
        permit.release(permitCount, getCallerUuid());
        response = true;
    }
View Full Code Here

Examples of com.hazelcast.concurrent.semaphore.Permit

        super(name, -1, firstCaller);
    }

    @Override
    public void run() throws Exception {
        Permit permit = getPermit();
        permit.memberRemoved(firstCaller);
        response = true;
    }
View Full Code Here

Examples of com.hazelcast.concurrent.semaphore.Permit

        super(name, -1);
    }

    @Override
    public void run() throws Exception {
        Permit permit = getPermit();
        response = permit.drain(getCallerUuid());
    }
View Full Code Here

Examples of com.hazelcast.concurrent.semaphore.Permit

        super(name, permitCount, firstCaller);
    }

    @Override
    public void run() throws Exception {
        Permit permit = getPermit();
        permit.drain(firstCaller);
        response = true;
    }
View Full Code Here

Examples of com.hazelcast.concurrent.semaphore.Permit

        super(name, permitCount);
    }

    @Override
    public void run() throws Exception {
        Permit permit = getPermit();
        response = permit.reduce(permitCount);
    }
View Full Code Here

Examples of org.rhq.enterprise.communications.util.ConcurrencyManager.Permit

        assert null != cm.getPermit(null); // this is allowed and just a no-op
        cm.releasePermit(cm.getPermit(null)); // this is allowed and just a no-op
        cm.releasePermit(null); // this is allowed and just a no-op

        Permit permit = cm.getPermit(foo);
        assert permit != null;
        cm.releasePermit(permit);

        permit = cm.getPermit(foo); // 1
        assert permit != null;
View Full Code Here

Examples of org.rhq.enterprise.communications.util.ConcurrencyManager.Permit

        HashMap<String, Integer> map = new HashMap<String, Integer>();
        map.put(foo, 0);
        ConcurrencyManager cm1 = new ConcurrencyManager(map);

        Permit permit1 = cm1.getPermit(foo);
        assert permit1 != null;
        cm1.releasePermit(permit1);

        map = new HashMap<String, Integer>();
        map.put(foo, -1); // negative, just like it was 0
        ConcurrencyManager cm2 = new ConcurrencyManager(map);

        Permit permit2 = cm2.getPermit(foo);
        assert permit2 != null;
        cm2.releasePermit(permit2);
        cm2.releasePermit(permit1); // a no-op since permit1 wasn't granted by cm2
    }
View Full Code Here

Examples of org.rhq.enterprise.communications.util.ConcurrencyManager.Permit

        String method_name = invocation.getMethodName();
        Object[] params = invocation.getParameters();
        String[] signature = invocation.getSignature();
        Class<?>[] class_signature = new Class[signature.length];

        Permit permit = null;
        Method pojo_method = null;

        RemotePojoInvocationCommandResponse response;

        ConcurrencyManager concurrency_manager = getServiceContainer().getConcurrencyManager();
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.