public class StandardPipeline extends Object implements Pipeline, Contained, Lifecycle
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.| Modifier and Type | Field and Description |
|---|---|
protected GlassFishValve |
basic
The basic Valve (if any) associated with this Pipeline.
|
protected Container |
container
The Container with which this Pipeline is associated.
|
protected static String |
info
Descriptive information about this implementation.
|
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component.
|
protected boolean |
started
Has this component been started yet?
|
protected GlassFishValve[] |
valves
The set of Valves (not including the Basic one, if any) associated with
this Pipeline.
|
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT| Constructor and 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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
void |
addValve(GlassFishValve valve)
Add a new Valve to the end of the pipeline associated with this
Container.
|
void |
addValve(Valve valve)
Add Tomcat-style valve.
|
void |
doChainInvoke(Request request,
Response response) |
List<LifecycleListener> |
findLifecycleListeners()
Gets the (possibly empty) list of lifecycle listeners
associated with this Pipeline.
|
GlassFishValve |
getBasic()
Return the Valve instance that has been distinguished as the basic
Valve for this Pipeline (if any).
|
Container |
getContainer()
Return the Container with which this Pipeline is associated.
|
String |
getInfo()
Return descriptive information about this implementation class.
|
ObjectName[] |
getValveObjectNames() |
GlassFishValve[] |
getValves()
Return the set of Valves in the pipeline associated with this
Container, including the basic Valve (if any).
|
boolean |
hasNonBasicValves() |
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 t)
Logs the given message to the Logger associated with the Container
(if any) of this StandardPipeline.
|
void |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
|
void |
removeValve(GlassFishValve valve)
Remove the specified Valve from the pipeline associated with this
Container, if it is found; otherwise, do nothing.
|
void |
setBasic(GlassFishValve valve)
Set the Valve instance that has been distinguished as the basic
Valve for this Pipeline (if any).
|
void |
setContainer(Container container)
Set the Container with which this Pipeline is associated.
|
void |
start()
Prepare for active use of the public methods of this Component.
|
void |
stop()
Gracefully shut down active use of the public methods of this Component.
|
protected GlassFishValve basic
protected Container container
protected static final String info
protected LifecycleSupport lifecycle
protected boolean started
protected GlassFishValve[] valves
public StandardPipeline()
public StandardPipeline(Container container)
container - The container we should be associated withpublic String getInfo()
public Container getContainer()
getContainer in interface Containedpublic void setContainer(Container container)
setContainer in interface Containedcontainer - The new associated containerpublic void addLifecycleListener(LifecycleListener listener)
addLifecycleListener in interface Lifecyclelistener - The listener to addpublic List<LifecycleListener> findLifecycleListeners()
findLifecycleListeners in interface Lifecyclepublic void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener in interface Lifecyclelistener - The listener to removepublic void start()
throws LifecycleException
start in interface LifecycleIllegalStateException - if this component has already been
startedLifecycleException - if this component detects a fatal error
that prevents it from being startedpublic void stop()
throws LifecycleException
stop in interface LifecycleIllegalStateException - if this component has not been startedLifecycleException - if this component detects a fatal error
that needs to be reportedpublic GlassFishValve getBasic()
Return the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).
public void setBasic(GlassFishValve 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
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.
public void addValve(GlassFishValve 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.
addValve in interface Pipelinevalve - Valve to be addedIllegalArgumentException - if this Container refused to
accept the specified ValveIllegalArgumentException - if the specified Valve refuses to be
associated with this ContainerIllegalStateException - if the specified Valve is already
associated with a different Containerpublic void addValve(Valve valve)
public GlassFishValve[] getValves()
public boolean hasNonBasicValves()
hasNonBasicValves in interface Pipelinepublic ObjectName[] getValveObjectNames()
public void invoke(Request request, Response response) throws IOException, javax.servlet.ServletException
invoke in interface Pipelinerequest - The servlet request we are processingresponse - The servlet response we are creatingIOException - if an input/output error occursjavax.servlet.ServletException - if a servlet exception is thrownpublic void doChainInvoke(Request request, Response response) throws IOException, javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic void removeValve(GlassFishValve valve)
setContainer(null) method
will be called if it implements Contained.removeValve in interface Pipelinevalve - Valve to be removedprotected void log(String message)
message - Message to be loggedCopyright © 2017. All rights reserved.