use of com.hazelcast.client.spi.ClientClusterService in project hazelcast by hazelcast.
the class ClientNonSmartInvocationServiceImpl method sendToOwner.
private void sendToOwner(ClientInvocation invocation) throws IOException {
ClientClusterService clusterService = client.getClientClusterService();
Address ownerConnectionAddress = clusterService.getOwnerConnectionAddress();
if (ownerConnectionAddress == null) {
throw new IOException("Packet is not send to owner address");
}
Connection conn = connectionManager.getConnection(ownerConnectionAddress);
if (conn == null) {
throw new IOException("Packet is not sent to owner address: " + ownerConnectionAddress);
}
send(invocation, (ClientConnection) conn);
}
use of com.hazelcast.client.spi.ClientClusterService in project hazelcast by hazelcast.
the class ClientSmartInvocationServiceImpl method ensureOwnerConnectionAvailable.
private void ensureOwnerConnectionAvailable() throws IOException {
ClientClusterService clientClusterService = client.getClientClusterService();
Address ownerConnectionAddress = clientClusterService.getOwnerConnectionAddress();
boolean isOwnerConnectionAvailable = ownerConnectionAddress != null && connectionManager.getConnection(ownerConnectionAddress) != null;
if (!isOwnerConnectionAvailable) {
if (isShutdown()) {
throw new HazelcastException("ConnectionManager is not active!");
}
throw new IOException("Not able to setup owner connection!");
}
}
Aggregations