Top Description Fields Constructors Methods
org.apache.catalina.core

public Class StandardPipeline

extends LifecycleBase
implements Pipeline
Class Inheritance
All Implemented Interfaces
org.apache.catalina.Pipeline, org.apache.catalina.Contained
Imports
java.util.ArrayList, .List, .Set, javax.management.ObjectName, org.apache.catalina.Contained, .Container, .JmxEnabled, .Lifecycle, .LifecycleException, .LifecycleState, .Pipeline, .Valve, org.apache.catalina.util.LifecycleBase, .ToStringUtil, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.ExceptionUtils, org.apache.tomcat.util.res.StringManager

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

Field Summary

Modifier and TypeField and Description
protected Valve
basic

The basic Valve (if any) associated with this Pipeline.

protected Container
container

The Container with which this Pipeline is associated.

protected Valve
first

The first valve associated with this Pipeline.

private static final Log
private static final StringManager

Constructor Summary

AccessConstructor and Description
public
StandardPipeline()

Construct a new StandardPipeline instance with no associated Container.

public
StandardPipeline(Container
The container we should be associated with
container
)

Construct a new StandardPipeline instance that is associated with the specified Container.

Method Summary

Modifier and TypeMethod and Description
public void
addValve(Valve
Valve to be added
valve
)

Implements org.apache.catalina.Pipeline.addValve.

Add a new Valve to the end of the pipeline associated with this Container.

protected void
destroyInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.destroyInternal.

Sub-classes implement this method to perform any instance destruction required.

public void
findNonAsyncValves(Set<String>
The Set to which the fully qualified class names of each Valve in this Pipeline that does not support async will be added
result
)

Implements org.apache.catalina.Pipeline.findNonAsyncValves.

Identifies the Valves, if any, in this Pipeline that do not support async.

public Valve
getBasic()

Implements org.apache.catalina.Pipeline.getBasic.

Return the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).

public Container
getContainer()

Implements org.apache.catalina.Contained.getContainer.

Return the Container with which this Pipeline is associated.

public Valve
public ObjectName[]
public Valve[]
getValves()

Implements org.apache.catalina.Pipeline.getValves.

Return the set of Valves in the pipeline associated with this Container, including the basic Valve (if any).

protected void
initInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.initInternal.

Sub-classes implement this method to perform any instance initialisation required.

public boolean
isAsyncSupported()

Implements org.apache.catalina.Pipeline.isAsyncSupported.

Returns true if all the valves in this pipeline support async, false otherwise

public void
removeValve(Valve
Valve to be removed
valve
)

Implements org.apache.catalina.Pipeline.removeValve.

Remove the specified Valve from the pipeline associated with this Container, if it is found; otherwise, do nothing.

public void
setBasic(Valve
Valve to be distinguished as the basic Valve
valve
)

Implements org.apache.catalina.Pipeline.setBasic.

Set the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).

public void
setContainer(Container
The new associated container
container
)

Implements org.apache.catalina.Contained.setContainer.

Set the Container with which this Pipeline is associated.

protected void
startInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.startInternal.

Start Valves) in this pipeline and implement the requirements of LifecycleBase#startInternal().

protected void
stopInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.stopInternal.

Stop Valves) in this pipeline and implement the requirements of LifecycleBase#stopInternal().

public String
toString()

Overrides java.lang.Object.toString.

Return a String representation of this component.

Inherited from org.apache.catalina.util.LifecycleBase:
addLifecycleListenerdestroyfindLifecycleListenersfireLifecycleEventgetStategetStateNamegetThrowOnFailureinitremoveLifecycleListenersetStatesetStatesetThrowOnFailurestartstop

Field Detail

basicback to summary
protected Valve basic

The basic Valve (if any) associated with this Pipeline.

containerback to summary
protected Container container

The Container with which this Pipeline is associated.

firstback to summary
protected Valve first

The first valve associated with this Pipeline.

logback to summary
private static final Log log

Hides org.apache.catalina.util.LifecycleBase.log.

smback to summary
private static final StringManager sm

Hides org.apache.catalina.util.LifecycleBase.sm.

Constructor Detail

StandardPipelineback to summary
public StandardPipeline()

