MinaAutoTerminatingClientGateway gateway = new MinaAutoTerminatingClientGateway();
gateway.setPort(1234);
gateway.setHost("localhost");
gateway.setHeartbeat(1000);
RawClientMinaHandler handler = new RawClientMinaHandler();
handler.setHeartbeatContainer(heartbeatContainer);
handler.setGateway(gateway);
gateway.addMessageListener(new IDontNeedSecurity());
gateway.addMessageListener(new ClientMessageValidationListener());