use of org.eclipse.jetty.util.thread.QueuedThreadPool in project jetty.project by eclipse.
the class ProxyServletTest method startProxy.
private void startProxy(Map<String, String> initParams) throws Exception {
QueuedThreadPool proxyPool = new QueuedThreadPool();
proxyPool.setName("proxy");
proxy = new Server(proxyPool);
HttpConfiguration configuration = new HttpConfiguration();
configuration.setSendDateHeader(false);
configuration.setSendServerVersion(false);
String value = initParams.get("outputBufferSize");
if (value != null)
configuration.setOutputBufferSize(Integer.valueOf(value));
proxyConnector = new ServerConnector(proxy, new HttpConnectionFactory(configuration));
proxy.addConnector(proxyConnector);
proxyContext = new ServletContextHandler(proxy, "/", true, false);
ServletHolder proxyServletHolder = new ServletHolder(proxyServlet);
proxyServletHolder.setInitParameters(initParams);
proxyContext.addServlet(proxyServletHolder, "/*");
proxy.start();
}
use of org.eclipse.jetty.util.thread.QueuedThreadPool in project jetty.project by eclipse.
the class ProxyServletTest method prepareClient.
private HttpClient prepareClient() throws Exception {
QueuedThreadPool clientPool = new QueuedThreadPool();
clientPool.setName("client");
HttpClient result = new HttpClient();
result.setExecutor(clientPool);
result.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", proxyConnector.getLocalPort()));
result.start();
return result;
}
use of org.eclipse.jetty.util.thread.QueuedThreadPool in project jetty.project by eclipse.
the class ForwardProxyServerTest method startServer.
protected void startServer(ConnectionFactory connectionFactory) throws Exception {
QueuedThreadPool serverThreads = new QueuedThreadPool();
serverThreads.setName("server");
server = new Server(serverThreads);
serverConnector = new ServerConnector(server, serverSslContextFactory, connectionFactory);
server.addConnector(serverConnector);
server.start();
}
use of org.eclipse.jetty.util.thread.QueuedThreadPool in project jetty.project by eclipse.
the class ForwardProxyTLSServerTest method startTLSServer.
protected void startTLSServer(Handler handler) throws Exception {
QueuedThreadPool serverThreads = new QueuedThreadPool();
serverThreads.setName("server");
server = new Server(serverThreads);
serverConnector = new ServerConnector(server, newSslContextFactory());
server.addConnector(serverConnector);
server.setHandler(handler);
server.start();
}
use of org.eclipse.jetty.util.thread.QueuedThreadPool in project jetty.project by eclipse.
the class ProxyServletFailureTest method prepareProxy.
private void prepareProxy(Map<String, String> initParams) throws Exception {
QueuedThreadPool executor = new QueuedThreadPool();
executor.setName("proxy");
proxy = new Server(executor);
proxyConnector = new ServerConnector(proxy);
proxy.addConnector(proxyConnector);
proxyConnector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration().setDelayDispatchUntilContent(false);
ServletContextHandler proxyCtx = new ServletContextHandler(proxy, "/", true, false);
ServletHolder proxyServletHolder = new ServletHolder(proxyServlet);
proxyServletHolder.setInitParameters(initParams);
proxyCtx.addServlet(proxyServletHolder, "/*");
proxy.start();
client = prepareClient();
}
Aggregations