Class DefaultPipeline
- All Implemented Interfaces:
Pipeline,ValveContext
Pipeline.-
Field Summary
FieldsFields inherited from interface com.easydesk.pipeline.Pipeline
EMPTY_PIPELINE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new Valve to the end of the pipeline.getName()Get the name of this pipeline.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.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.voidSet the name of this pipeline.protected voidSet new valves during deserialization
-
Field Details
-
name
Name of this pipeline.
-
-
Constructor Details
-
DefaultPipeline
public DefaultPipeline()
-
-
Method Details
-
initialize
Description copied from interface:PipelineInitializes this instance. Called once by the Turbine servlet.- Specified by:
initializein interfacePipeline- Throws:
Exception- See Also:
-
setName
Set the name of this pipeline. -
getName
Get the name of this pipeline. -
addValve
Description copied from interface:PipelineAdd a new Valve to the end of the pipeline.
-
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. -
setValves
Set new valves during deserialization- Parameters:
valves- the valves to set
-
removeValve
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:
-
invoke
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- run-time information pipelineData,- Throws:
IOException- an input/output error occurred.PipelineException- See Also:
-
invokeNext
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 pouch.- Throws:
IOException- Thrown by a subsequent Valve.PipelineException- See Also:
-