Search in sources :

Example 51 with ClientInvocation

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

the class ClientMapProxy method invokeOnKeyOwner.

private ClientInvocationFuture invokeOnKeyOwner(ClientMessage request, Data keyData) {
    int partitionId = getContext().getPartitionService().getPartitionId(keyData);
    final ClientInvocation clientInvocation = new ClientInvocation(getClient(), request, partitionId);
    return clientInvocation.invoke();
}
Also used : ClientInvocation(com.hazelcast.client.spi.impl.ClientInvocation)

Example 52 with ClientInvocation

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

the class ClientDurableExecutorServiceProxy method retrieveResult.

@Override
public <T> Future<T> retrieveResult(long taskId) {
    int partitionId = Bits.extractInt(taskId, false);
    int sequence = Bits.extractInt(taskId, true);
    ClientMessage clientMessage = DurableExecutorRetrieveResultCodec.encodeRequest(name, sequence);
    ClientInvocationFuture future = new ClientInvocation(getClient(), clientMessage, partitionId).invoke();
    return new ClientDelegatingFuture<T>(future, getSerializationService(), RETRIEVE_RESPONSE_DECODER);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.util.ClientDelegatingFuture) ClientInvocation(com.hazelcast.client.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.spi.impl.ClientInvocationFuture)

Aggregations

ClientInvocation (com.hazelcast.client.spi.impl.ClientInvocation)52 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)47 ClientInvocationFuture (com.hazelcast.client.spi.impl.ClientInvocationFuture)25 Address (com.hazelcast.nio.Address)13 ExecutionException (java.util.concurrent.ExecutionException)13 ClientDelegatingFuture (com.hazelcast.client.util.ClientDelegatingFuture)10 Data (com.hazelcast.nio.serialization.Data)10 HazelcastClientInstanceImpl (com.hazelcast.client.impl.HazelcastClientInstanceImpl)9 TimeoutException (java.util.concurrent.TimeoutException)9 StaleTaskException (com.hazelcast.scheduledexecutor.StaleTaskException)6 ArrayList (java.util.ArrayList)6 Future (java.util.concurrent.Future)6 Member (com.hazelcast.core.Member)5 SerializationService (com.hazelcast.spi.serialization.SerializationService)5 IOException (java.io.IOException)5 ClientConnection (com.hazelcast.client.connection.nio.ClientConnection)4 HazelcastException (com.hazelcast.core.HazelcastException)4 HashMap (java.util.HashMap)4 Map (java.util.Map)4 CacheException (javax.cache.CacheException)4