Search in sources :

Example 6 with ConnectionListener

use of com.hazelcast.nio.ConnectionListener in project hazelcast by hazelcast.

the class MockConnectionManager method registerConnection.

@Override
public boolean registerConnection(final Address remoteEndpoint, final Connection connection) {
    mapConnections.put(remoteEndpoint, connection);
    ioService.getEventService().executeEventCallback(new StripedRunnable() {

        @Override
        public void run() {
            for (ConnectionListener listener : connectionListeners) {
                listener.connectionAdded(connection);
            }
        }

        @Override
        public int getKey() {
            return remoteEndpoint.hashCode();
        }
    });
    return true;
}
Also used : StripedRunnable(com.hazelcast.util.executor.StripedRunnable) ConnectionListener(com.hazelcast.nio.ConnectionListener)

Aggregations

ConnectionListener (com.hazelcast.nio.ConnectionListener)6 QuickTest (com.hazelcast.test.annotation.QuickTest)3 StripedRunnable (com.hazelcast.util.executor.StripedRunnable)3 Test (org.junit.Test)3 Address (com.hazelcast.nio.Address)2 Connection (com.hazelcast.nio.Connection)2 AssertTask (com.hazelcast.test.AssertTask)2