Search in sources :

Example 1 with SessionAwareSemaphoreProxy

use of com.hazelcast.client.cp.internal.datastructures.semaphore.SessionAwareSemaphoreProxy in project hazelcast by hazelcast.

the class ClientRaftProxyFactory method createSemaphore.

private ISemaphore createSemaphore(RaftGroupId groupId, String proxyName, String objectName) {
    ClientMessage request = SemaphoreGetSemaphoreTypeCodec.encodeRequest(proxyName);
    ClientMessage response = new ClientInvocation(client, request, objectName).invoke().join();
    boolean jdkCompatible = SemaphoreGetSemaphoreTypeCodec.decodeResponse(response);
    return jdkCompatible ? new SessionlessSemaphoreProxy(context, groupId, proxyName, objectName) : new SessionAwareSemaphoreProxy(context, groupId, proxyName, objectName);
}
Also used : SessionlessSemaphoreProxy(com.hazelcast.client.cp.internal.datastructures.semaphore.SessionlessSemaphoreProxy) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) SessionAwareSemaphoreProxy(com.hazelcast.client.cp.internal.datastructures.semaphore.SessionAwareSemaphoreProxy)

Aggregations

SessionAwareSemaphoreProxy (com.hazelcast.client.cp.internal.datastructures.semaphore.SessionAwareSemaphoreProxy)1 SessionlessSemaphoreProxy (com.hazelcast.client.cp.internal.datastructures.semaphore.SessionlessSemaphoreProxy)1 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)1 ClientInvocation (com.hazelcast.client.impl.spi.impl.ClientInvocation)1