avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/command AbstractThreadManager.java TPCThreadManager.java
Date Wed, 17 Jul 2002 20:53:44 GMT
proyal      2002/07/17 13:53:44

  Modified:    event/src/java/org/apache/excalibur/event/command
                        AbstractThreadManager.java TPCThreadManager.java
  Log:
  AbstractThreadManager should not be responsible for disposal of ThreadPool
  
  Revision  Changes    Path
  1.2       +1 -6      jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/command/AbstractThreadManager.java
  
  Index: AbstractThreadManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/command/AbstractThreadManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractThreadManager.java	16 Jul 2002 21:02:10 -0000	1.1
  +++ AbstractThreadManager.java	17 Jul 2002 20:53:44 -0000	1.2
  @@ -174,14 +174,9 @@
           }
       }
   
  -    public final void dispose()
  +    public void dispose()
       {
           deregisterAll();
  -
  -        if( m_threadPool instanceof Disposable )
  -        {
  -            ( ( Disposable ) m_threadPool ).dispose();
  -        }
   
           m_threadControl = null;
       }
  
  
  
  1.22      +16 -9     jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/command/TPCThreadManager.java
  
  Index: TPCThreadManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/event/src/java/org/apache/excalibur/event/command/TPCThreadManager.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- TPCThreadManager.java	16 Jul 2002 21:02:10 -0000	1.21
  +++ TPCThreadManager.java	17 Jul 2002 20:53:44 -0000	1.22
  @@ -35,6 +35,7 @@
    */
   public final class TPCThreadManager extends AbstractThreadManager implements Parameterizable
   {
  +    private ResourceLimitingThreadPool m_tpool;
       private long m_blockTimeout = 1000L;
       private int m_processors = SystemUtil.numProcessors();
       private int m_threadsPerProcessor = 1;
  @@ -88,23 +89,29 @@
               throw new IllegalStateException( "ThreadManager is already initailized" );
           }
   
  -        final ResourceLimitingThreadPool tpool =
  -          new ResourceLimitingThreadPool( "TPCThreadManager",
  -                                          ( m_processors * m_threadsPerProcessor ) + 1,
  -                                          true,
  -                                          true,
  -                                          this.m_blockTimeout,
  -                                          10L * 1000L );
  +        m_tpool = new ResourceLimitingThreadPool( "TPCThreadManager",
  +                                                  ( m_processors * m_threadsPerProcessor
) + 1,
  +                                                  true,
  +                                                  true,
  +                                                  this.m_blockTimeout,
  +                                                  10L * 1000L );
   
           if( null == getLogger() )
           {
               this.enableLogging( new NullLogger() );
           }
   
  -        tpool.enableLogging( getLogger() );
  +        m_tpool.enableLogging( getLogger() );
   
  -        setThreadPool( tpool );
  +        setThreadPool( m_tpool );
   
           super.initialize();
  +    }
  +
  +    public final void dispose()
  +    {
  +        super.dispose();
  +
  +        m_tpool.dispose();
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message