bloritsch    2003/06/12 13:04:26

  Modified:    event/src/java/org/apache/excalibur/event/command
                        TPSPThreadManager.java
  Log:
  Update the docs
  
  Revision  Changes    Path
  1.30      +37 -1     
avalon-excalibur/event/src/java/org/apache/excalibur/event/command/TPSPThreadManager.java
  
  Index: TPSPThreadManager.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-excalibur/event/src/java/org/apache/excalibur/event/command/TPSPThreadManager.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- TPSPThreadManager.java    12 Jun 2003 19:55:09 -0000      1.29
  +++ TPSPThreadManager.java    12 Jun 2003 20:04:26 -0000      1.30
  @@ -62,7 +62,7 @@
   /**
    * This is a <code>ThreadManager</code> which provides a threadpool per
    * <code>Sink</code> per <code>EventPipeline</code>. ::NOTE:: This is not
  - * implemented yet!
  + * tested yet!
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
    */
  @@ -169,12 +169,21 @@
           }
       }
   
  +    /**
  +     * The SourceRunner is used to dequeue events one at a time.
  +     */
       protected static final class SourceRunner implements Runnable
       {
           private final Source m_source;
           private final EventHandler m_handler;
           private volatile boolean m_keepProcessing;
   
  +        /**
  +         * Create a new SourceRunner.
  +         *
  +         * @param source   The source to pull events from.
  +         * @param handler  The handler to send events to.
  +         */
           protected SourceRunner( final Source source, final EventHandler handler )
           {
               if ( source == null ) throw new NullPointerException("source");
  @@ -184,6 +193,9 @@
               m_keepProcessing = true;
           }
   
  +        /**
  +         * Called by the PooledExecutor to ensure all components are working.
  +         */
           public void run()
           {
               while (m_keepProcessing)
  @@ -214,17 +226,28 @@
               }
           }
   
  +        /**
  +         * Stop the runner nicely.
  +         */
           public void stop()
           {
               m_keepProcessing = false;
           }
   
  +        /**
  +         * Get a reference to the Source.
  +         *
  +         * @return the <code>Source</code>
  +         */
           public Source getSource()
           {
               return m_source;
           }
       }
   
  +    /**
  +     * This is used to plug into Queues so that we can intercept calls to the 
dequeue operation.
  +     */
       protected static final class SourceDequeueInterceptor implements 
DequeueInterceptor
       {
           private final Source m_source;
  @@ -236,6 +259,16 @@
           private final EventHandler m_handler;
           private final SourceRunner m_initRunner;
   
  +        /**
  +         * Create a new SourceDequeueInterceptor.  The parameters are used to 
ensure a working
  +         * environment.
  +         *
  +         * @param runner      The initial SourceRunner.
  +         * @param handler     The EventHandler to send events to.
  +         * @param threadPool  The PooledExecutor for the set of threads.
  +         * @param threshold   The threshold of events before a new thread is 
executed.
  +         * @param margin      The margin of error allowed for the events.
  +         */
           public SourceDequeueInterceptor( SourceRunner runner, EventHandler handler, 
PooledExecutor threadPool, int threshold, int margin )
           {
               if (runner == null) throw new NullPointerException("runner");
  @@ -332,6 +365,9 @@
               }
           }
   
  +        /**
  +         * Ensure all event runners are stopped for this partial pipeline.
  +         */
           public void stop()
           {
               Iterator it = m_runners.iterator();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to