Package com.hazelcast.concurrent.semaphore

Examples of com.hazelcast.concurrent.semaphore.Permit


        super(name, permitCount, null);
    }

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


    @Override
    protected void writeInternal(ObjectDataOutput out) throws IOException {
        out.writeInt(migrationData.size());
        for (Map.Entry<String, Permit> entry : migrationData.entrySet()) {
            String key = entry.getKey();
            Permit value = entry.getValue();
            out.writeUTF(key);
            value.writeData(out);
        }
    }
View Full Code Here

    protected void readInternal(ObjectDataInput in) throws IOException {
        int size = in.readInt();
        migrationData = new HashMap<String, Permit>(size);
        for (int i = 0; i < size; i++) {
            String name = in.readUTF();
            Permit permit = new Permit();
            permit.readData(in);
            migrationData.put(name, permit);
        }
    }
View Full Code Here

        super(name, permitCount, firstCaller);
    }

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

        super(name, permitCount);
    }

    @Override
    public int getAsyncBackupCount() {
        Permit permit = getPermit();
        return permit.getAsyncBackupCount();
    }
View Full Code Here

        return permit.getAsyncBackupCount();
    }

    @Override
    public int getSyncBackupCount() {
        Permit permit = getPermit();
        return permit.getSyncBackupCount();
    }
View Full Code Here

        super(name, permitCount);
    }

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

        super(name, permitCount, null);
    }

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

        this.firstCaller = firstCaller;
    }

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

        setWaitTimeout(timeout);
    }

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

TOP

Related Classes of com.hazelcast.concurrent.semaphore.Permit

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.