Search in sources :

Example 41 with ClientInvocationFuture

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

the class AtomicLongProxy method getAndAlterAsync.

@Override
public InternalCompletableFuture<Long> getAndAlterAsync(IFunction<Long, Long> function) {
    Data f = getSerializationService().toData(function);
    ClientMessage request = AtomicLongAlterCodec.encodeRequest(groupId, objectName, f, OLD_VALUE.value());
    ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
    return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicLongAlterCodec::decodeResponse);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) Data(com.hazelcast.internal.serialization.Data) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) AtomicLongAlterCodec(com.hazelcast.client.impl.protocol.codec.AtomicLongAlterCodec) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)

Example 42 with ClientInvocationFuture

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

the class AtomicLongProxy method applyAsync.

@Override
public <R> InternalCompletableFuture<R> applyAsync(IFunction<Long, R> function) {
    Data f = getSerializationService().toData(function);
    ClientMessage request = AtomicLongApplyCodec.encodeRequest(groupId, objectName, f);
    ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
    return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicLongApplyCodec::decodeResponse);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) AtomicLongApplyCodec(com.hazelcast.client.impl.protocol.codec.AtomicLongApplyCodec) Data(com.hazelcast.internal.serialization.Data) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)

Example 43 with ClientInvocationFuture

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

the class AtomicLongProxy method getAsync.

@Override
public InternalCompletableFuture<Long> getAsync() {
    ClientMessage request = AtomicLongGetCodec.encodeRequest(groupId, objectName);
    ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
    return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicLongGetCodec::decodeResponse);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) AtomicLongGetCodec(com.hazelcast.client.impl.protocol.codec.AtomicLongGetCodec) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)

Example 44 with ClientInvocationFuture

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

the class AtomicLongProxy method alterAndGetAsync.

@Override
public InternalCompletableFuture<Long> alterAndGetAsync(IFunction<Long, Long> function) {
    Data f = getSerializationService().toData(function);
    ClientMessage request = AtomicLongAlterCodec.encodeRequest(groupId, objectName, f, NEW_VALUE.value());
    ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
    return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicLongAlterCodec::decodeResponse);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) Data(com.hazelcast.internal.serialization.Data) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) AtomicLongAlterCodec(com.hazelcast.client.impl.protocol.codec.AtomicLongAlterCodec) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)

Example 45 with ClientInvocationFuture

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

the class AtomicRefProxy method getAsync.

@Override
public InternalCompletableFuture<T> getAsync() {
    ClientMessage request = AtomicRefGetCodec.encodeRequest(groupId, objectName);
    ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
    return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicRefGetCodec::decodeResponse);
}
Also used : ClientDelegatingFuture(com.hazelcast.client.impl.ClientDelegatingFuture) AtomicRefGetCodec(com.hazelcast.client.impl.protocol.codec.AtomicRefGetCodec) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) ClientInvocationFuture(com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)

Aggregations

ClientInvocationFuture (com.hazelcast.client.impl.spi.impl.ClientInvocationFuture)65 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)54 ClientInvocation (com.hazelcast.client.impl.spi.impl.ClientInvocation)44 ClientDelegatingFuture (com.hazelcast.client.impl.ClientDelegatingFuture)34 Data (com.hazelcast.internal.serialization.Data)22 UUID (java.util.UUID)11 Nonnull (javax.annotation.Nonnull)6 ILogger (com.hazelcast.logging.ILogger)5 InternalCompletableFuture (com.hazelcast.spi.impl.InternalCompletableFuture)5 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)5 HazelcastClientInstanceImpl (com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl)4 IterationPointer (com.hazelcast.internal.iteration.IterationPointer)4 SerializationService (com.hazelcast.internal.serialization.SerializationService)4 CachePutCodec (com.hazelcast.client.impl.protocol.codec.CachePutCodec)3 DurableExecutorRetrieveResultCodec (com.hazelcast.client.impl.protocol.codec.DurableExecutorRetrieveResultCodec)3 Member (com.hazelcast.cluster.Member)3 ExecutionCallbackAdapter (com.hazelcast.executor.impl.ExecutionCallbackAdapter)3 StaleSequenceException (com.hazelcast.ringbuffer.StaleSequenceException)3 AccessControlException (java.security.AccessControlException)3 List (java.util.List)3