Class TurbinePipeline
- java.lang.Object
-
- org.apache.turbine.pipeline.TurbinePipeline
-
- All Implemented Interfaces:
Pipeline,ValveContext
public class TurbinePipeline extends Object implements Pipeline, ValveContext
Flexible implementation of aPipeline. Originally based on code from Catalina and ideas from Apache httpd.- Author:
- Daniel Rall, Jason van Zyl, Peter Courcoux
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLASSIC_PIPELINEThe "Turbine Classic" pipeline.
-
Constructor Summary
Constructors Constructor Description TurbinePipeline()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValve(Valve valve)Add a new Valve to the end of the pipeline.StringgetName()Get the name of this pipeline.Valve[]getValves()Return the set of all Valves in the pipeline.voidinitialize()Initializes 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.voidinvokeNext(PipelineData pipelineData)Cause theinvoke()method of the next Valve that is part of the Pipeline currently being processed (if any) to be executed, passing on the specified request and response objects plus thisValveContextinstance.voidremoveValve(Valve valve)Remove the specified Valve from the pipeline, if it is found; otherwise, do nothing.voidsetName(String name)Set the name of this pipeline.protected voidsetValves(Valve[] valves)Set new valves during deserialization
-
-
-
Field Detail
-
CLASSIC_PIPELINE
public static final String CLASSIC_PIPELINE
The "Turbine Classic" pipeline.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TurbinePipeline
public TurbinePipeline()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
Description copied from interface:PipelineInitializes this instance. Called once by the Turbine servlet.- Specified by:
initializein interfacePipeline- Throws:
Exception- if the initialization fails- See Also:
Pipeline.initialize()
-
setName
public void setName(String name)
Set the name of this pipeline.- Parameters:
name- Name of this pipeline.
-
getName
public String getName()
Get the name of this pipeline.- Returns:
- String Name of this pipeline.
-
addValve
public void addValve(Valve valve)
Description copied from interface:PipelineAdd a new Valve to the end of the pipeline.
- Specified by:
addValvein interfacePipeline- Parameters:
valve- Valve to be added.- See Also:
Pipeline.addValve(Valve)
-
getValves
public Valve[] getValves()
Description copied from interface:PipelineReturn the set of all Valves in the pipeline. If there are no such Valves, a zero-length array is returned.- Specified by:
getValvesin interfacePipeline- Returns:
- An array of valves.
- See Also:
Pipeline.getValves()
-
setValves
protected void setValves(Valve[] valves)
Set new valves during deserialization- Parameters:
valves- the valves to set
-
removeValve
public void removeValve(Valve valve)
Description copied from interface:PipelineRemove the specified Valve from the pipeline, if it is found; otherwise, do nothing.- Specified by:
removeValvein interfacePipeline- Parameters:
valve- Valve to be removed.- See Also:
Pipeline.removeValve(Valve)
-
invoke
public void invoke(PipelineData pipelineData) throws TurbineException, IOException
Description copied from interface:PipelineCause 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.
- Specified by:
invokein interfacePipeline- Parameters:
pipelineData- The run-time information, including the servlet request and response we are processing.- Throws:
TurbineException- if the invocation failsIOException- an input/output error occurred.- See Also:
Pipeline.invoke(PipelineData)
-
invokeNext
public void invokeNext(PipelineData pipelineData) throws TurbineException, IOException
Description copied from interface:ValveContextCause the
invoke()method of the next Valve that is part of the Pipeline currently being processed (if any) to be executed, passing on the specified request and response objects plus thisValveContextinstance. Exceptions thrown by a subsequently executed Valve will be passed on to our caller.If there are no more Valves to be executed, execution of this method will result in a no op.
- Specified by:
invokeNextin interfaceValveContext- Parameters:
pipelineData- The run-time information, including the servlet request and response we are processing.- Throws:
TurbineException- Thrown by a subsequent Valve.IOException- Thrown by a subsequent Valve.- See Also:
ValveContext.invokeNext(PipelineData)
-
-