Construct a new StandardPipeline instance with no associated Container.

StandardPipelineback to summary
public StandardPipeline(Container container)

Construct a new StandardPipeline instance that is associated with the specified Container.

Parameters
container:Container

The container we should be associated with

Method Detail

addValveback to summary
public void addValve(Valve valve)

Implements org.apache.catalina.Pipeline.addValve.

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

Valve to be added

Annotations
@Override
Exceptions
IllegalArgumentException:
  • if this Container refused to accept the specified Valve
  • if the specified Valve refuses to be associated with this Container
IllegalStateException:
if the specified Valve is already associated with a different Container
destroyInternalback to summary
protected void destroyInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.destroyInternal.

Doc from org.apache.catalina.util.LifecycleBase.destroyInternal.

Sub-classes implement this method to perform any instance destruction required.

Annotations
@Override
findNonAsyncValvesback to summary
public void findNonAsyncValves(Set<String> result)

Implements org.apache.catalina.Pipeline.findNonAsyncValves.

Doc from org.apache.catalina.Pipeline.findNonAsyncValves.

Identifies the Valves, if any, in this Pipeline that do not support async.

Parameters
result:Set<String>

The Set to which the fully qualified class names of each Valve in this Pipeline that does not support async will be added

Annotations
@Override
getBasicback to summary
public Valve getBasic()

Implements org.apache.catalina.Pipeline.getBasic.

Return the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).

Returns:Valve

Doc from org.apache.catalina.Pipeline.getBasic.

the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).

Annotations
@Override
getContainerback to summary
public Container getContainer()

Implements org.apache.catalina.Contained.getContainer.

Return the Container with which this Pipeline is associated.

Returns:Container

Doc from org.apache.catalina.Contained.getContainer.

The Container with which this instance is associated or null if not associated with a Container

Annotations
@Override
getFirstback to summary
public Valve getFirst()

Implements org.apache.catalina.Pipeline.getFirst.

Returns:Valve

Doc from org.apache.catalina.Pipeline.getFirst.

the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).

Annotations
@Override
getValveObjectNamesback to summary
public ObjectName[] getValveObjectNames()
getValvesback to summary
public Valve[] getValves()

Implements org.apache.catalina.Pipeline.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.

Returns:Valve[]

Doc from org.apache.catalina.Pipeline.getValves.

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.

Annotations
@Override
initInternalback to summary
protected void initInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.initInternal.

Doc from org.apache.catalina.util.LifecycleBase.initInternal.

Sub-classes implement this method to perform any instance initialisation required.

Annotations
@Override
isAsyncSupportedback to summary
public boolean isAsyncSupported()

Implements org.apache.catalina.Pipeline.isAsyncSupported.

Doc from org.apache.catalina.Pipeline.isAsyncSupported.

Returns true if all the valves in this pipeline support async, false otherwise

Returns:boolean

true if all the valves in this pipeline support async, false otherwise

Annotations
@Override
removeValveback to summary
public void removeValve(Valve valve)

Implements org.apache.catalina.Pipeline.removeValve.

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

Valve to be removed

Annotations
@Override
setBasicback to summary
public void setBasic(Valve valve)

Implements org.apache.catalina.Pipeline.setBasic.

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 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

Valve to be distinguished as the basic Valve

Annotations
@Override
setContainerback to summary
public void setContainer(Container container)

Implements org.apache.catalina.Contained.setContainer.

Set the Container with which this Pipeline is associated.

Parameters
container:Container

The new associated container

Annotations
@Override
startInternalback to summary
protected void startInternal() throws LifecycleException

Implements abstract org.apache.catalina.util.LifecycleBase.startInternal.

Start Valves) in this pipeline and implement the requirements of LifecycleBase#startInternal().

Annotations
@Override
Exceptions
LifecycleException:
if this component detects a fatal error that prevents this component from being used
stopInternalback to summary
protected void stopInternal() throws LifecycleException

Implements abstract org.apache.catalina.util.LifecycleBase.stopInternal.

Stop Valves) in this pipeline and implement the requirements of LifecycleBase#stopInternal().

Annotations
@Override
Exceptions
LifecycleException:
if this component detects a fatal error that prevents this component from being used
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return a String representation of this component.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override