Class StandardPipeline
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
Field Summary
Modifier and TypeFieldDescriptionprotected Valve
The basic Valve (if any) associated with this Pipeline.protected Container
The Container with which this Pipeline is associated.protected Valve
The first valve associated with this Pipeline.Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_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 Summary
ConstructorDescriptionConstruct a new StandardPipeline instance with no associated Container.StandardPipeline
(Container container) Construct a new StandardPipeline instance that is associated with the specified Container. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new Valve to the end of the pipeline associated with this Container.protected void
Sub-classes implement this method to perform any instance destruction required.void
findNonAsyncValves
(Set<String> result) Identifies the Valves, if any, in this Pipeline that do not support async.getBasic()
Get theContainer
with which this instance is associated.getFirst()
Valve[]
protected void
Sub-classes implement this method to perform any instance initialisation required.boolean
Returns true if all the valves in this pipeline support async, false otherwisevoid
removeValve
(Valve valve) Remove the specified Valve from the pipeline associated with this Container, if it is found; otherwise, do nothing.void
Set the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).void
setContainer
(Container container) Set theContainer
with which this instance is associated.protected void
Sub-classes must ensure that the state is changed toLifecycleState.STARTING
during the execution of this method.protected void
Sub-classes must ensure that the state is changed toLifecycleState.STOPPING
during the execution of this method.toString()
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
-
Field Details
-
basic
The basic Valve (if any) associated with this Pipeline. -
container
The Container with which this Pipeline is associated. -
first
The first valve associated with this Pipeline.
-
-
Constructor Details
-
StandardPipeline
public StandardPipeline()Construct a new StandardPipeline instance with no associated Container. -
StandardPipeline
Construct a new StandardPipeline instance that is associated with the specified Container.- Parameters:
container
- The container we should be associated with
-
-
Method Details
-
isAsyncSupported
public boolean isAsyncSupported()Description copied from interface:Pipeline
Returns true if all the valves in this pipeline support async, false otherwise- Specified by:
isAsyncSupported
in interfacePipeline
- Returns:
- true if all the valves in this pipeline support async, false otherwise
-
findNonAsyncValves
Description copied from interface:Pipeline
Identifies the Valves, if any, in this Pipeline that do not support async.- Specified by:
findNonAsyncValves
in interfacePipeline
- 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
-
getContainer
Description copied from interface:Contained
Get theContainer
with which this instance is associated.- Specified by:
getContainer
in interfaceContained
- Returns:
- The Container with which this instance is associated or
null
if not associated with a Container
-
setContainer
Description copied from interface:Contained
Set theContainer
with which this instance is associated.- Specified by:
setContainer
in interfaceContained
- Parameters:
container
- The Container instance with which this instance is to be associated, ornull
to disassociate this instance from any Container
-
initInternal
protected void initInternal()Description copied from class:LifecycleBase
Sub-classes implement this method to perform any instance initialisation required.- Specified by:
initInternal
in classLifecycleBase
-
startInternal
Description copied from class:LifecycleBase
Sub-classes must ensure that the state is changed toLifecycleState.STARTING
during the execution of this method. Changing state will trigger theLifecycle.START_EVENT
event. If a component fails to start it may either throw aLifecycleException
which will cause it's parent to fail to start or it can place itself in the error state in which caseLifecycleBase.stop()
will be called on the failed component but the parent component will continue to start normally.- Specified by:
startInternal
in classLifecycleBase
- Throws:
LifecycleException
- Start error occurred
-
stopInternal
Description copied from class:LifecycleBase
Sub-classes must ensure that the state is changed toLifecycleState.STOPPING
during the execution of this method. Changing state will trigger theLifecycle.STOP_EVENT
event.- Specified by:
stopInternal
in classLifecycleBase
- Throws:
LifecycleException
- Stop error occurred
-
destroyInternal
protected void destroyInternal()Description copied from class:LifecycleBase
Sub-classes implement this method to perform any instance destruction required.- Specified by:
destroyInternal
in classLifecycleBase
-
toString
-
getBasic
-
setBasic
Description copied from interface:Pipeline
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 anIllegalArgumentException
if this Valve chooses not to be associated with this Container, orIllegalStateException
if it is already associated with a different Container. -
addValve
Description copied from interface:Pipeline
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 anIllegalArgumentException
if this Valve chooses not to be associated with this Container, orIllegalStateException
if it is already associated with a different Container.Implementation note: Implementations are expected to trigger the
Container.ADD_VALVE_EVENT
for the associated container if this call is successful. -
getValves
-
getValveObjectNames
-
removeValve
Description copied from interface:Pipeline
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
.Implementation note: Implementations are expected to trigger the
Container.REMOVE_VALVE_EVENT
for the associated container if this call is successful.- Specified by:
removeValve
in interfacePipeline
- Parameters:
valve
- Valve to be removed
-
getFirst
-