Package org.apache.catalina.valves
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 SummaryNested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanDoes this valve support Servlet 3+ async requests?protected ContainerThe Container whose pipeline this Valve is a component of.protected LogContainer logprotected ValveThe next Valve in the pipeline this Valve is a component of.protected static final StringManagerFields inherited from interface org.apache.catalina.LifecycleAFTER_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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidExecute a periodic task, such as reloading, etc.Get theContainerwith 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, ornullif this is the last Valve in the pipeline.Allow sub-classes to specify the key properties component of theObjectNamethat will be used to register this component.protected voidSub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.booleanvoidsetAsyncSupported(boolean asyncSupported) voidsetContainer(Container container) Set theContainerwith which this instance is associated.voidSet the next Valve in the pipeline containing this Valve.protected voidStart this component and implement the requirements ofLifecycleBase.startInternal().protected voidStop this component and implement the requirements ofLifecycleBase.stopInternal().toString()Methods inherited from class org.apache.catalina.util.LifecycleMBeanBasedestroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisterMethods inherited from class org.apache.catalina.util.LifecycleBaseaddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
- 
Field Details- 
sm
- 
asyncSupportedprotected boolean asyncSupportedDoes this valve support Servlet 3+ async requests?
- 
containerThe Container whose pipeline this Valve is a component of.
- 
containerLogContainer log
- 
nextThe next Valve in the pipeline this Valve is a component of.
 
- 
- 
Constructor Details- 
ValveBasepublic ValveBase()
- 
ValveBasepublic ValveBase(boolean asyncSupported) 
 
- 
- 
Method Details- 
getContainerDescription copied from interface:ContainedGet theContainerwith which this instance is associated.- Specified by:
- getContainerin interface- Contained
- Returns:
- The Container with which this instance is associated or
         nullif not associated with a Container
 
- 
setContainerDescription copied from interface:ContainedSet theContainerwith which this instance is associated.- Specified by:
- setContainerin interface- Contained
- Parameters:
- container- The Container instance with which this instance is to be associated, or- nullto disassociate this instance from any Container
 
- 
isAsyncSupportedpublic boolean isAsyncSupported()- Specified by:
- isAsyncSupportedin interface- Valve
 
- 
setAsyncSupportedpublic void setAsyncSupported(boolean asyncSupported) 
- 
getNextDescription copied from interface:ValveReturns the next Valve in this pipeline, ornullif this is the last Valve in the pipeline.
- 
setNextDescription copied from interface:ValveSet the next Valve in the pipeline containing this Valve.
- 
backgroundProcesspublic 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:
- backgroundProcessin interface- Valve
 
- 
initInternalDescription copied from class:LifecycleMBeanBaseSub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.- Overrides:
- initInternalin class- LifecycleMBeanBase
- Throws:
- LifecycleException- If the initialisation fails
 
- 
startInternalStart this component and implement the requirements ofLifecycleBase.startInternal().- Specified by:
- startInternalin class- LifecycleBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
- 
stopInternalStop this component and implement the requirements ofLifecycleBase.stopInternal().- Specified by:
- stopInternalin class- LifecycleBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
- 
toString
- 
getObjectNameKeyPropertiesDescription copied from class:LifecycleMBeanBaseAllow sub-classes to specify the key properties component of theObjectNamethat will be used to register this component.- Specified by:
- getObjectNameKeyPropertiesin class- LifecycleMBeanBase
- Returns:
- The string representation of the key properties component of the
          desired ObjectName
 
- 
getDomainInternalDescription copied from class:LifecycleMBeanBaseMethod implemented by sub-classes to identify the domain in which MBeans should be registered.- Specified by:
- getDomainInternalin class- LifecycleMBeanBase
- Returns:
- The name of the domain to use to register MBeans.
 
 
-