use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class AtomicRefProxy method invokeApply.
private <T2, T3> InternalCompletableFuture<T3> invokeApply(IFunction<T, T2> function, ReturnValueType returnValueType, boolean alter) {
checkTrue(function != null, "Function cannot be null");
Data data = getContext().getSerializationService().toData(function);
ClientMessage request = AtomicRefApplyCodec.encodeRequest(groupId, objectName, data, returnValueType.value(), alter);
ClientInvocationFuture future = new ClientInvocation(getClient(), request, name).invoke();
return new ClientDelegatingFuture<>(future, getSerializationService(), AtomicRefApplyCodec::decodeResponse);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class CountDownLatchProxy method trySetCount.
@Override
public boolean trySetCount(int count) {
checkPositive(count, "Count must be positive!");
ClientMessage request = CountDownLatchTrySetCountCodec.encodeRequest(groupId, objectName, count);
ClientMessage response = new ClientInvocation(getClient(), request, name).invoke().joinInternal();
return CountDownLatchTrySetCountCodec.decodeResponse(response);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class CountDownLatchProxy method onDestroy.
@Override
public void onDestroy() {
ClientMessage request = CPGroupDestroyCPObjectCodec.encodeRequest(groupId, getServiceName(), objectName);
new ClientInvocation(getClient(), request, name).invoke().joinInternal();
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class ClientRaftProxyFactory method getGroupId.
private RaftGroupId getGroupId(String proxyName, String objectName) {
ClientMessage request = CPGroupCreateCPGroupCodec.encodeRequest(proxyName);
ClientMessage response = new ClientInvocation(client, request, objectName).invoke().joinInternal();
return CPGroupCreateCPGroupCodec.decodeResponse(response);
}
use of com.hazelcast.client.impl.spi.impl.ClientInvocation in project hazelcast by hazelcast.
the class SessionAwareSemaphoreProxy method availablePermits.
@Override
public int availablePermits() {
ClientMessage request = SemaphoreAvailablePermitsCodec.encodeRequest(groupId, objectName);
HazelcastClientInstanceImpl client = getClient();
ClientMessage response = new ClientInvocation(client, request, objectName).invoke().joinInternal();
return SemaphoreAvailablePermitsCodec.decodeResponse(response);
}
Aggregations