Class StandardPipeline
- java.lang.Object
- 
- org.apache.catalina.util.LifecycleBase
- 
- org.apache.catalina.core.StandardPipeline
 
 
- 
 public class StandardPipeline extends LifecycleBase implements Pipeline 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 toaddValve()orremoveValveare 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
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected ValvebasicThe basic Valve (if any) associated with this Pipeline.protected ContainercontainerThe Container with which this Pipeline is associated.protected ValvefirstThe first valve associated with this Pipeline.- 
Fields inherited from interface org.apache.catalina.LifecycleAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
- 
 - 
Constructor SummaryConstructors Constructor Description StandardPipeline()Construct a new StandardPipeline instance with no associated Container.StandardPipeline(Container container)Construct a new StandardPipeline instance that is associated with the specified Container.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValve(Valve valve)Add a new Valve to the end of the pipeline associated with this Container.protected voiddestroyInternal()Sub-classes implement this method to perform any instance destruction required.voidfindNonAsyncValves(java.util.Set<java.lang.String> result)Identifies the Valves, if any, in this Pipeline that do not support async.ValvegetBasic()Return the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).ContainergetContainer()Return the Container with which this Pipeline is associated.ValvegetFirst()javax.management.ObjectName[]getValveObjectNames()Valve[]getValves()Return the set of Valves in the pipeline associated with this Container, including the basic Valve (if any).protected voidinitInternal()Sub-classes implement this method to perform any instance initialisation required.booleanisAsyncSupported()Returns true if all the valves in this pipeline support async, false otherwisevoidremoveValve(Valve valve)Remove the specified Valve from the pipeline associated with this Container, if it is found; otherwise, do nothing.voidsetBasic(Valve valve)Set the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).voidsetContainer(Container container)Set the Container with which this Pipeline is associated.protected voidstartInternal()StartValves) in this pipeline and implement the requirements ofLifecycleBase.startInternal().protected voidstopInternal()StopValves) in this pipeline and implement the requirements ofLifecycleBase.stopInternal().java.lang.StringtoString()Return a String representation of this component.- 
Methods inherited from class org.apache.catalina.util.LifecycleBaseaddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
 
- 
 
- 
- 
- 
Constructor Detail- 
StandardPipelinepublic StandardPipeline() Construct a new StandardPipeline instance with no associated Container.
 - 
StandardPipelinepublic StandardPipeline(Container container) Construct a new StandardPipeline instance that is associated with the specified Container.- Parameters:
- container- The container we should be associated with
 
 
- 
 - 
Method Detail- 
isAsyncSupportedpublic boolean isAsyncSupported() Description copied from interface:PipelineReturns true if all the valves in this pipeline support async, false otherwise- Specified by:
- isAsyncSupportedin interface- Pipeline
- Returns:
- true if all the valves in this pipeline support async, false otherwise
 
 - 
findNonAsyncValvespublic void findNonAsyncValves(java.util.Set<java.lang.String> result) Description copied from interface:PipelineIdentifies the Valves, if any, in this Pipeline that do not support async.- Specified by:
- findNonAsyncValvesin interface- Pipeline
- Parameters:
- result- The Set to which the fully qualified class names of each Valve in this Pipeline that does not support async will be added
 
 - 
getContainerpublic Container getContainer() Return the Container with which this Pipeline is associated.- Specified by:
- getContainerin interface- Contained
- Returns:
- The Container with which this instance is associated or
         nullif not associated with a Container
 
 - 
setContainerpublic void setContainer(Container container) Set the Container with which this Pipeline is associated.- Specified by:
- setContainerin interface- Contained
- Parameters:
- container- The new associated container
 
 - 
initInternalprotected void initInternal() Description copied from class:LifecycleBaseSub-classes implement this method to perform any instance initialisation required.- Specified by:
- initInternalin class- LifecycleBase
 
 - 
startInternalprotected void startInternal() throws LifecycleExceptionStartValves) in this pipeline and implement the requirements ofLifecycleBase.startInternal().- Specified by:
- startInternalin class- LifecycleBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
 - 
stopInternalprotected void stopInternal() throws LifecycleExceptionStopValves) in this pipeline and implement the requirements ofLifecycleBase.stopInternal().- Specified by:
- stopInternalin class- LifecycleBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
 - 
destroyInternalprotected void destroyInternal() Description copied from class:LifecycleBaseSub-classes implement this method to perform any instance destruction required.- Specified by:
- destroyInternalin class- LifecycleBase
 
 - 
toStringpublic java.lang.String toString() Return a String representation of this component.- Overrides:
- toStringin class- java.lang.Object
 
 - 
getBasicpublic Valve getBasic() Return the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any). 
 - 
setBasicpublic void setBasic(Valve valve) Set the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any). Prior to setting the basic Valve, the Valve's setContainer()will be called, if it implementsContained, with the owning Container as an argument. The method may throw anIllegalArgumentExceptionif this Valve chooses not to be associated with this Container, orIllegalStateExceptionif it is already associated with a different Container.
 - 
addValvepublic void addValve(Valve valve) 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 implementsContained, with the owning Container as an argument. The method may throw anIllegalArgumentExceptionif this Valve chooses not to be associated with this Container, orIllegalStateExceptionif it is already associated with a different Container.- Specified by:
- addValvein interface- Pipeline
- Parameters:
- valve- Valve to be added
- Throws:
- java.lang.IllegalArgumentException- if this Container refused to accept the specified Valve
- java.lang.IllegalArgumentException- if the specified Valve refuses to be associated with this Container
- java.lang.IllegalStateException- if the specified Valve is already associated with a different Container
 
 - 
getValvespublic Valve[] getValves() 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.
 - 
getValveObjectNamespublic javax.management.ObjectName[] getValveObjectNames() 
 - 
removeValvepublic void removeValve(Valve valve) 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'ssetContainer(null)method will be called if it implementsContained.- Specified by:
- removeValvein interface- Pipeline
- Parameters:
- valve- Valve to be removed
 
 
- 
 
-