NettyLoginMessageListener login = new NettyLoginMessageListener();
login.setGateway(gateway);
login.setLoginHandler(new SystemLoginHandler());
gateway.addMessageListener(login);
NettyConnectStateListener connect = new NettyConnectStateListener();
connect.setGateway(gateway);
gateway.addMessageListener(connect);
NettyHeartbeatListener heartbeat = new NettyHeartbeatListener();
heartbeat.setHeartbeatContainer(heartbeatContainer);
heartbeat.setGateway(gateway);