use of com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl in project hazelcast by hazelcast.
the class IExecutorDelegatingFuture method invokeCancelRequest.
private boolean invokeCancelRequest(boolean mayInterruptIfRunning) throws InterruptedException, ExecutionException {
waitForRequestToBeSend();
HazelcastClientInstanceImpl client = (HazelcastClientInstanceImpl) context.getHazelcastInstance();
if (partitionId > -1) {
ClientMessage request = ExecutorServiceCancelOnPartitionCodec.encodeRequest(uuid, mayInterruptIfRunning);
ClientInvocation clientInvocation = new ClientInvocation(client, request, objectName, partitionId);
ClientInvocationFuture f = clientInvocation.invoke();
return ExecutorServiceCancelOnPartitionCodec.decodeResponse(f.get());
} else {
ClientMessage request = ExecutorServiceCancelOnMemberCodec.encodeRequest(uuid, member.getUuid(), mayInterruptIfRunning);
ClientInvocation clientInvocation = new ClientInvocation(client, request, objectName, member.getUuid());
ClientInvocationFuture f = clientInvocation.invoke();
return ExecutorServiceCancelOnMemberCodec.decodeResponse(f.get());
}
}
use of com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl in project hazelcast by hazelcast.
the class ClientTxnProxy method invoke.
final ClientMessage invoke(ClientMessage request) {
HazelcastClientInstanceImpl client = transactionContext.getClient();
ClientConnection connection = transactionContext.getConnection();
return ClientTransactionUtil.invoke(request, getName(), client, connection);
}
use of com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl in project hazelcast by hazelcast.
the class ClientConsoleApp method startPrompt.
private static String startPrompt(HazelcastInstance hz) {
HazelcastClientInstanceImpl hazelcastClientImpl = getHazelcastClientInstanceImpl(hz);
ClientClusterService clientClusterService = hazelcastClientImpl.getClientClusterService();
MCClusterMetadata clusterMetadata = FutureUtil.getValue(getClusterMetadata(hazelcastClientImpl, clientClusterService.getMasterMember()));
Cluster cluster = hazelcastClientImpl.getCluster();
Set<Member> members = cluster.getMembers();
String versionString = "Hazelcast " + clusterMetadata.getMemberVersion();
return new StringBuilder().append("Hazelcast Console Application has started.\n").append("Connected to ").append(versionString).append(" at ").append(members.iterator().next().getAddress().toString()).append(" (+").append(members.size() - 1).append(" more)\n").append("Type 'help' for instructions").toString();
}
use of com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl in project hazelcast by hazelcast.
the class HazelcastCommandLine method cluster.
@Command(description = "Shows current cluster state and information about members")
public void cluster(@Mixin(name = "verbosity") Verbosity verbosity, @Mixin(name = "targets") TargetsMixin targets) {
runWithHazelcast(targets, verbosity, false, hz -> {
HazelcastClientInstanceImpl hazelcastClientImpl = getHazelcastClientInstanceImpl(hz);
ClientClusterService clientClusterService = hazelcastClientImpl.getClientClusterService();
MCClusterMetadata clusterMetadata = FutureUtil.getValue(getClusterMetadata(hazelcastClientImpl, clientClusterService.getMasterMember()));
Cluster cluster = hazelcastClientImpl.getCluster();
println("State: " + clusterMetadata.getCurrentState());
println("Version: " + clusterMetadata.getMemberVersion());
println("Size: " + cluster.getMembers().size());
println("");
String format = "%-24s %-19s";
printf(format, "ADDRESS", "UUID");
cluster.getMembers().forEach(member -> printf(format, member.getAddress(), member.getUuid()));
});
}
use of com.hazelcast.client.impl.clientside.HazelcastClientInstanceImpl 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