Search in sources :

Example 1 with Openscoring

use of org.openscoring.service.Openscoring in project openscoring by openscoring.

the class Main method createServer.

private Server createServer(InetSocketAddress address) {
    Server server = new Server(address);
    Openscoring application = new Openscoring();
    ServletContainer jerseyServlet = new ServletContainer(application);
    ServletContextHandler servletHandler = new ServletContextHandler();
    servletHandler.setContextPath(this.contextPath);
    servletHandler.addServlet(new ServletHolder(jerseyServlet), "/*");
    ContextHandlerCollection handlerCollection = new ContextHandlerCollection();
    handlerCollection.addHandler(servletHandler);
    if (this.consoleWar != null) {
        WebAppContext consoleHandler = new WebAppContext();
        // XXX
        consoleHandler.setContextPath(this.contextPath + "/console");
        consoleHandler.setWar(this.consoleWar.getAbsolutePath());
        handlerCollection.addHandler(consoleHandler);
    }
    server.setHandler(handlerCollection);
    return server;
}
Also used : WebAppContext(org.eclipse.jetty.webapp.WebAppContext) Server(org.eclipse.jetty.server.Server) Openscoring(org.openscoring.service.Openscoring) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) ServletContainer(org.glassfish.jersey.servlet.ServletContainer) ContextHandlerCollection(org.eclipse.jetty.server.handler.ContextHandlerCollection) ServletContextHandler(org.eclipse.jetty.servlet.ServletContextHandler)

Aggregations

Server (org.eclipse.jetty.server.Server)1 ContextHandlerCollection (org.eclipse.jetty.server.handler.ContextHandlerCollection)1 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)1 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)1 WebAppContext (org.eclipse.jetty.webapp.WebAppContext)1 ServletContainer (org.glassfish.jersey.servlet.ServletContainer)1 Openscoring (org.openscoring.service.Openscoring)1