Search in sources :

Example 36 with ClientInvocationFuture

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

the class ClientExecutorServiceProxy method submitToTargetInternal.

private <T> void submitToTargetInternal(Callable<T> task, Address address, ExecutionCallback<T> callback) {
    checkNotNull(task, "task should not be null");
    String uuid = getUUID();
    ClientMessage request = ExecutorServiceSubmitToAddressCodec.encodeRequest(name, uuid, toData(task), address);
    ClientInvocationFuture f = invokeOnTarget(request, address);
    SerializationService serializationService = getContext().getSerializationService();
    ClientDelegatingFuture<T> delegatingFuture = new ClientDelegatingFuture<T>(f, serializationService, SUBMIT_TO_ADDRESS_DECODER);
    delegatingFuture.andThen(callback);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.util.ClientDelegatingFuture) SerializationService(com.hazelcast.spi.serialization.SerializationService) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.spi.impl.ClientInvocationFuture)

Aggregations

ClientInvocationFuture (com.hazelcast.client.spi.impl.ClientInvocationFuture)36 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)31 ClientInvocation (com.hazelcast.client.spi.impl.ClientInvocation)21 ClientDelegatingFuture (com.hazelcast.client.util.ClientDelegatingFuture)17 Data (com.hazelcast.nio.serialization.Data)9 SerializationService (com.hazelcast.spi.serialization.SerializationService)9 ExecutionException (java.util.concurrent.ExecutionException)9 CacheException (javax.cache.CacheException)7 CacheEventData (com.hazelcast.cache.impl.CacheEventData)6 HazelcastClientInstanceImpl (com.hazelcast.client.impl.HazelcastClientInstanceImpl)6 HazelcastInstanceNotActiveException (com.hazelcast.core.HazelcastInstanceNotActiveException)5 HazelcastException (com.hazelcast.core.HazelcastException)3 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)3 StaleSequenceException (com.hazelcast.ringbuffer.StaleSequenceException)3 ClientConnection (com.hazelcast.client.connection.nio.ClientConnection)2 EventHandler (com.hazelcast.client.spi.EventHandler)2 Connection (com.hazelcast.nio.Connection)2 CancellationException (java.util.concurrent.CancellationException)2 AuthenticationException (com.hazelcast.client.AuthenticationException)1 ClientMessageDecoder (com.hazelcast.client.impl.ClientMessageDecoder)1