diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java index 2e491cfe4dd..2f752ff8180 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpClientTransportOverHTTP.java @@ -27,7 +27,7 @@ public class HttpClientTransportOverHTTP extends AbstractHttpClientTransport { public HttpClientTransportOverHTTP() { - this(1); + this(Runtime.getRuntime().availableProcessors()); } public HttpClientTransportOverHTTP(int selectors) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java index 6c64f6dc9b8..97195afe488 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java @@ -424,7 +424,7 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa String name = _thread.getName(); try { - _thread.setName(name + "-selector-" + _id); + _thread.setName(name + "-selector-" + SelectorManager.this.getClass().getSimpleName()+"@"+Integer.toHexString(SelectorManager.this.hashCode())+"/"+_id); LOG.debug("Starting {} on {}", _thread, this); while (isRunning()) select(); diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ConnectHandler.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ConnectHandler.java index 2e0760f4bd5..b1b6b3b76fe 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ConnectHandler.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ConnectHandler.java @@ -177,7 +177,7 @@ public class ConnectHandler extends HandlerWrapper protected SelectorManager newSelectorManager() { - return new Manager(getExecutor(), getScheduler(), 1); + return new ConnectManager(getExecutor(), getScheduler(), 1); } @Override @@ -429,10 +429,10 @@ public class ConnectHandler extends HandlerWrapper dump(out, indent, getBeans(), TypeUtil.asList(getHandlers())); } - protected class Manager extends SelectorManager + protected class ConnectManager extends SelectorManager { - private Manager(Executor executor, Scheduler scheduler, int selectors) + private ConnectManager(Executor executor, Scheduler scheduler, int selectors) { super(executor, scheduler, selectors); } diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java index a283b0d6406..3c6ab64263e 100644 --- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java +++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java @@ -28,8 +28,10 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Locale; import java.util.Set; +import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; + import javax.servlet.AsyncContext; import javax.servlet.ServletConfig; import javax.servlet.ServletException; @@ -47,7 +49,6 @@ import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpVersion; -import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.HttpCookieStore; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -206,7 +207,8 @@ public class ProxyServlet extends HttpServlet *
* The maximum size of a form that can be processed by this context is controlled by the system properties org.eclipse.jetty.server.Request.maxFormKeys * and org.eclipse.jetty.server.Request.maxFormContentSize. These can also be configured with {@link #setMaxFormContentSize(int)} and {@link #setMaxFormKeys(int)} + *
+ * This servers executore is made available via a context attributed "org.eclipse.jetty.server.Executor". * * @org.apache.xbean.XBean description="Creates a basic HTTP context" */ @@ -719,6 +721,8 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu Thread current_thread = null; Context old_context = null; + _attributes.setAttribute("org.eclipse.jetty.server.Executor",getServer().getThreadPool()); + try { // Set the classloader