01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
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: void initialize() throws PipelineException;
32:
33: /**
34: * <p>Add a new Valve to the end of the pipeline.</p>
35: *
36: * @param valve Valve to be added.
37: *
38: * @exception IllegalStateException If the pipeline has not been
39: * initialized.
40: */
41: void addValve(Valve valve);
42:
43: /**
44: * <p>Return the set of all Valves in the pipeline. If there are no
45: * such Valves, a zero-length array is returned.</p>
46: *
47: * @return An array of valves.
48: */
49: Valve[] getValves();
50:
51: /**
52: * <p>Cause the specified request and response to be processed by
53: * the sequence of Valves associated with this pipeline, until one
54: * of these Valves decides to end the processing.</p>
55: *
56: * <p>The implementation must ensure that multiple simultaneous
57: * requests (on different threads) can be processed through the
58: * same Pipeline without interfering with each other's control
59: * flow.</p>
60: *
61: * @param data The run-time information, including the servlet
62: * request and response we are processing.
63: *
64: * @exception IOException an input/output error occurred.
65: */
66: void invoke(RequestContext context) throws PipelineException;
67:
68: /**
69: * <p>Remove the specified Valve from the pipeline, if it is found;
70: * otherwise, do nothing.</p>
71: *
72: * @param valve Valve to be removed.
73: */
74: void removeValve(Valve valve);
75:
76: /**
77: * Get the name of the pipeine
78: *
79: * @return name of the pipeline
80: */
81: String getName();
82:
83: }
|