private static void startJettytHttpServer() throws MultiException {
    // Set up Jetty HTTP server with our servlet; this accidental
    // complexity is annoying for a demo app, but much less so than the
    // steps in deploying this in to Tomcat or whatever
    HttpServer webServer = new HttpServer();
    SocketListener listener = new SocketListener();
    listener.setPort(8080);
    webServer.addListener(listener);

    ServletHandler sh = new ServletHandler();
    sh.addServlet("service1", "/service1", ServerImpl.class.getName());

    HttpContext context = new HttpContext(webServer, "/");
    context.addHandler(sh);

    webServer.start();
  }
Beispiel #2
0
 public void startHttpServer(HttpServer httpServer) throws Exception {
   httpServer.start();
   SysLog.logInfo("http server was started");
 }