use of org.eclipse.jetty.server.handler.HandlerCollection in project cxf by apache.
the class AegisServer method run.
protected void run() {
// System.out.println("Starting Server");
server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
WebAppContext webappcontext = new WebAppContext();
String contextPath = null;
try {
contextPath = getClass().getResource("/webapp").toURI().getPath();
} catch (URISyntaxException e1) {
e1.printStackTrace();
}
webappcontext.setContextPath("/");
webappcontext.setWar(contextPath);
HandlerCollection handlers = new HandlerCollection();
handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
server.setHandler(handlers);
try {
server.start();
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.eclipse.jetty.server.handler.HandlerCollection in project cxf by apache.
the class AbstractSpringServer method run.
protected void run() {
server = new org.eclipse.jetty.server.Server(port);
WebAppContext webappcontext = new WebAppContext();
webappcontext.setContextPath(contextPath);
String warPath = null;
try {
warPath = getClass().getResource(resourcePath).toURI().getPath();
} catch (URISyntaxException e1) {
e1.printStackTrace();
}
webappcontext.setWar(warPath);
HandlerCollection handlers = new HandlerCollection();
handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
server.setHandler(handlers);
try {
configureServer(server);
server.start();
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.eclipse.jetty.server.handler.HandlerCollection in project cxf by apache.
the class AtomBookServer method run.
protected void run() {
server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
WebAppContext webappcontext = new WebAppContext();
String contextPath = null;
try {
contextPath = getClass().getResource("/jaxrs_atom").toURI().getPath();
} catch (URISyntaxException e1) {
e1.printStackTrace();
}
webappcontext.setContextPath("/");
webappcontext.setWar(contextPath);
HandlerCollection handlers = new HandlerCollection();
handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
server.setHandler(handlers);
try {
server.start();
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.eclipse.jetty.server.handler.HandlerCollection in project cxf by apache.
the class NioBookStoreServer method run.
protected void run() {
server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
WebAppContext webappcontext = new WebAppContext();
String contextPath = null;
try {
contextPath = getClass().getResource("/jaxrs_nio").toURI().getPath();
} catch (URISyntaxException e1) {
e1.printStackTrace();
}
webappcontext.setContextPath("/");
webappcontext.setWar(contextPath);
HandlerCollection handlers = new HandlerCollection();
handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
server.setHandler(handlers);
try {
server.start();
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.eclipse.jetty.server.handler.HandlerCollection in project cxf by apache.
the class ResolverTest method startServer.
@Test
public void startServer() throws Throwable {
Server server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
WebAppContext webappcontext = new WebAppContext();
webappcontext.setContextPath("/resolver");
URL res = getClass().getResource("/resolver");
String warPath = res.toURI().getPath();
webappcontext.setWar(warPath);
HandlerCollection handlers = new HandlerCollection();
handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
server.setHandler(handlers);
server.start();
Throwable e = webappcontext.getUnavailableException();
if (e != null) {
throw e;
}
server.stop();
}
Aggregations