Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 10963 invoked from network); 12 Mar 2006 09:02:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Mar 2006 09:02:39 -0000 Received: (qmail 38910 invoked by uid 500); 12 Mar 2006 09:02:38 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 38865 invoked by uid 500); 12 Mar 2006 09:02:38 -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 38854 invoked by uid 99); 12 Mar 2006 09:02:38 -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:02:38 -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:02:37 -0800 Received: (qmail 10885 invoked by uid 65534); 12 Mar 2006 09:02:17 -0000 Message-ID: <20060312090217.10880.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r385261 - /directory/trunks/mina/core/src/main/java/org/apache/mina/filter/ThreadPoolFilter.java Date: Sun, 12 Mar 2006 09:02:16 -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:02:14 2006 New Revision: 385261 URL: http://svn.apache.org/viewcvs?rev=385261&view=rev Log: * Made ThreadPoolFilter.threadNamePrefix changable in runtime. 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=385261&r1=385260&r2=385261&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 Sun Mar 12 01:02:14 2006 @@ -100,7 +100,7 @@ } } - private final String threadNamePrefix; + private String threadNamePrefix; private final Map buffers = new IdentityHashMap(); private final BlockingQueue unfetchedSessionBuffers = new BlockingQueue(); private final Set allSessionBuffers = new IdentityHashSet(); @@ -132,6 +132,16 @@ */ public ThreadPoolFilter( String threadNamePrefix ) { + setThreadNamePrefix( threadNamePrefix ); + } + + public String getThreadNamePrefix() + { + return threadNamePrefix; + } + + public void setThreadNamePrefix( String threadNamePrefix ) + { if( threadNamePrefix == null ) { throw new NullPointerException( "threadNamePrefix" ); @@ -142,13 +152,16 @@ throw new IllegalArgumentException( "threadNamePrefix is empty." ); } this.threadNamePrefix = threadNamePrefix; + + synchronized( poolSizeLock ) + { + for( Iterator i = allWorkers.iterator(); i.hasNext(); ) + { + ( ( Worker ) i.next() ).updateName(); + } + } } - public String getThreadNamePrefix() - { - return threadNamePrefix; - } - public int getPoolSize() { synchronized( poolSizeLock ) @@ -360,9 +373,14 @@ { int id = acquireThreadId(); this.id = id; - this.setName( threadNamePrefix + '-' + id ); + updateName(); increasePoolSize( this ); setDaemon( true ); + } + + public void updateName() + { + this.setName( threadNamePrefix + '-' + id ); } public boolean lead()