You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ga...@apache.org on 2015/08/21 08:22:26 UTC

stratos git commit: Update executor service with blocking queue

Repository: stratos
Updated Branches:
  refs/heads/tenant-isolation a776ca196 -> 861d6ac17


Update executor service with blocking queue


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/861d6ac1
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/861d6ac1
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/861d6ac1

Branch: refs/heads/tenant-isolation
Commit: 861d6ac17a23e86934d969b1794ab4b200aeefa8
Parents: a776ca1
Author: gayangunarathne <ga...@wso2.com>
Authored: Fri Aug 21 11:52:06 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Fri Aug 21 11:52:06 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/common/threading/StratosThreadPool.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/861d6ac1/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
index 45da339..fc709c7 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/threading/StratosThreadPool.java
@@ -32,6 +32,7 @@ import java.util.concurrent.*;
 public class StratosThreadPool {
 
     private static final Log log = LogFactory.getLog(StratosThreadPool.class);
+    private static final int MAXIMUM_POOL_SIZE = 1000;
 
     private static Map<String, ExecutorService> executorServiceMap = new ConcurrentHashMap<String, ExecutorService>();
     private static Map<String, ScheduledExecutorService> scheduledServiceMap = new ConcurrentHashMap<String, ScheduledExecutorService>();
@@ -51,9 +52,9 @@ public class StratosThreadPool {
             synchronized (executorServiceMapLock) {
                 if (executorService == null) {
                     final BlockingQueue<Runnable> queue = new ArrayBlockingQueue(threadPoolSize);
-                    ThreadPoolExecutor threadPool=new ThreadPoolExecutor(threadPoolSize, 1000,
+                    ThreadPoolExecutor threadPool=new ThreadPoolExecutor(threadPoolSize, MAXIMUM_POOL_SIZE,
                             0L, TimeUnit.MILLISECONDS,
-                            queue);// Executors.newFixedThreadPool(threadPoolSize);
+                            queue);
                     threadPool.setRejectedExecutionHandler(new RejectedExecutionHandler() {
                         public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
                             try {