avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/thread/impl DefaultThreadPool.java WorkerThread.java
Date Sun, 20 Jan 2002 04:38:14 GMT
donaldp     02/01/19 20:38:14

  Modified:    src/scratchpad/org/apache/avalon/excalibur/thread/impl
                        DefaultThreadPool.java WorkerThread.java
  Log:
  Made ThreadPool more flexible by allowing laternative pool implementations.
  
  Submitted By: Leif Mortenson <leif@silveregg.co.jp>
  
  Revision  Changes    Path
  1.10      +12 -5     jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/thread/impl/DefaultThreadPool.java
  
  Index: DefaultThreadPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/thread/impl/DefaultThreadPool.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultThreadPool.java	3 Jan 2002 07:57:46 -0000	1.9
  +++ DefaultThreadPool.java	20 Jan 2002 04:38:14 -0000	1.10
  @@ -11,13 +11,14 @@
   import org.apache.avalon.excalibur.pool.ObjectFactory;
   import org.apache.avalon.excalibur.pool.Poolable;
   import org.apache.avalon.excalibur.pool.SoftResourceLimitingPool;
  -import org.apache.avalon.excalibur.thread.ThreadPool;
   import org.apache.avalon.excalibur.thread.ThreadControl;
  +import org.apache.avalon.excalibur.thread.ThreadPool;
   import org.apache.avalon.framework.activity.Executable;
  -import org.apache.avalon.framework.logger.Loggable;
  +import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.logger.LogEnabled;
  -import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.LogKitLogger;
  +import org.apache.avalon.framework.logger.Loggable;
  +import org.apache.avalon.framework.logger.Logger;
   
   /**
    * This class is the public frontend for the thread pool code.
  @@ -29,9 +30,9 @@
    */
   public class DefaultThreadPool
       extends ThreadGroup
  -    implements ObjectFactory, Loggable, LogEnabled, ThreadPool
  +    implements ObjectFactory, Loggable, LogEnabled, Disposable, ThreadPool
   {
  -    private final SoftResourceLimitingPool  m_pool;
  +    private SoftResourceLimitingPool        m_pool;
       private int                             m_level;
       private Logger                          m_logger;
       private ThreadContext                   m_context;
  @@ -67,6 +68,12 @@
       {
           m_logger = logger;
           m_pool.enableLogging( m_logger );
  +    }
  +
  +    public void dispose()
  +    {
  +        m_pool.dispose();
  +        m_pool = null;
       }
   
       public Object newInstance()
  
  
  
  1.6       +3 -3      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/thread/impl/WorkerThread.java
  
  Index: WorkerThread.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/thread/impl/WorkerThread.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WorkerThread.java	28 Dec 2001 15:42:11 -0000	1.5
  +++ WorkerThread.java	20 Jan 2002 04:38:14 -0000	1.6
  @@ -9,7 +9,7 @@
   
   import org.apache.avalon.excalibur.lang.ThreadContext;
   import org.apache.avalon.excalibur.pool.Poolable;
  -import org.apache.avalon.excalibur.pool.SoftResourceLimitingPool;
  +import org.apache.avalon.excalibur.pool.Pool;
   import org.apache.avalon.excalibur.thread.ThreadControl;
   import org.apache.avalon.framework.activity.Executable;
   import org.apache.avalon.framework.logger.LogEnabled;
  @@ -27,7 +27,7 @@
       implements Poolable, LogEnabled
   {
       private Logger                    m_logger;
  -    private SoftResourceLimitingPool  m_pool;
  +    private Pool                      m_pool;
   
       private Executable                m_work;
       private DefaultThreadControl      m_threadControl;
  @@ -39,7 +39,7 @@
        */
       protected WorkerThread( final ThreadGroup group,
                               final String name,
  -                            final SoftResourceLimitingPool pool,
  +                            final Pool pool,
                               final ThreadContext context )
       {
           super( group, name );
  
  
  

--
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