Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 20708 invoked from network); 12 Mar 2006 09:44:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Mar 2006 09:44:41 -0000 Received: (qmail 51359 invoked by uid 500); 12 Mar 2006 09:44:40 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 51316 invoked by uid 500); 12 Mar 2006 09:44:40 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 51303 invoked by uid 99); 12 Mar 2006 09:44:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Mar 2006 01:44:40 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 12 Mar 2006 01:44:39 -0800 Received: (qmail 20614 invoked by uid 65534); 12 Mar 2006 09:44:19 -0000 Message-ID: <20060312094419.20613.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r385269 - /directory/trunks/mina/core/src/main/java/org/apache/mina/common/PooledThreadModel.java Date: Sun, 12 Mar 2006 09:44:19 -0000 To: commits@directory.apache.org From: trustin@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: trustin Date: Sun Mar 12 01:44:17 2006 New Revision: 385269 URL: http://svn.apache.org/viewcvs?rev=385269&view=rev Log: Fixed a problem that a thread pool is shared among different services Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/PooledThreadModel.java Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/PooledThreadModel.java URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/common/PooledThreadModel.java?rev=385269&r1=385268&r2=385269&view=diff ============================================================================== --- directory/trunks/mina/core/src/main/java/org/apache/mina/common/PooledThreadModel.java (original) +++ directory/trunks/mina/core/src/main/java/org/apache/mina/common/PooledThreadModel.java Sun Mar 12 01:44:17 2006 @@ -15,9 +15,10 @@ public static final int DEFAULT_KEEP_ALIVE_TIME = ThreadPoolFilter.DEFAULT_KEEP_ALIVE_TIME; private static int id = 1; + private String threadNamePrefix; + private int keepAliveTime; + private int maximumPoolSize; - private final ThreadPoolFilter filter; - public PooledThreadModel() { this( "AnonymousIoService-" + id++, DEFAULT_MAXIMUM_POOL_SIZE ); @@ -30,48 +31,45 @@ public PooledThreadModel( String threadNamePrefix, int maxThreads ) { - filter = new ThreadPoolFilter(); setMaximumPoolSize( maxThreads ); setThreadNamePrefix( threadNamePrefix ); } public String getThreadNamePrefix() { - return filter.getThreadNamePrefix(); + return threadNamePrefix; } public void setThreadNamePrefix( String threadNamePrefix ) { - filter.setThreadNamePrefix( threadNamePrefix ); + this.threadNamePrefix = threadNamePrefix; } - public int getPoolSize() - { - return filter.getPoolSize(); - } - public int getMaximumPoolSize() { - return filter.getMaximumPoolSize(); + return maximumPoolSize; } public int getKeepAliveTime() { - return filter.getKeepAliveTime(); + return keepAliveTime; } public void setMaximumPoolSize( int maximumPoolSize ) { - filter.setMaximumPoolSize( maximumPoolSize ); + this.maximumPoolSize = maximumPoolSize; } public void setKeepAliveTime( int keepAliveTime ) { - filter.setKeepAliveTime( keepAliveTime ); + this.keepAliveTime = keepAliveTime; } public void buildFilterChain( IoFilterChain chain ) throws Exception { + ThreadPoolFilter filter = new ThreadPoolFilter( threadNamePrefix ); + filter.setKeepAliveTime( keepAliveTime ); + filter.setMaximumPoolSize( maximumPoolSize ); chain.addFirst( PooledThreadModel.class.getName(), filter ); } }