public class TurbinePipeline extends Object implements Pipeline, ValveContext
Pipeline
.
Originally based on code from Catalina and ideas from Apache httpd.Modifier and Type | Field and Description |
---|---|
static String |
CLASSIC_PIPELINE
The "Turbine Classic" pipeline.
|
Constructor and Description |
---|
TurbinePipeline() |
Modifier and Type | Method and Description |
---|---|
void |
addValve(Valve valve)
Add a new Valve to the end of the pipeline.
|
String |
getName()
Get the name of this pipeline.
|
Valve[] |
getValves()
Return the set of all Valves in the pipeline.
|
void |
initialize()
Initializes this instance.
|
void |
invoke(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.
|
void |
invokeNext(PipelineData pipelineData)
Cause 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 this ValveContext instance. |
void |
removeValve(Valve valve)
Remove the specified Valve from the pipeline, if it is found;
otherwise, do nothing.
|
void |
setName(String name)
Set the name of this pipeline.
|
protected void |
setValves(Valve[] valves)
Set new valves during deserialization
|
public static final String CLASSIC_PIPELINE
public TurbinePipeline()
public void initialize() throws Exception
Pipeline
initialize
in interface Pipeline
Exception
- if the initialization failsPipeline.initialize()
public void setName(String name)
name
- Name of this pipeline.public String getName()
public void addValve(Valve valve)
Pipeline
Add a new Valve to the end of the pipeline.
addValve
in interface Pipeline
valve
- Valve to be added.Pipeline.addValve(Valve)
public Valve[] getValves()
Pipeline
getValves
in interface Pipeline
Pipeline.getValves()
protected void setValves(Valve[] valves)
valves
- the valves to setpublic void removeValve(Valve valve)
Pipeline
removeValve
in interface Pipeline
valve
- Valve to be removed.Pipeline.removeValve(Valve)
public void invoke(PipelineData pipelineData) throws TurbineException, IOException
Pipeline
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.
invoke
in interface Pipeline
pipelineData
- The run-time information, including the servlet
request and response we are processing.TurbineException
- if the invocation failsIOException
- an input/output error occurred.Pipeline.invoke(PipelineData)
public void invokeNext(PipelineData pipelineData) throws TurbineException, IOException
ValveContext
Cause 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 this ValveContext
instance.
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.
invokeNext
in interface ValveContext
pipelineData
- The run-time information, including the servlet
request and response we are processing.TurbineException
- Thrown by a subsequent Valve.IOException
- Thrown by a subsequent Valve.ValveContext.invokeNext(PipelineData)
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.