james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject [2/6] james-project git commit: JAMES-1772 Start a single thread for jetty
Date Wed, 22 Jun 2016 09:30:09 GMT
JAMES-1772 Start a single thread for jetty


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/a2bb7204
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/a2bb7204
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/a2bb7204

Branch: refs/heads/master
Commit: a2bb72043c9d83a3c75776d52e80f8742a21efd2
Parents: 3bb1777
Author: Matthieu Baechler <matthieu.baechler@linagora.com>
Authored: Wed Jun 8 21:44:27 2016 +0200
Committer: Raphael Ouazana <raphael.ouazana@linagora.com>
Committed: Tue Jun 21 10:36:07 2016 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/james/http/jetty/JettyHttpServer.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/a2bb7204/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java
----------------------------------------------------------------------
diff --git a/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java
b/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java
index 26aecbf..c0a63bc 100644
--- a/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java
+++ b/server/container/jetty/src/main/java/org/apache/james/http/jetty/JettyHttpServer.java
@@ -33,6 +33,7 @@ import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.servlet.FilterHolder;
 import org.eclipse.jetty.servlet.ServletHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.util.thread.QueuedThreadPool;
 
 import com.google.common.base.Throwables;
 import com.google.common.collect.Maps;
@@ -40,6 +41,9 @@ import com.google.common.collect.Multimaps;
 
 public class JettyHttpServer implements Closeable {
     
+    private static final int A_SINGLE_THREAD = 1;
+    private static final int MAX_THREAD = 200;
+
     public static JettyHttpServer create(Configuration configuration) {
         return new JettyHttpServer(configuration);
     }
@@ -50,7 +54,7 @@ public class JettyHttpServer implements Closeable {
 
     private JettyHttpServer(Configuration configuration) {
         this.configuration = configuration;
-        this.server = new Server();
+        this.server = new Server(new QueuedThreadPool(MAX_THREAD, A_SINGLE_THREAD));
         this.server.addConnector(buildServerConnector(configuration));
         this.server.setHandler(buildServletHandler(configuration));
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message