dlr 02/01/02 00:15:26
Modified: src/java/org/apache/turbine/pipeline TurbinePipeline.java
Log:
o Tweaked header JavaDoc.
o Changed valveDefinitions storage reference and accessor method to
use the List interface.
o Implemented init() to instantiate Valve implementations from the
ValveDefinition list.
Revision Changes Path
1.4 +25 -6
jakarta-turbine-3/src/java/org/apache/turbine/pipeline/TurbinePipeline.java
Index: TurbinePipeline.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/pipeline/TurbinePipeline.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- TurbinePipeline.java 2 Jan 2002 03:51:31 -0000 1.3
+++ TurbinePipeline.java 2 Jan 2002 08:15:26 -0000 1.4
@@ -55,8 +55,9 @@
*/
import java.io.IOException;
-
import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
import org.apache.turbine.Pipeline;
import org.apache.turbine.RunData;
@@ -65,7 +66,7 @@
import org.apache.turbine.ValveContext;
/**
- * Base implementation of a {@link org.apache.turbine.Pipeline}.
+ * Flexible implementation of a {@link org.apache.turbine.Pipeline}.
* Originally based on code from Catalina and ideas from Apache httpd.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
@@ -78,7 +79,6 @@
* Name of this pipeline.
*/
protected String name;
-
/**
* The set of Valves associated with this Pipeline.
@@ -90,7 +90,7 @@
* From actual valve instances will be initialized from the
* valve definitions.
*/
- protected ArrayList valveDefinitions = new ArrayList();
+ protected List valveDefinitions = new ArrayList();
/**
* The per-thread execution state for processing through this
@@ -102,10 +102,28 @@
protected ThreadLocal state = new ThreadLocal();
/**
+ * Instantiates {@link org.apache.turbine.Valve} implementations
+ * from {@link org.apache.turbine.pipeline.ValveDefinition} list.
+ *
* @see org.apache.turbine.Pipeline#init()
*/
public void init()
+ throws Exception
{
+ // Transform ValveDefinitions into Valves
+ for (Iterator i = valveDefinitions.iterator(); i.hasNext(); )
+ {
+ Valve valve;
+ try
+ {
+ valve = ((ValveDefinition) i.next()).toValve();
+ }
+ catch (TurbineException e)
+ {
+ throw new TurbineException("Misconfigured Pipeline", e);
+ }
+ addValve(valve);
+ }
}
/**
@@ -139,9 +157,10 @@
/**
* Return the configured valve definitions.
*
- * @return ArrayList Valve definitions for this pipeline.
+ * @return An ArrayList containing the Valve definitions for this
+ * pipeline.
*/
- public ArrayList getValveDefinitions()
+ public List getValveDefinitions()
{
return valveDefinitions;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>