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

public abstract Class ValveBase

extends LifecycleMBeanBase
implements Contained, Valve
Class Inheritance
All Implemented Interfaces
org.apache.catalina.Valve, org.apache.catalina.Contained
Known Direct Subclasses
org.apache.catalina.valves.rewrite.RewriteValve, org.apache.catalina.authenticator.AuthenticatorBase, org.apache.catalina.authenticator.SingleSignOn, org.apache.catalina.core.StandardContextValve, org.apache.catalina.core.StandardEngineValve, org.apache.catalina.core.StandardHostValve, org.apache.catalina.core.StandardWrapperValve, org.apache.catalina.valves.AbstractAccessLogValve, org.apache.catalina.valves.CrawlerSessionManagerValve, org.apache.catalina.valves.ErrorReportValve, org.apache.catalina.valves.HealthCheckValve, org.apache.catalina.valves.JDBCAccessLogValve, org.apache.catalina.valves.LoadBalancerDrainingValve, org.apache.catalina.valves.PersistentValve, org.apache.catalina.valves.RemoteIpValve, org.apache.catalina.valves.RequestFilterValve, org.apache.catalina.valves.SemaphoreValve, org.apache.catalina.valves.SSLValve, org.apache.catalina.valves.StuckThreadDetectionValve
Imports
org.apache.catalina.Contained, .Container, .LifecycleException, .LifecycleState, .Pipeline, .Valve, org.apache.catalina.util.LifecycleMBeanBase, .ToStringUtil, org.apache.juli.logging.Log, org.apache.tomcat.util.res.StringManager

Convenience base class for implementations of the Valve interface. A subclass MUST implement an invoke() method to provide the required functionality, and MAY implement the Lifecycle interface to provide configuration management and lifecycle support.
Author
Craig R. McClanahan

Field Summary

Modifier and TypeField and Description
protected boolean
asyncSupported

Does this valve support Servlet 3+ async requests?

protected Container
container

The Container whose pipeline this Valve is a component of.

protected Log
containerLog

Container log

protected Valve
next

The next Valve in the pipeline this Valve is a component of.

protected static final StringManager

Constructor Summary

AccessConstructor and Description
public
public
ValveBase(boolean asyncSupported)

Method Summary

Modifier and TypeMethod and Description
public void
backgroundProcess()

Implements org.apache.catalina.Valve.backgroundProcess.

Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container.

public Container
getContainer()

Implements org.apache.catalina.Contained.getContainer.

Get the Container with which this instance is associated.

public String
getDomainInternal()

Implements abstract org.apache.catalina.util.LifecycleMBeanBase.getDomainInternal.

Method implemented by sub-classes to identify the domain in which MBeans should be registered.

public Valve
getNext()

Implements org.apache.catalina.Valve.getNext.

Returns the next Valve in this pipeline, or null if this is the last Valve in the pipeline.

public String
getObjectNameKeyProperties()

Implements abstract org.apache.catalina.util.LifecycleMBeanBase.getObjectNameKeyProperties.

Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.

protected void
initInternal()

Overrides org.apache.catalina.util.LifecycleMBeanBase.initInternal.

Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

public boolean
public void
setAsyncSupported(boolean asyncSupported)

public void
setContainer(Container
The Container instance with which this instance is to be associated, or null to disassociate this instance from any Container
container
)

Implements org.apache.catalina.Contained.setContainer.

Set the Container with which this instance is associated.

public void
setNext(Valve
The new next valve, or null if none
valve
)

Implements org.apache.catalina.Valve.setNext.

Set the next Valve in the pipeline containing this Valve.

protected void
startInternal()

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

Start this component and implement the requirements of org.apache.catalina.util.LifecycleBase#startInternal().

protected void
stopInternal()

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

Stop this component and implement the requirements of org.apache.catalina.util.LifecycleBase#stopInternal().

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.catalina.util.LifecycleMBeanBase:
destroyInternalgetDomaingetObjectNamepostDeregisterpostRegisterpreDeregisterpreRegisterregistersetDomainunregisterunregister

Field Detail

asyncSupportedback to summary
protected boolean asyncSupported

Does this valve support Servlet 3+ async requests?

containerback to summary
protected Container container

The Container whose pipeline this Valve is a component of.

containerLogback to summary
protected Log containerLog

Container log

nextback to summary
protected Valve next

The next Valve in the pipeline this Valve is a component of.

smback to summary
protected static final StringManager sm

Hides org.apache.catalina.util.LifecycleMBeanBase.sm.

Constructor Detail

ValveBaseback to summary
public ValveBase()
ValveBaseback to summary
public ValveBase(boolean asyncSupported)

Method Detail

backgroundProcessback to summary
public void backgroundProcess()

Implements org.apache.catalina.Valve.backgroundProcess.

Doc from org.apache.catalina.Valve.backgroundProcess.

Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container. Unexpected throwables will be caught and logged.

The default implementation is NO-OP.

Annotations
@Override
getContainerback to summary
public Container getContainer()

Implements org.apache.catalina.Contained.getContainer.

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

Get the Container with which this instance is associated.

Returns:Container

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

Annotations
@Override
getDomainInternalback to summary
public String getDomainInternal()

Implements abstract org.apache.catalina.util.LifecycleMBeanBase.getDomainInternal.

Doc from org.apache.catalina.util.LifecycleMBeanBase.getDomainInternal.

Method implemented by sub-classes to identify the domain in which MBeans should be registered.

Returns:String

The name of the domain to use to register MBeans.

Annotations
@Override
getNextback to summary
public Valve getNext()

Implements org.apache.catalina.Valve.getNext.

Doc from org.apache.catalina.Valve.getNext.

Returns the next Valve in this pipeline, or null if this is the last Valve in the pipeline.

Returns:Valve

the next Valve in the pipeline containing this Valve, or null if this is the last Valve in the pipeline.

Annotations
@Override
getObjectNameKeyPropertiesback to summary
public String getObjectNameKeyProperties()

Implements abstract org.apache.catalina.util.LifecycleMBeanBase.getObjectNameKeyProperties.

Doc from org.apache.catalina.util.LifecycleMBeanBase.getObjectNameKeyProperties.

Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.

Returns:String

The string representation of the key properties component of the desired ObjectName

Annotations
@Override
initInternalback to summary
protected void initInternal() throws LifecycleException

Overrides org.apache.catalina.util.LifecycleMBeanBase.initInternal.

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

Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

Annotations
@Override
Exceptions
LifecycleException:

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

If the initialisation fails

isAsyncSupportedback to summary
public boolean isAsyncSupported()

Implements org.apache.catalina.Valve.isAsyncSupported.

Annotations
@Override
setAsyncSupportedback to summary
public void setAsyncSupported(boolean asyncSupported)
setContainerback to summary
public void setContainer(Container container)

Implements org.apache.catalina.Contained.setContainer.

Doc from org.apache.catalina.Contained.setContainer.

Set the Container with which this instance is associated.

Parameters
container:Container

The Container instance with which this instance is to be associated, or null to disassociate this instance from any Container

Annotations
@Override
setNextback to summary
public void setNext(Valve valve)

Implements org.apache.catalina.Valve.setNext.

Doc from org.apache.catalina.Valve.setNext.

Set the next Valve in the pipeline containing this Valve.

Parameters
valve:Valve

The new next valve, or null if none

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

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

Start this component and implement the requirements of org.apache.catalina.util.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 this component and implement the requirements of org.apache.catalina.util.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.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override