Search in sources :

Example 16 with WebAppContext

use of org.mortbay.jetty.webapp.WebAppContext in project nhin-d by DirectProject.

the class ConfigServiceRunner method startConfigService.

public static synchronized void startConfigService() throws Exception {
    if (server == null) {
        /*
			 * Setup the configuration service server
			 */
        server = new Server();
        SocketConnector connector = new SocketConnector();
        HTTPPort = AvailablePortFinder.getNextAvailable(1024);
        connector.setPort(HTTPPort);
        WebAppContext context = new WebAppContext("src/test/resources/webapp", "/");
        server.setSendServerVersion(false);
        server.addConnector(connector);
        server.addHandler(context);
        server.start();
        configServiceURL = "http://localhost:" + HTTPPort + "/ConfigurationService";
        restAPIBaseURL = "http://localhost:" + HTTPPort + "/api";
    }
}
Also used : WebAppContext(org.mortbay.jetty.webapp.WebAppContext) Server(org.mortbay.jetty.Server) SocketConnector(org.mortbay.jetty.bio.SocketConnector)

Example 17 with WebAppContext

use of org.mortbay.jetty.webapp.WebAppContext in project nhin-d by DirectProject.

the class ConfigServiceRunner method startConfigService.

public static synchronized void startConfigService() throws Exception {
    if (server == null) {
        /*
			 * Setup the configuration service server
			 */
        server = new Server();
        SocketConnector connector = new SocketConnector();
        HTTPPort = AvailablePortFinder.getNextAvailable(1024);
        connector.setPort(HTTPPort);
        WebAppContext context = new WebAppContext("src/test/resources/webapp", "/");
        server.setSendServerVersion(false);
        server.addConnector(connector);
        server.addHandler(context);
        server.start();
        txsServiceURL = "http://localhost:" + HTTPPort + "/";
    }
}
Also used : WebAppContext(org.mortbay.jetty.webapp.WebAppContext) Server(org.mortbay.jetty.Server) SocketConnector(org.mortbay.jetty.bio.SocketConnector)

Aggregations

WebAppContext (org.mortbay.jetty.webapp.WebAppContext)17 Server (org.mortbay.jetty.Server)14 SocketConnector (org.mortbay.jetty.bio.SocketConnector)11 Connector (org.mortbay.jetty.Connector)5 SelectChannelConnector (org.mortbay.jetty.nio.SelectChannelConnector)4 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)2 MojoFailureException (org.apache.maven.plugin.MojoFailureException)2 Handler (org.mortbay.jetty.Handler)2 DefaultHandler (org.mortbay.jetty.handler.DefaultHandler)2 SecurityHandler (org.mortbay.jetty.security.SecurityHandler)2 WebXmlConfiguration (org.mortbay.jetty.webapp.WebXmlConfiguration)2 ThreadPoolExecutorAdapter (com.google.util.threads.ThreadPoolExecutorAdapter)1 FileOutputStream (java.io.FileOutputStream)1 InputStream (java.io.InputStream)1 BindException (java.net.BindException)1 URL (java.net.URL)1 HashMap (java.util.HashMap)1