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;
}
Aggregations