geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hogst...@apache.org
Subject svn commit: r475886 - /geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java
Date Thu, 16 Nov 2006 19:24:36 GMT
Author: hogstrom
Date: Thu Nov 16 11:24:35 2006
New Revision: 475886

URL: http://svn.apache.org/viewvc?view=rev&rev=475886
Log:
GERONIMO-585 Issue warning message when attempt to execute work on a full queue

Modified:
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java?view=diff&rev=475886&r1=475885&r2=475886
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/work/pool/WorkExecutorPoolImpl.java
Thu Nov 16 11:24:35 2006
@@ -22,6 +22,9 @@
 import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
 import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 /**
  * Based class for WorkExecutorPool. Sub-classes define the synchronization
  * policy (should the call block until the end of the work; or when it starts
@@ -35,6 +38,7 @@
      * A timed out pooled executor.
      */
     private ThreadPoolExecutor pooledExecutor;
+    private static Log log = LogFactory.getLog(WorkExecutorPoolImpl.class);
 
     /**
      * Creates a pool with the specified minimum and maximum sizes. The Channel
@@ -58,6 +62,10 @@
      * @param work Work to be executed.
      */
     public void execute(Runnable work) {
+        if(pooledExecutor.getPoolSize() == pooledExecutor.getMaximumPoolSize()) {
+            log.warn("Maximum Pool size has been exceeded.  Current Pool Size = "+pooledExecutor.getMaximumPoolSize());
+        }
+
         pooledExecutor.execute(work);
     }
 



Mime
View raw message