use of com.hazelcast.client.connection.ClientConnectionManager in project hazelcast by hazelcast.
the class ClientTestSupport method unblockMessagesToInstance.
/**
* Unblocks outgoing messages from client to given instance
*/
protected void unblockMessagesToInstance(HazelcastInstance instance, HazelcastInstance client) {
HazelcastClientInstanceImpl clientImpl = getHazelcastClientInstanceImpl(client);
ClientConnectionManager connectionManager = clientImpl.getConnectionManager();
Address address = instance.getCluster().getLocalMember().getAddress();
((TestClientRegistry.MockClientConnectionManager) connectionManager).unblockTo(address);
}
use of com.hazelcast.client.connection.ClientConnectionManager in project hazelcast by hazelcast.
the class ClientTestSupport method unblockMessagesFromInstance.
/**
* Unblocks incoming messages to client from given instance
*/
protected void unblockMessagesFromInstance(HazelcastInstance instance, HazelcastInstance client) {
HazelcastClientInstanceImpl clientImpl = getHazelcastClientInstanceImpl(client);
ClientConnectionManager connectionManager = clientImpl.getConnectionManager();
Address address = instance.getCluster().getLocalMember().getAddress();
((TestClientRegistry.MockClientConnectionManager) connectionManager).unblockFrom(address);
}
use of com.hazelcast.client.connection.ClientConnectionManager in project hazelcast by hazelcast.
the class ClientTestSupport method blockMessagesFromInstance.
/**
* Blocks incoming messages to client from given instance
*/
protected void blockMessagesFromInstance(HazelcastInstance instance, HazelcastInstance client) {
HazelcastClientInstanceImpl clientImpl = getHazelcastClientInstanceImpl(client);
ClientConnectionManager connectionManager = clientImpl.getConnectionManager();
Address address = instance.getCluster().getLocalMember().getAddress();
((TestClientRegistry.MockClientConnectionManager) connectionManager).blockFrom(address);
}
use of com.hazelcast.client.connection.ClientConnectionManager in project hazelcast by hazelcast.
the class NearCachedClientMapProxy method getConnectedServerVersion.
private int getConnectedServerVersion() {
ClientContext clientContext = getClientContext();
ClientClusterService clusterService = clientContext.getClusterService();
Address ownerConnectionAddress = clusterService.getOwnerConnectionAddress();
HazelcastClientInstanceImpl client = getClient();
ClientConnectionManager connectionManager = client.getConnectionManager();
Connection connection = connectionManager.getConnection(ownerConnectionAddress);
if (connection == null) {
logger.warning(format("No owner connection is available, " + "near cached cache %s will be started in legacy mode", name));
return UNKNOWN_HAZELCAST_VERSION;
}
return ((ClientConnection) connection).getConnectedServerVersion();
}
use of com.hazelcast.client.connection.ClientConnectionManager in project hazelcast by hazelcast.
the class ProxyManager method getTargetOrOwnerConnection.
private Connection getTargetOrOwnerConnection(final Address target) throws IOException {
if (target == null) {
throw new IOException("Not able to setup owner connection!");
}
final ClientConnectionManager connectionManager = client.getConnectionManager();
Connection connection = connectionManager.getConnection(target);
if (connection == null) {
final Address ownerConnectionAddress = client.getClientClusterService().getOwnerConnectionAddress();
if (ownerConnectionAddress == null) {
throw new IOException("Not able to setup owner connection!");
}
connection = connectionManager.getConnection(ownerConnectionAddress);
if (connection == null) {
throw new IOException("Client is not connected to member " + target);
}
}
return connection;
}
Aggregations