use of org.eclipse.jetty.server.Server in project jetty.project by eclipse.
the class AbstractConnectHandlerTest method prepareProxy.
protected void prepareProxy() throws Exception {
proxy = new Server();
proxyConnector = new ServerConnector(proxy);
proxy.addConnector(proxyConnector);
connectHandler = new ConnectHandler();
proxy.setHandler(connectHandler);
proxy.start();
}
use of org.eclipse.jetty.server.Server in project jetty.project by eclipse.
the class BalancerServletTest method createServer.
private Server createServer(ServletHolder servletHolder, String nodeName) {
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
server.addConnector(connector);
ServletContextHandler context = new ServletContextHandler(server, CONTEXT_PATH, ServletContextHandler.SESSIONS);
context.addServlet(servletHolder, SERVLET_PATH + "/*");
if (nodeName != null) {
DefaultSessionIdManager sessionIdManager = new DefaultSessionIdManager(server);
sessionIdManager.setWorkerName(nodeName);
server.setSessionIdManager(sessionIdManager);
}
return server;
}
use of org.eclipse.jetty.server.Server in project jetty.project by eclipse.
the class ConnectHandlerTest method prepare.
@Before
public void prepare() throws Exception {
server = new Server();
serverConnector = new ServerConnector(server);
server.addConnector(serverConnector);
server.setHandler(new ServerHandler());
server.start();
prepareProxy();
}
use of org.eclipse.jetty.server.Server in project jetty.project by eclipse.
the class ProxyServletTest method startServer.
private void startServer(HttpServlet servlet) throws Exception {
QueuedThreadPool serverPool = new QueuedThreadPool();
serverPool.setName("server");
server = new Server(serverPool);
serverConnector = new ServerConnector(server);
server.addConnector(serverConnector);
ServletContextHandler appCtx = new ServletContextHandler(server, "/", true, false);
ServletHolder appServletHolder = new ServletHolder(servlet);
appCtx.addServlet(appServletHolder, "/*");
server.start();
}
use of org.eclipse.jetty.server.Server in project jetty.project by eclipse.
the class ReverseProxyTest method startServer.
private void startServer(HttpServlet servlet) throws Exception {
server = new Server();
serverConnector = new ServerConnector(server);
server.addConnector(serverConnector);
ServletContextHandler appCtx = new ServletContextHandler(server, "/", true, false);
ServletHolder appServletHolder = new ServletHolder(servlet);
appCtx.addServlet(appServletHolder, "/*");
server.start();
}
Aggregations