CVS: plexus-components/summit/src/java/org/apache/plexus/summit/pipeline Pipeline.java,1.1.1.1,1.2 SummitPipeline.java,1.1.1.1,1.2

[email protected] Thu, 1 May 2003 14:28:42 -0500
Newsgroups gmane.comp.java.plexus.devel
Message-ID <[email protected]>
Update of /cvsroot/plexus/plexus-components/summit/src/java/org/apache/plexus/summit/pipeline
In directory eng.werken.com:/tmp/cvs-serv17379/src/java/org/apache/plexus/summit/pipeline

Modified Files:
	Pipeline.java SummitPipeline.java 
Log Message:
o Removed the multiple View notion.
o Using a service manager instead of the components being service managers.


Index: Pipeline.java
===================================================================
RCS file: /cvsroot/plexus/plexus-components/summit/src/java/org/apache/plexus/summit/pipeline/Pipeline.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Pipeline.java	15 Feb 2003 03:55:49 -0000	1.1.1.1
+++ Pipeline.java	1 May 2003 19:28:40 -0000	1.2
@@ -72,7 +72,7 @@
 public interface Pipeline
     extends SummitComponent
 {
-    public final static String ROLE = Pipeline.class.getName();   
+    public final static String ROLE = Pipeline.class.getName();
 
     /**
      * <p>Cause the specified request and response to be processed by
@@ -89,6 +89,6 @@
      *
      * @exception IOException an input/output error occurred.
      */
-    void invoke(RunData data)
+    void invoke( RunData data )
         throws SummitException, IOException;
 }

Index: SummitPipeline.java
===================================================================
RCS file: /cvsroot/plexus/plexus-components/summit/src/java/org/apache/plexus/summit/pipeline/SummitPipeline.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- SummitPipeline.java	15 Feb 2003 03:55:50 -0000	1.1.1.1
+++ SummitPipeline.java	1 May 2003 19:28:40 -0000	1.2
@@ -70,7 +70,7 @@
 import org.apache.plexus.summit.rundata.RunData;
 
 /**
- * Flexible implementation of a {@link org.apache.plexus.summit.Pipeline}.
+ * Flexible implementation of a {@link org.apache.plexus.summit.pipeline.Pipeline}.
  *
  * @author <a href="mailto:[email protected]">Jason van Zyl</a>
  * @author <a href="mailto:[email protected]">Pete Kazmier</a>
@@ -84,7 +84,7 @@
 
     /** The set of Valves associated with this Pipeline. */
     protected Valve[] valves;
-    
+
     /**
      * The per-thread execution state for processing through this
      * pipeline.  The actual value is a java.lang.Integer object
@@ -103,22 +103,20 @@
     public SummitPipeline()
         throws Exception
     {
-    }       
+    }
 
-    /**
-     * @see org.apache.plexus.summit.Pipeline#init()
-     */
+    /** @see Initializable#initialize() .*/
     public void initialize()
         throws Exception
     {
-        this.name = configuration.getChild("name").getValue();
-        
-        Configuration[] ids = 
+        this.name = configuration.getChild( "name" ).getValue();
+
+        Configuration[] ids =
             configuration.getChild( "valveComponentIds" ).getChildren();
-       
-        valves = new Valve[ ids.length ];       
-       
-        for (int i = 0; i < ids.length; i++)
+
+        valves = new Valve[ids.length];
+
+        for ( int i = 0; i < ids.length; i++ )
         {
             if ( ids[i].getName().equals( "valveId" ) )
             {
@@ -126,12 +124,14 @@
 
                 getLogger().info( "Adding Valve: " + valveId );
 
-                valves[ i ] = 
-                    ( Valve ) getServiceBroker().lookup( Valve.ROLE, valveId );                
+                // Fix!!!!
+
+                valves[i] =
+                    (Valve) getServiceManager().lookup( Valve.ROLE + valveId );
             }
         }
-    }    
-    
+    }
+
     /**
      * Get the name of this pipeline.
      *
@@ -143,41 +143,41 @@
     }
 
     /**
-     * @see org.apache.plexus.summit.Pipeline#invoke(RunData)
+     * @see org.apache.plexus.summit.pipeline.Pipeline#invoke(RunData)
      */
-    public void invoke(RunData data)
+    public void invoke( RunData data )
         throws SummitException, IOException
     {
         // Initialize the per-thread state for this thread
-        state.set(new Integer(0));
+        state.set( new Integer( 0 ) );
 
         // Invoke the first Valve in this pipeline for this request
-        invokeNext(data);
+        invokeNext( data );
     }
 
     /**
-     * @see org.apache.plexus.summit.ValveContext#invokeNext(RunData)
+     * @see org.apache.plexus.summit.pipeline.valve.ValveContext#invokeNext(RunData)
      */
-    public void invokeNext(RunData data)
+    public void invokeNext( RunData data )
         throws SummitException, IOException
     {
         // Identify the current subscript for the current request thread
         Integer current = (Integer) state.get();
         int subscript = current.intValue();
 
-        if (subscript < valves.length)
+        if ( subscript < valves.length )
         {
             // Invoke the requested Valve for the current request
             // thread and increment its thread-local state.
-            state.set(new Integer(subscript + 1));
-            valves[subscript].invoke(data, this);
+            state.set( new Integer( subscript + 1 ) );
+            valves[subscript].invoke( data, this );
         }
     }
 
     /**
      * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
      */
-    public void configure(Configuration configuration) throws ConfigurationException
+    public void configure( Configuration configuration ) throws ConfigurationException
     {
         this.configuration = configuration;
     }