private static void startService(int port, final SessionHandler handler,
String serviceType) {
SessionAcceptor acceptor = SessionFactory
.createSessionAcceptor(SessionType.TCP);
acceptor.setListenPort(port);
acceptor.setAcceptorHandler(new SessionAcceptorHandlerAdapter() {
public void sessionAccepted(SessionAcceptor acceptor,
Session session) throws Exception {
session.setSessionHandler(handler);
session.start();