org.apache.catalina.core

Class StandardPipeline

public class StandardPipeline extends Object implements Pipeline, Contained, Lifecycle

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
protected Valvebasic
The basic Valve (if any) associated with this Pipeline.
protected Containercontainer
The Container with which this Pipeline is associated.
protected Valvefirst
The first valve associated with this Pipeline.
protected Stringinfo
Descriptive information about this implementation.
protected LifecycleSupportlifecycle
The lifecycle event support for this component.
protected static StringManagersm
The string manager for this package.
protected booleanstarted
Has this component been started yet?
Constructor Summary
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 Summary
voidaddLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
voidaddValve(Valve valve)

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

LifecycleListener[]findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle.
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()
StringgetInfo()
Return descriptive information about this implementation class.
ObjectName[]getValveObjectNames()
Valve[]getValves()
Return the set of Valves in the pipeline associated with this Container, including the basic Valve (if any).
voidremoveLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
voidremoveValve(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.
voidstart()
Prepare for active use of the public methods of this Component.
voidstop()
Gracefully shut down active use of the public methods of this Component.

Field Detail

basic

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

container

protected Container container
The Container with which this Pipeline is associated.

first

protected Valve first
The first valve associated with this Pipeline.

info

protected String info
Descriptive information about this implementation.

lifecycle

protected LifecycleSupport lifecycle
The lifecycle event support for this component.

sm

protected static StringManager sm
The string manager for this package.

started

protected boolean started
Has this component been started yet?

Constructor Detail

StandardPipeline

public StandardPipeline()
Construct a new StandardPipeline instance with no associated Container.

StandardPipeline

public 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

addLifecycleListener

public void addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.

Parameters: listener The listener to add

addValve

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

Throws: IllegalArgumentException if this Container refused to accept the specified Valve IllegalArgumentException if the specifie Valve refuses to be associated with this Container IllegalStateException if the specified Valve is already associated with a different Container

findLifecycleListeners

public LifecycleListener[] findLifecycleListeners()
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()

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

getContainer

public Container getContainer()
Return the Container with which this Pipeline is associated.

getFirst

public Valve getFirst()

getInfo

public String getInfo()
Return descriptive information about this implementation class.

getValveObjectNames

public ObjectName[] getValveObjectNames()

getValves

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

removeLifecycleListener

public void removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.

Parameters: listener The listener to remove

removeValve

public 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's setContainer(null) method will be called if it implements Contained.

Parameters: valve Valve to be removed

setBasic

public void setBasic(Valve valve)

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)
Set the Container with which this Pipeline is associated.

Parameters: container The new associated container

start

public void start()
Prepare for active use of the public methods of this Component.

Throws: LifecycleException if this component detects a fatal error that prevents it from being started

stop

public void stop()
Gracefully shut down active use of the public methods of this Component.

Throws: LifecycleException if this component detects a fatal error that needs to be reported

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.