// repo handler
this.repoServer = new Server( 0 );
ServletHolder shRepo = new ServletHolder( RepoServlet.class );
ServletContextHandler contextRepo = new ServletContextHandler();
contextRepo.setContextPath( "/" );
contextRepo.addServlet( shRepo, "/*" );
repoServer.setHandler( contextRepo );
repoServer.start();
this.repoServerPort = repoServer.getConnectors()[0].getLocalPort();
//redirect handler
this.redirectServer = new Server( 0 );
ServletHolder shRedirect = new ServletHolder( RedirectServlet.class );
ServletContextHandler contextRedirect = new ServletContextHandler();
contextRedirect.setAttribute( "redirectToPort", Integer.toString( this.repoServerPort ) );
contextRedirect.setContextPath( "/" );
contextRedirect.addServlet( shRedirect, "/*" );
redirectServer.setHandler( contextRedirect );
redirectServer.start();
this.redirectPort = redirectServer.getConnectors()[0].getLocalPort();
log.info( "redirect server port {}", redirectPort );