Package org.mortbay.jetty

Examples of org.mortbay.jetty.Server.start()


    String hoopWebAppDir = new File(new File(new File(hoopDir, "src"), "main"), "webapp").getAbsolutePath();
    WebAppContext context = new WebAppContext(hoopWebAppDir, "/");

    Server server = getJettyServer();
    server.addHandler(context);
    server.start();
  }

  private void testGet() throws Exception {
    Configuration conf = new Configuration();
    conf.set("fs.http.impl", HoopFileSystem.class.getName());
View Full Code Here


    Context context = new Context();
    context.setContextPath("/");
    context.addServlet(MyServlet.class, "/bar");
    Server server = getJettyServer();
    server.addHandler(context);
    server.start();
    URL url = new URL(getJettyURL(), "/bar");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    Assert.assertEquals(conn.getResponseCode(), HttpURLConnection.HTTP_OK);
    BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    Assert.assertEquals(reader.readLine(), "foo");
View Full Code Here

      new File(new File(new File(new File(dir, "hoop-webapp"), "src"), "main"), "webapp").getAbsolutePath();
    WebAppContext context = new WebAppContext(hoopWebAppDir, "/");

    Server server = getJettyServer();
    server.addHandler(context);
    server.start();
  }

  @Test
  @TestDir
  @TestServlet
View Full Code Here

    WebAppContext context = new WebAppContext(stormhome+"/webapp","/higo");
//    context.setContextPath("/higo");
//    context.setWar(warpath);
    server.addHandler(context);
    server.addHandler(root);
    server.start();
    server.join();
  }
}
View Full Code Here

    Context root = new Context(server, "/", Context.SESSIONS);
    root.addServlet(new ServletHolder(new JezebelResmon()), "/resmon");
    root.addServlet(new ServletHolder(new JezebelDispatch()), "/dispatch/*");

    logger.info("Starting server on port " + port);
    try { server.start(); }
    catch (Exception e) { e.printStackTrace(); }
  }
}
View Full Code Here

        Server server1 = new Server(port1);
        WebAppContext context1 = new WebAppContext(warDir.getCanonicalPath(), contextPath);
        context1.setSessionHandler(new SessionHandler());
        context1.addServlet(TestServlet.class, servletMapping);
        server1.setHandler(context1);
        server1.start();
        try
        {
            int port2 = random.nextInt(50000) + 10000;
            Server server2 = new Server(port2);
            WebAppContext context2 = new WebAppContext(warDir.getCanonicalPath(), contextPath);
View Full Code Here

            Server server2 = new Server(port2);
            WebAppContext context2 = new WebAppContext(warDir.getCanonicalPath(), contextPath);
            context2.setSessionHandler(new SessionHandler());
            context2.addServlet(TestServlet.class, servletMapping);
            server2.setHandler(context2);
            server2.start();
            try
            {
                HttpClient client = new HttpClient();
                client.setConnectorType(HttpClient.CONNECTOR_SOCKET);
                client.start();
View Full Code Here

    public static void main(String[] args) {

        Server server = new Server(8080);
        server.addHandler(new WebAppContext("./src/main/webapp", "/ultimate-roundtrip"));
        try {
            server.start();
            Thread.sleep(100000); //Makes sure the server doesn't die
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

        connector.setKeyPassword("keypwd");

        server.setConnectors(new Connector[]
        { connector });
        server.setHandler(new HelloWorldHandler());
        server.start();

        final int numConns=200;
        Socket[] client=new Socket[numConns];

        SSLContext ctx=SSLContext.getInstance("SSLv3");
View Full Code Here

        connector.setPort(8888);
        proxy.addConnector(connector);
        Context context = new Context(proxy,"/",0);
        context.addServlet(new ServletHolder(new AsyncProxyServlet.Transparent("","www.google.com",80)), "/");

        proxy.start();
        proxy.join();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.