You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2002/02/04 19:21:50 UTC

cvs commit: jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/test AbstractQueueTestCase.java

bloritsch    02/02/04 10:21:50

  Modified:    src/scratchpad/org/apache/avalon/excalibur/command
                        CommandManager.java EventPipeline.java
                        TPCThreadManager.java TPSPThreadManager.java
               src/scratchpad/org/apache/avalon/excalibur/event
                        DefaultQueue.java FixedSizeQueue.java
               src/scratchpad/org/apache/avalon/excalibur/event/test
                        AbstractQueueTestCase.java
  Log:
  finish Source to Sink migration
  
  Revision  Changes    Path
  1.4       +4 -4      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/command/CommandManager.java
  
  Index: CommandManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/command/CommandManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CommandManager.java	28 Jan 2002 19:29:47 -0000	1.3
  +++ CommandManager.java	4 Feb 2002 18:21:49 -0000	1.4
  @@ -15,7 +15,7 @@
   import org.apache.avalon.excalibur.event.Queue;
   import org.apache.avalon.excalibur.event.QueueElement;
   import org.apache.avalon.excalibur.event.Signal;
  -import org.apache.avalon.excalibur.event.Sink;
  +import org.apache.avalon.excalibur.event.Source;
   
   import java.util.ArrayList;
   import java.util.Collections;
  @@ -38,7 +38,7 @@
       private final Mutex        m_mutex          = new Mutex();
       private final EventHandler m_eventHandler   = new CommandEventHandler(
               Collections.unmodifiableMap( m_signalHandlers ) );
  -    private final Sink[]       m_sinks          = new Sink[] { m_queue };
  +    private final Source[]     m_sources        = new Source[] { m_queue };
   
       public CommandManager()
       {
  @@ -108,9 +108,9 @@
           }
       }
   
  -    public final Sink[] getSinks()
  +    public final Source[] getSources()
       {
  -        return m_sinks;
  +        return m_sources;
       }
   
       public final EventHandler getEventHandler()
  
  
  
  1.2       +3 -3      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/command/EventPipeline.java
  
  Index: EventPipeline.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/command/EventPipeline.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EventPipeline.java	28 Jan 2002 18:42:25 -0000	1.1
  +++ EventPipeline.java	4 Feb 2002 18:21:49 -0000	1.2
  @@ -7,7 +7,7 @@
    */
   package org.apache.avalon.excalibur.command;
   
  -import org.apache.avalon.excalibur.event.Sink;
  +import org.apache.avalon.excalibur.event.Source;
   import org.apache.avalon.excalibur.event.EventHandler;
   
   /**
  @@ -20,10 +20,10 @@
   public interface EventPipeline
   {
       /**
  -     * There can be many different sinks to merge into a pipeline.  For the
  +     * There can be many different sources to merge into a pipeline.  For the
        * CommandManager, there is only one sink.
        */
  -    Sink[] getSinks();
  +    Source[] getSources();
   
       /**
        * Returns the reference to the EventHandler that the events from all the
  
  
  
  1.3       +4 -4      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/command/TPCThreadManager.java
  
  Index: TPCThreadManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/command/TPCThreadManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TPCThreadManager.java	28 Jan 2002 19:29:47 -0000	1.2
  +++ TPCThreadManager.java	4 Feb 2002 18:21:49 -0000	1.3
  @@ -12,7 +12,7 @@
   import org.apache.avalon.excalibur.thread.*;
   import org.apache.avalon.excalibur.thread.impl.ResourceLimitingThreadPool;
   
  -import org.apache.avalon.excalibur.event.Sink;
  +import org.apache.avalon.excalibur.event.Source;
   import org.apache.avalon.excalibur.event.EventHandler;
   
   import java.util.HashSet;
  @@ -212,12 +212,12 @@
   
           public void run()
           {
  -            Sink[] sinks = m_pipeline.getSinks();
  +            Source[] sources = m_pipeline.getSources();
               EventHandler handler = m_pipeline.getEventHandler();
   
  -            for (int i = 0; i < sinks.length; i++)
  +            for (int i = 0; i < sources.length; i++)
               {
  -                handler.handleEvents( sinks[i].dequeueAll() );
  +                handler.handleEvents( sources[i].dequeueAll() );
               }
           }
       }
  
  
  
  1.4       +4 -4      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/command/TPSPThreadManager.java
  
  Index: TPSPThreadManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/command/TPSPThreadManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TPSPThreadManager.java	28 Jan 2002 19:29:47 -0000	1.3
  +++ TPSPThreadManager.java	4 Feb 2002 18:21:49 -0000	1.4
  @@ -12,7 +12,7 @@
   import org.apache.avalon.excalibur.thread.*;
   import org.apache.avalon.excalibur.thread.impl.ResourceLimitingThreadPool;
   
  -import org.apache.avalon.excalibur.event.Sink;
  +import org.apache.avalon.excalibur.event.Source;
   import org.apache.avalon.excalibur.event.EventHandler;
   
   import java.util.HashSet;
  @@ -184,12 +184,12 @@
   
           public void run()
           {
  -            Sink[] sinks = m_pipeline.getSinks();
  +            Source[] sources = m_pipeline.getSources();
               EventHandler handler = m_pipeline.getEventHandler();
   
  -            for (int i = 0; i < sinks.length; i++)
  +            for (int i = 0; i < sources.length; i++)
               {
  -                handler.handleEvents( sinks[i].dequeueAll() );
  +                handler.handleEvents( sources[i].dequeueAll() );
               }
           }
       }
  
  
  
  1.8       +6 -6      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/DefaultQueue.java
  
  Index: DefaultQueue.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/DefaultQueue.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultQueue.java	21 Dec 2001 16:14:20 -0000	1.7
  +++ DefaultQueue.java	4 Feb 2002 18:21:50 -0000	1.8
  @@ -60,7 +60,7 @@
       }
   
       public PreparedEnqueue prepareEnqueue( final QueueElement[] elements )
  -        throws SourceException
  +        throws SinkException
       {
           PreparedEnqueue enqueue = null;
   
  @@ -70,7 +70,7 @@
   
               if ( maxSize() > 0 && elements.length + m_reserve + size() > maxSize() )
               {
  -                throw new SourceFullException("Not enough room to enqueue these elements.");
  +                throw new SinkFullException("Not enough room to enqueue these elements.");
               }
   
               enqueue = new DefaultPreparedEnqueue( this, elements );
  @@ -114,7 +114,7 @@
       }
   
       public void enqueue( final QueueElement[] elements )
  -        throws SourceException
  +        throws SinkException
       {
           final int len = elements.length;
   
  @@ -123,7 +123,7 @@
               m_mutex.acquire();
               if (  maxSize() > 0 && elements.length + m_reserve + size() > maxSize() )
               {
  -                throw new SourceFullException("Not enough room to enqueue these elements.");
  +                throw new SinkFullException("Not enough room to enqueue these elements.");
               }
   
               for ( int i = 0; i < len; i++ )
  @@ -141,14 +141,14 @@
       }
   
       public void enqueue( final QueueElement element )
  -        throws SourceException
  +        throws SinkException
       {
           try
           {
               m_mutex.acquire();
               if (  maxSize() > 0 && 1 + m_reserve + size() > maxSize() )
               {
  -                throw new SourceFullException("Not enough room to enqueue these elements.");
  +                throw new SinkFullException("Not enough room to enqueue these elements.");
               }
   
               m_elements.add( element );
  
  
  
  1.3       +6 -6      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/FixedSizeQueue.java
  
  Index: FixedSizeQueue.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/FixedSizeQueue.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FixedSizeQueue.java	19 Dec 2001 16:54:02 -0000	1.2
  +++ FixedSizeQueue.java	4 Feb 2002 18:21:50 -0000	1.3
  @@ -52,7 +52,7 @@
       }
   
       public PreparedEnqueue prepareEnqueue( final QueueElement[] elements )
  -        throws SourceException
  +        throws SinkException
       {
           PreparedEnqueue enqueue = null;
   
  @@ -62,7 +62,7 @@
   
               if ( elements.length + m_reserve + size() > maxSize() )
               {
  -                throw new SourceFullException("Not enough room to enqueue these elements.");
  +                throw new SinkFullException("Not enough room to enqueue these elements.");
               }
   
               enqueue = new FixedSizePreparedEnqueue( this, elements );
  @@ -106,7 +106,7 @@
       }
   
       public void enqueue( final QueueElement[] elements )
  -        throws SourceException
  +        throws SinkException
       {
           final int len = elements.length;
   
  @@ -115,7 +115,7 @@
               m_mutex.acquire();
               if ( elements.length + m_reserve + size() > maxSize() )
               {
  -                throw new SourceFullException("Not enough room to enqueue these elements.");
  +                throw new SinkFullException("Not enough room to enqueue these elements.");
               }
   
               for ( int i = 0; i < len; i++ )
  @@ -133,14 +133,14 @@
       }
   
       public void enqueue( final QueueElement element )
  -        throws SourceException
  +        throws SinkException
       {
           try
           {
               m_mutex.acquire();
               if ( 1 + m_reserve + size() > maxSize() )
               {
  -                throw new SourceFullException("Not enough room to enqueue these elements.");
  +                throw new SinkFullException("Not enough room to enqueue these elements.");
               }
   
               addElement( element );
  
  
  
  1.3       +1 -1      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/test/AbstractQueueTestCase.java
  
  Index: AbstractQueueTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/event/test/AbstractQueueTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractQueueTestCase.java	8 Jan 2002 18:06:07 -0000	1.2
  +++ AbstractQueueTestCase.java	4 Feb 2002 18:21:50 -0000	1.3
  @@ -11,7 +11,7 @@
   import org.apache.avalon.excalibur.event.Queue;
   import org.apache.avalon.excalibur.event.PreparedEnqueue;
   import org.apache.avalon.excalibur.event.QueueElement;
  -import org.apache.avalon.excalibur.event.SourceException;
  +import org.apache.avalon.excalibur.event.SinkException;
   
   /**
    * The default queue implementation is a variabl size queue.
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>