| java.lang.Object org.apache.catalina.core.StandardPipeline
StandardPipeline | public class StandardPipeline implements Pipeline,Contained,Lifecycle(Code) | | Standard implementation of a processing Pipeline that will invoke
a series of Valves that have been configured to be called in order. This
implementation can be used for any type of Container.
IMPLEMENTATION WARNING - This implementation assumes that no
calls to addValve() or removeValve are allowed
while a request is currently being processed. Otherwise, the mechanism
by which per-thread state is maintained will need to be modified.
author: Craig R. McClanahan |
Inner Class :protected class StandardPipelineValveContext implements ValveContext | |
Field Summary | |
protected Valve | basic The basic Valve (if any) associated with this Pipeline. | protected Container | container The Container with which this Pipeline is associated. | protected int | debug The debugging detail level for this component. | protected String | info Descriptive information about this implementation. | protected LifecycleSupport | lifecycle The lifecycle event support for this component. | protected static StringManager | sm The string manager for this package. | protected boolean | started | protected Valve | valves The set of Valves (not including the Basic one, if any) associated with
this Pipeline. |
Constructor Summary | |
public | StandardPipeline() Construct a new StandardPipeline instance with no associated Container. | public | StandardPipeline(Container container) Construct a new StandardPipeline instance that is associated with the
specified Container. |
Method Summary | |
public void | addLifecycleListener(LifecycleListener listener) Add a lifecycle event listener to this component. | public void | addValve(Valve valve) Add a new Valve to the end of the pipeline associated with this
Container. | public LifecycleListener[] | findLifecycleListeners() Get the lifecycle listeners associated with this lifecycle. | public Valve | getBasic() Return the Valve instance that has been distinguished as the basic
Valve for this Pipeline (if any). | public Container | getContainer() Return the Container with which this Pipeline is associated. | public String | getInfo() Return descriptive information about this implementation class. | public Valve[] | getValves() Return the set of Valves in the pipeline associated with this
Container, including the basic Valve (if any). | public void | invoke(Request request, Response response) Cause the specified request and response to be processed by the Valves
associated with this pipeline, until one of these valves causes the
response to be created and returned. | protected void | log(String message) Log a message on the Logger associated with our Container (if any). | protected void | log(String message, Throwable throwable) Log a message on the Logger associated with our Container (if any). | public void | removeLifecycleListener(LifecycleListener listener) Remove a lifecycle event listener from this component. | public void | removeValve(Valve valve) Remove the specified Valve from the pipeline associated with this
Container, if it is found; otherwise, do nothing. | public void | setBasic(Valve valve) Set the Valve instance that has been distinguished as the basic
Valve for this Pipeline (if any). | public void | setContainer(Container container) Set the Container with which this Pipeline is associated. | public synchronized void | start() Prepare for active use of the public methods of this Component. | public synchronized void | stop() Gracefully shut down active use of the public methods of this Component. |
basic | protected Valve basic(Code) | | The basic Valve (if any) associated with this Pipeline.
|
container | protected Container container(Code) | | The Container with which this Pipeline is associated.
|
debug | protected int debug(Code) | | The debugging detail level for this component.
|
info | protected String info(Code) | | Descriptive information about this implementation.
|
started | protected boolean started(Code) | | Has this component been started yet?
|
valves | protected Valve valves(Code) | | The set of Valves (not including the Basic one, if any) associated with
this Pipeline.
|
StandardPipeline | public StandardPipeline()(Code) | | Construct a new StandardPipeline instance with no associated Container.
|
StandardPipeline | public StandardPipeline(Container container)(Code) | | Construct a new StandardPipeline instance that is associated with the
specified Container.
Parameters: container - The container we should be associated with |
addLifecycleListener | public void addLifecycleListener(LifecycleListener listener)(Code) | | Add a lifecycle event listener to this component.
Parameters: listener - The listener to add |
addValve | public void addValve(Valve valve)(Code) | | Add a new Valve to the end of the pipeline associated with this
Container. Prior to adding the Valve, the Valve's
setContainer() method will be called, if it implements
Contained , with the owning Container as an argument.
The method may throw an
IllegalArgumentException if this Valve chooses not to
be associated with this Container, or IllegalStateException
if it is already associated with a different Container.
Parameters: valve - Valve to be added exception: IllegalArgumentException - if this Container refused toaccept the specified Valve exception: IllegalArgumentException - if the specifie Valve refuses to beassociated with this Container exception: IllegalStateException - if the specified Valve is alreadyassociated with a different Container |
findLifecycleListeners | public LifecycleListener[] findLifecycleListeners()(Code) | | Get the lifecycle listeners associated with this lifecycle. If this
Lifecycle has no listeners registered, a zero-length array is returned.
|
getBasic | public Valve getBasic()(Code) | | Return the Valve instance that has been distinguished as the basic
Valve for this Pipeline (if any).
|
getContainer | public Container getContainer()(Code) | | Return the Container with which this Pipeline is associated.
|
getInfo | public String getInfo()(Code) | | Return descriptive information about this implementation class.
|
getValves | public Valve[] getValves()(Code) | | Return the set of Valves in the pipeline associated with this
Container, including the basic Valve (if any). If there are no
such Valves, a zero-length array is returned.
|
invoke | public void invoke(Request request, Response response) throws IOException, ServletException(Code) | | Cause the specified request and response to be processed by the Valves
associated with this pipeline, until one of these valves causes the
response to be created and returned. 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: request - The servlet request we are processing Parameters: response - The servlet response we are creating exception: IOException - if an input/output error occurs exception: ServletException - if a servlet exception is thrown |
log | protected void log(String message)(Code) | | Log a message on the Logger associated with our Container (if any).
Parameters: message - Message to be logged |
log | protected void log(String message, Throwable throwable)(Code) | | Log a message on the Logger associated with our Container (if any).
Parameters: message - Message to be logged Parameters: throwable - Associated exception |
removeLifecycleListener | public void removeLifecycleListener(LifecycleListener listener)(Code) | | Remove a lifecycle event listener from this component.
Parameters: listener - The listener to remove |
removeValve | public void removeValve(Valve valve)(Code) | | Remove the specified Valve from the pipeline associated with this
Container, if it is found; otherwise, do nothing. If the Valve is
found and removed, the Valve's setContainer(null) method
will be called if it implements Contained .
Parameters: valve - Valve to be removed |
setBasic | public void setBasic(Valve valve)(Code) | | Set the Valve instance that has been distinguished as the basic
Valve for this Pipeline (if any). Prioer to setting the basic Valve,
the Valve's setContainer() will be called, if it
implements Contained , with the owning Container as an
argument. The method may throw an IllegalArgumentException
if this Valve chooses not to be associated with this Container, or
IllegalStateException if it is already associated with
a different Container.
Parameters: valve - Valve to be distinguished as the basic Valve |
setContainer | public void setContainer(Container container)(Code) | | Set the Container with which this Pipeline is associated.
Parameters: container - The new associated container |
start | public synchronized void start() throws LifecycleException(Code) | | Prepare for active use of the public methods of this Component.
exception: LifecycleException - if this component detects a fatal errorthat prevents it from being started |
stop | public synchronized void stop() throws LifecycleException(Code) | | Gracefully shut down active use of the public methods of this Component.
exception: LifecycleException - if this component detects a fatal errorthat needs to be reported |
|
|