use of com.hazelcast.client.connection.nio.ClientConnection in project hazelcast by hazelcast.
the class ClientSmartInvocationServiceImpl method invokeOnRandomTarget.
@Override
public void invokeOnRandomTarget(ClientInvocation invocation) throws IOException {
final Address randomAddress = getRandomAddress();
if (randomAddress == null) {
throw new IOException("Not address found to invoke ");
}
final Connection connection = getOrTriggerConnect(randomAddress);
send(invocation, (ClientConnection) connection);
}
use of com.hazelcast.client.connection.nio.ClientConnection in project hazelcast by hazelcast.
the class ClientSmartInvocationServiceImpl method invokeOnTarget.
@Override
public void invokeOnTarget(ClientInvocation invocation, Address target) throws IOException {
if (target == null) {
throw new NullPointerException("Target can not be null");
}
if (!isMember(target)) {
throw new TargetNotMemberException("Target : " + target + " is not member. ");
}
final Connection connection = getOrTriggerConnect(target);
invokeOnConnection(invocation, (ClientConnection) connection);
}
use of com.hazelcast.client.connection.nio.ClientConnection in project hazelcast by hazelcast.
the class ClientSmartInvocationServiceImpl method invokeOnPartitionOwner.
@Override
public void invokeOnPartitionOwner(ClientInvocation invocation, int partitionId) throws IOException {
final Address owner = partitionService.getPartitionOwner(partitionId);
if (owner == null) {
throw new IOException("Partition does not have owner. partitionId : " + partitionId);
}
invocation.getClientMessage().setPartitionId(partitionId);
Connection connection = getOrTriggerConnect(owner);
send(invocation, (ClientConnection) connection);
}
Aggregations