Class ValveBase
java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.valves.ValveBase
- All Implemented Interfaces:
MBeanRegistration
,Contained
,JmxEnabled
,Lifecycle
,Valve
- Direct Known Subclasses:
AbstractAccessLogValve
,AuthenticatorBase
,CrawlerSessionManagerValve
,ErrorReportValve
,HealthCheckValve
,JDBCAccessLogValve
,JvmRouteBinderValve
,LoadBalancerDrainingValve
,PersistentValve
,RemoteIpValve
,ReplicationValve
,RequestFilterValve
,RewriteValve
,SemaphoreValve
,SingleSignOn
,SSLValve
,StuckThreadDetectionValve
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Does this valve support Servlet 3+ async requests?protected Container
The Container whose pipeline this Valve is a component of.protected Log
Container logprotected Valve
The next Valve in the pipeline this Valve is a component of.protected static final StringManager
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Execute a periodic task, such as reloading, etc.Get theContainer
with which this instance is associated.Method implemented by sub-classes to identify the domain in which MBeans should be registered.getNext()
Returns the next Valve in this pipeline, ornull
if this is the last Valve in the pipeline.Allow sub-classes to specify the key properties component of theObjectName
that will be used to register this component.protected void
Sub-classes implement this method to perform any instance initialisation required.boolean
void
setAsyncSupported
(boolean asyncSupported) void
setContainer
(Container container) Set theContainer
with which this instance is associated.void
Set the next Valve in the pipeline containing this Valve.protected void
Start this component and implement the requirements ofLifecycleBase.startInternal()
.protected void
Stop this component and implement the requirements ofLifecycleBase.stopInternal()
.toString()
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister
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
-
sm
-
asyncSupported
protected boolean asyncSupportedDoes this valve support Servlet 3+ async requests? -
container
The Container whose pipeline this Valve is a component of. -
containerLog
Container log -
next
The next Valve in the pipeline this Valve is a component of.
-
-
Constructor Details
-
ValveBase
public ValveBase() -
ValveBase
public ValveBase(boolean asyncSupported)
-
-
Method Details
-
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
-
isAsyncSupported
public boolean isAsyncSupported()- Specified by:
isAsyncSupported
in interfaceValve
-
setAsyncSupported
public void setAsyncSupported(boolean asyncSupported) -
getNext
Description copied from interface:Valve
Returns the next Valve in this pipeline, ornull
if this is the last Valve in the pipeline. -
setNext
-
backgroundProcess
public void 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.
- Specified by:
backgroundProcess
in interfaceValve
-
initInternal
Description copied from class:LifecycleBase
Sub-classes implement this method to perform any instance initialisation required.- Overrides:
initInternal
in classLifecycleMBeanBase
- Throws:
LifecycleException
- If the initialisation fails
-
startInternal
Start this component and implement the requirements ofLifecycleBase.startInternal()
.- Specified by:
startInternal
in classLifecycleBase
- Throws:
LifecycleException
- if this component detects a fatal error that prevents this component from being used
-
stopInternal
Stop this component and implement the requirements ofLifecycleBase.stopInternal()
.- Specified by:
stopInternal
in classLifecycleBase
- Throws:
LifecycleException
- if this component detects a fatal error that prevents this component from being used
-
toString
-
getObjectNameKeyProperties
Description copied from class:LifecycleMBeanBase
Allow sub-classes to specify the key properties component of theObjectName
that will be used to register this component.- Specified by:
getObjectNameKeyProperties
in classLifecycleMBeanBase
- Returns:
- The string representation of the key properties component of the desired
ObjectName
-
getDomainInternal
Description copied from class:LifecycleMBeanBase
Method implemented by sub-classes to identify the domain in which MBeans should be registered.- Specified by:
getDomainInternal
in classLifecycleMBeanBase
- Returns:
- The name of the domain to use to register MBeans.
-