use of com.hazelcast.client.impl.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.MockTcpClientConnectionManager) connectionManager).blockFrom(address);
}
use of com.hazelcast.client.impl.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.MockTcpClientConnectionManager) connectionManager).unblockTo(address);
}
use of com.hazelcast.client.impl.connection.ClientConnectionManager in project hazelcast by hazelcast.
the class ClientTestSupport method getAllEventHandlers.
protected Map<Long, EventHandler> getAllEventHandlers(HazelcastInstance client) {
ClientConnectionManager connectionManager = getHazelcastClientInstanceImpl(client).getConnectionManager();
Collection<Connection> activeConnections = connectionManager.getActiveConnections();
HashMap<Long, EventHandler> map = new HashMap<>();
for (Connection activeConnection : activeConnections) {
map.putAll(((ClientConnection) activeConnection).getEventHandlers());
}
return map;
}
use of com.hazelcast.client.impl.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.MockTcpClientConnectionManager) connectionManager).unblockFrom(address);
}
use of com.hazelcast.client.impl.connection.ClientConnectionManager in project hazelcast by hazelcast.
the class ClientTestSupport method makeSureDisconnectedFromServer.
public static void makeSureDisconnectedFromServer(final HazelcastInstance client, UUID memberUUID) {
assertTrueEventually(() -> {
ClientConnectionManager connectionManager = getHazelcastClientInstanceImpl(client).getConnectionManager();
assertNull(connectionManager.getConnection(memberUUID));
});
}
Aggregations