directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject svn commit: r397282 - /directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java
Date Wed, 26 Apr 2006 20:01:29 GMT
Author: proyal
Date: Wed Apr 26 13:01:28 2006
New Revision: 397282

URL: http://svn.apache.org/viewcvs?rev=397282&view=rev
Log:
Add constructor that allows specification of prefix and maximum size

Modified:
    directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java?rev=397282&r1=397281&r2=397282&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java
Wed Apr 26 13:01:28 2006
@@ -18,13 +18,6 @@
  */
 package org.apache.mina.filter;
 
-import java.util.ArrayList;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.IoFilterAdapter;
 import org.apache.mina.common.IoFilterChain;
@@ -36,6 +29,13 @@
 import org.apache.mina.util.Queue;
 import org.apache.mina.util.Stack;
 
+import java.util.ArrayList;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * A Thread-pooling filter.  This filter forwards {@link IoHandler} events
  * to its thread pool.
@@ -56,7 +56,7 @@
  * @author The Apache Directory Project (mina-dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
-public class ThreadPoolFilter extends IoFilterAdapter
+public class ThreadPoolFilter extends IoFilterAdapter implements ThreadPoolFilterMBean
 {
     /**
      * Default maximum size of thread pool (16).
@@ -132,9 +132,21 @@
      */
     public ThreadPoolFilter( String threadNamePrefix )
     {
+        this( threadNamePrefix, DEFAULT_MAXIMUM_POOL_SIZE );
+    }
+
+    /**
+     * Creates a new instance of this filter with the specified thread name prefix
+     * and other default settings.
+     * @param threadNamePrefix the prefix of the thread names this pool will create.
+     * @param maximumPoolSize Maximum size of thread pool
+     */
+    public ThreadPoolFilter( String threadNamePrefix, int maximumPoolSize )
+    {
         setThreadNamePrefix( threadNamePrefix );
+        setMaximumPoolSize( maximumPoolSize );
     }
-    
+
     public String getThreadNamePrefix()
     {
         return threadNamePrefix;



Mime
View raw message