Search in sources :

Example 66 with ClientInvocation

use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.

the class CountDownLatchProxy method countDown.

private void countDown(int round, UUID invocationUid) {
    ClientMessage request = CountDownLatchCountDownCodec.encodeRequest(groupId, objectName, invocationUid, round);
    new ClientInvocation(getClient(), request, name).invoke().joinInternal();
}
Also used : ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 67 with ClientInvocation

use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.

the class CountDownLatchProxy method getCount.

@Override
public int getCount() {
    ClientMessage request = CountDownLatchGetCountCodec.encodeRequest(groupId, objectName);
    ClientMessage response = new ClientInvocation(getClient(), request, name).invoke().joinInternal();
    return CountDownLatchGetCountCodec.decodeResponse(response);
}
Also used : ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 68 with ClientInvocation

use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.

the class CountDownLatchProxy method getRound.

private int getRound() {
    ClientMessage request = CountDownLatchGetRoundCodec.encodeRequest(groupId, objectName);
    ClientMessage response = new ClientInvocation(getClient(), request, name).invoke().joinInternal();
    return CountDownLatchGetRoundCodec.decodeResponse(response);
}
Also used : ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 69 with ClientInvocation

use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.

the class FencedLockProxy method onDestroy.

@Override
public void onDestroy() {
    ClientMessage msg = CPGroupDestroyCPObjectCodec.encodeRequest(lock.getGroupId(), getServiceName(), lock.getObjectName());
    new ClientInvocation(getClient(), msg, name).invoke().joinInternal();
}
Also used : ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Example 70 with ClientInvocation

use of com.hazelcast.client.impl.spi.impl.ClientInvocation 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

ClientInvocation (com.hazelcast.client.impl.spi.impl.ClientInvocation)129 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)97 ClientDelegatingFuture (com.hazelcast.client.impl.ClientDelegatingFuture)54 ClientInvocationFuture (com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)51 Test (org.junit.Test)23 Data (com.hazelcast.internal.serialization.Data)22 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)19 QuickTest (com.hazelcast.test.annotation.QuickTest)19 UUID (java.util.UUID)18 HazelcastClientInstanceImpl (com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl)16 Future (java.util.concurrent.Future)13 UuidUtil.newUnsecureUUID (com.hazelcast.internal.util.UuidUtil.newUnsecureUUID)9 ArrayList (java.util.ArrayList)9 Nonnull (javax.annotation.Nonnull)9 ExecutionException (java.util.concurrent.ExecutionException)8 InternalCompletableFuture (com.hazelcast.spi.impl.InternalCompletableFuture)7 Collection (java.util.Collection)6 List (java.util.List)6 Map (java.util.Map)6 TimeUnit (java.util.concurrent.TimeUnit)6