Package com.easydesk.pipeline
Interface Pipeline
- All Known Implementing Classes:
DefaultPipeline
public interface Pipeline
The idea of a pipeline is being taken from Catalina in its entirety :-) I would like to take the idea further and
implement Valves instead of hardcoding particular methods in a pipeline. It would be more flexible to specify Valves
for a pipeline in an XML file (we can also rip off the digester rules from T4) and have invoke() as part of the
interface. So a set of Valves would be added to the pipeline and the pipeline would 'invoke' each valve. In the case
Turbine each Valve would produce some output to be sent out the pipe.
- Author:
- Jason van Zyl, Daniel Rall, Peter Courcoux
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new Valve to the end of the pipeline.getName()Return the pipeline's name.Valve[]Return the set of all Valves in the pipeline.voidInitializes this instance.voidinvoke(PipelineData pipelineData) Cause the specified request and response to be processed by the sequence of Valves associated with this pipeline, until one of these Valves decides to end the processing.voidremoveValve(Valve valve) Remove the specified Valve from the pipeline, if it is found; otherwise, do nothing.voidDOCUMENT ME!
-
Field Details
-
EMPTY_PIPELINE
DOCUMENT ME!- See Also:
-
-
Method Details
-
getName
String getName()Return the pipeline's name. -
setName
DOCUMENT ME!- Parameters:
name- DOCUMENT ME!
-
initialize
Initializes this instance. Called once by the Turbine servlet.- Throws:
Exception
-
addValve
Add a new Valve to the end of the pipeline.
- Parameters:
valve- Valve to be added.- Throws:
IllegalStateException- If the pipeline has not been initialized.
-
getValves
Valve[] getValves()Return the set of all Valves in the pipeline. If there are no such Valves, a zero-length array is returned.- Returns:
- An array of valves.
-
invoke
Cause the specified request and response to be processed by the sequence of Valves associated with this pipeline, until one of these Valves decides to end the processing.
The implementation must ensure that multiple simultaneous requests (on different threads) can be processed through the same Pipeline without interfering with each other's control flow.
- Parameters:
pipelineData- run-time information pipelineData,- Throws:
IOException- an input/output error occurred.PipelineException
-
removeValve
Remove the specified Valve from the pipeline, if it is found; otherwise, do nothing.- Parameters:
valve- Valve to be removed.
-