Action<ConnectEvent<ObjectConnection>> action) {
MultiChannelConnection<Object> messageConnection = connectEvent.getConnection();
IncomingMethodInvocationHandler incoming = new IncomingMethodInvocationHandler(classLoader, messageConnection);
OutgoingMethodInvocationHandler outgoing = new OutgoingMethodInvocationHandler(messageConnection);
AtomicReference<ObjectConnection> connectionRef = new AtomicReference<ObjectConnection>();
AsyncStoppable stopControl = new ConnectionAsyncStoppable(messageConnection, connectionRef);
DefaultObjectConnection connection = new DefaultObjectConnection(messageConnection, stopControl, outgoing, incoming);
connectionRef.set(connection);
connections.add(connection);
action.execute(new ConnectEvent<ObjectConnection>(connection, connectEvent.getLocalAddress(), connectEvent.getRemoteAddress()));