1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.pipeline;
18
19 import java.io.IOException;
20
21 import org.apache.jetspeed.pipeline.valve.Valve;
22 import org.apache.jetspeed.request.RequestContext;
23
24 /***
25 * Jetspeed Pipeline
26 *
27 * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
28 * @version $Id: Pipeline.java 516448 2007-03-09 16:25:47Z ate $
29 */
30 public interface Pipeline
31 {
32 void initialize()
33 throws PipelineException;
34 /***
35 * <p>Add a new Valve to the end of the pipeline.</p>
36 *
37 * @param valve Valve to be added.
38 *
39 * @exception IllegalStateException If the pipeline has not been
40 * initialized.
41 */
42 void addValve(Valve valve);
43
44 /***
45 * <p>Return the set of all Valves in the pipeline. If there are no
46 * such Valves, a zero-length array is returned.</p>
47 *
48 * @return An array of valves.
49 */
50 Valve[] getValves();
51
52 /***
53 * <p>Cause the specified request and response to be processed by
54 * the sequence of Valves associated with this pipeline, until one
55 * of these Valves decides to end the processing.</p>
56 *
57 * <p>The implementation must ensure that multiple simultaneous
58 * requests (on different threads) can be processed through the
59 * same Pipeline without interfering with each other's control
60 * flow.</p>
61 *
62 * @param data The run-time information, including the servlet
63 * request and response we are processing.
64 *
65 * @exception IOException an input/output error occurred.
66 */
67 void invoke(RequestContext context)
68 throws PipelineException;
69
70 /***
71 * <p>Remove the specified Valve from the pipeline, if it is found;
72 * otherwise, do nothing.</p>
73 *
74 * @param valve Valve to be removed.
75 */
76 void removeValve(Valve valve);
77
78 /***
79 * Get the name of the pipeine
80 *
81 * @return name of the pipeline
82 */
83 String getName();
84
85 }