Search in sources :

Example 11 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class ReleaseBackupOperation method run.

@Override
public void run() throws Exception {
    SemaphoreContainer semaphoreContainer = getSemaphoreContainer();
    semaphoreContainer.release(firstCaller, permitCount);
    response = true;
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer)

Example 12 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class ReleaseOperation method run.

@Override
public void run() throws Exception {
    SemaphoreContainer semaphoreContainer = getSemaphoreContainer();
    semaphoreContainer.release(getCallerUuid(), permitCount);
    response = true;
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer)

Example 13 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class SemaphoreDetachMemberBackupOperation method run.

@Override
public void run() throws Exception {
    SemaphoreService service = getService();
    if (service.containsSemaphore(name)) {
        SemaphoreContainer semaphoreContainer = service.getSemaphoreContainer(name);
        response = semaphoreContainer.detachAll(firstCaller);
    }
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer) SemaphoreService(com.hazelcast.concurrent.semaphore.SemaphoreService)

Example 14 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class SemaphoreReplicationOperation method readInternal.

@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    int size = in.readInt();
    migrationData = new HashMap<String, SemaphoreContainer>(size);
    for (int i = 0; i < size; i++) {
        String name = in.readUTF();
        SemaphoreContainer semaphoreContainer = new SemaphoreContainer();
        semaphoreContainer.readData(in);
        migrationData.put(name, semaphoreContainer);
    }
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer)

Example 15 with SemaphoreContainer

use of com.hazelcast.concurrent.semaphore.SemaphoreContainer in project hazelcast by hazelcast.

the class AcquireBackupOperation method run.

@Override
public void run() throws Exception {
    SemaphoreContainer semaphoreContainer = getSemaphoreContainer();
    semaphoreContainer.acquire(firstCaller, permitCount);
    response = true;
}
Also used : SemaphoreContainer(com.hazelcast.concurrent.semaphore.SemaphoreContainer)

Aggregations

SemaphoreContainer (com.hazelcast.concurrent.semaphore.SemaphoreContainer)16 SemaphoreService (com.hazelcast.concurrent.semaphore.SemaphoreService)3 ILogger (com.hazelcast.logging.ILogger)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1