Package org.apache.catalina.core
Class StandardWrapper
- java.lang.Object
- 
- org.apache.catalina.util.LifecycleBase
- 
- org.apache.catalina.util.LifecycleMBeanBase
- 
- org.apache.catalina.core.ContainerBase
- 
- org.apache.catalina.core.StandardWrapper
 
 
 
 
- 
- All Implemented Interfaces:
- javax.management.MBeanRegistration,- javax.management.NotificationBroadcaster,- javax.management.NotificationEmitter,- ServletConfig,- Container,- JmxEnabled,- Lifecycle,- Wrapper
 - Direct Known Subclasses:
- Tomcat.ExistingStandardWrapper
 
 public class StandardWrapper extends ContainerBase implements ServletConfig, Wrapper, javax.management.NotificationEmitter Standard implementation of the Wrapper interface that represents an individual servlet definition. No child Containers are allowed, and the parent Container must be a Context.- Author:
- Craig R. McClanahan, Remy Maucherat
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBaseContainerBase.ContainerBackgroundProcessor, ContainerBase.ContainerBackgroundProcessorMonitor, ContainerBase.PrivilegedAddChild
 - 
Nested classes/interfaces inherited from interface org.apache.catalina.LifecycleLifecycle.SingleUse
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected booleanasyncSupportedAsync supportprotected longavailableThe date and time at which this servlet will become available (in milliseconds since the epoch), or zero if the servlet is available.protected javax.management.NotificationBroadcasterSupportbroadcasterThe broadcaster that sends j2ee notifications.protected intclassLoadTimeprotected static java.lang.Class<?>[]classTypeStatic class array used when the SecurityManager is turned on andServlet.initis invoked.protected java.util.concurrent.atomic.AtomicIntegercountAllocatedThe count of allocations that are currently active (even if they are for the same instance, as will be true on a non-STM servlet).protected static java.lang.String[]DEFAULT_SERVLET_METHODSprotected booleanenabledEnabledprotected StandardWrapperFacadefacadeThe facade associated with this wrapper.protected ServletinstanceThe (single) possibly uninitialized instance of this servlet.protected booleaninstanceInitializedFlag that indicates if this instance has been initializedprotected java.util.Stack<Servlet>instancePoolDeprecated.This will be removed in Tomcat 10.1 onwards.protected booleanisJspServletTrue if this StandardWrapper is for the JspServletprotected javax.management.ObjectNamejspMonitorONThe ObjectName of the JSP monitoring mbeanprotected intloadOnStartupThe load-on-startup order value (negative value means load on first call) for this servlet.protected longloadTimeprotected java.util.ArrayList<java.lang.String>mappingsMappings associated with the wrapper.protected intmaxInstancesDeprecated.This will be removed in Tomcat 10.1 onwards.protected MultipartConfigElementmultipartConfigElementMultipart configprotected intnInstancesDeprecated.This will be removed in Tomcat 10.1 onwards.protected javax.management.MBeanNotificationInfo[]notificationInfoprotected java.util.HashMap<java.lang.String,java.lang.String>parametersThe initialization parameters for this servlet, keyed by parameter name.protected java.util.HashMap<java.lang.String,java.lang.String>referencesThe security role references for this servlet, keyed by role name used in the servlet.protected java.lang.StringrunAsThe run-as identity for this servlet.protected longsequenceNumberThe notification sequence number.protected java.lang.StringservletClassThe fully qualified servlet class name for this servlet.protected booleansingleThreadModelDeprecated.This will be removed in Tomcat 10.1 onwards.protected booleanswallowOutputShould we swallow System.outprotected org.apache.catalina.core.StandardWrapperValveswValveprotected longunloadDelayWait time for servlet unload in ms.protected booleanunloadingAre we unloading our servlet instance at the moment?- 
Fields inherited from class org.apache.catalina.core.ContainerBaseaccessLog, backgroundProcessorDelay, backgroundProcessorFuture, children, cluster, listeners, logger, logName, monitorFuture, name, parent, parentClassLoader, pipeline, sm, startChildren, startStopExecutor, support
 - 
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBasemserver
 - 
Fields inherited from interface org.apache.catalina.ContainerADD_CHILD_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_VALVE_EVENT
 - 
Fields 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
 - 
Fields inherited from interface org.apache.catalina.WrapperADD_MAPPING_EVENT, REMOVE_MAPPING_EVENT
 
- 
 - 
Constructor SummaryConstructors Constructor Description StandardWrapper()Create a new StandardWrapper component with the default basic Valve.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddChild(Container child)Refuse to add a child Container, because Wrappers are the lowest level of the Container hierarchy.voidaddInitParameter(java.lang.String name, java.lang.String value)Add a new servlet initialization parameter for this servlet.voidaddMapping(java.lang.String mapping)Add a mapping associated with the Wrapper.voidaddNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object object)Add a JMX-NotificationListenervoidaddSecurityReference(java.lang.String name, java.lang.String link)Add a new security role reference record to the set of records for this servlet.Servletallocate()Allocate an initialized instance of this Servlet that is ready to have itsservice()method called.voidbackgroundProcess()Execute a periodic task, such as reloading, etc.voiddeallocate(Servlet servlet)Return this previously allocated servlet to the pool of available instances.java.lang.StringfindInitParameter(java.lang.String name)Return the value for the specified initialization parameter name, if any; otherwise returnnull.java.lang.String[]findInitParameters()Return the names of all defined initialization parameters for this servlet.java.lang.String[]findMappings()Return the mappings associated with this wrapper.java.lang.StringfindSecurityReference(java.lang.String name)Return the security role link for the specified security role reference name, if any; otherwise returnnull.java.lang.String[]findSecurityReferences()Return the set of security role reference names associated with this servlet, if any; otherwise return a zero-length array.protected java.lang.reflect.Method[]getAllDeclaredMethods(java.lang.Class<?> c)longgetAvailable()Return the available date/time for this servlet, in milliseconds since the epoch.intgetClassLoadTime()intgetCountAllocated()intgetErrorCount()java.lang.StringgetInitParameter(java.lang.String name)Returns aStringcontaining the value of the named initialization parameter, ornullif the parameter does not exist.java.util.Enumeration<java.lang.String>getInitParameterNames()Returns the names of the servlet's initialization parameters as anEnumerationofStringobjects, or an emptyEnumerationif the servlet has no initialization parameters.intgetLoadOnStartup()java.lang.StringgetLoadOnStartupString()longgetLoadTime()intgetMaxInstances()Deprecated.This will be removed in Tomcat 10.1 onwards.longgetMaxTime()longgetMinTime()MultipartConfigElementgetMultipartConfigElement()javax.management.MBeanNotificationInfo[]getNotificationInfo()Get JMX Broadcaster Infoprotected java.lang.StringgetObjectNameKeyProperties()Allow sub-classes to specify the key properties component of theObjectNamethat will be used to register this component.longgetProcessingTime()intgetRequestCount()static java.lang.ThrowablegetRootCause(ServletException e)Extract the root cause from a servlet exception.java.lang.StringgetRunAs()ServletgetServlet()java.lang.StringgetServletClass()ServletContextgetServletContext()Returns a reference to theServletContextin which the caller is executing.java.lang.String[]getServletMethods()Gets the names of the methods supported by the underlying servlet.java.lang.StringgetServletName()Returns the name of this servlet instance.voidincrementErrorCount()Increment the error count used for monitoring.booleanisAsyncSupported()Does the associated Servlet support async processing?booleanisEnabled()Is the associated Servlet enabled?booleanisOverridable()Is the Servlet overridable by a ServletContainerInitializer?java.lang.BooleanisSingleThreadModel()Deprecated.This will be removed in Tomcat 10.1 onwards.booleanisUnavailable()voidload()Load and initialize an instance of this servlet, if there is not already at least one initialized instance.ServletloadServlet()Load and initialize an instance of this servlet, if there is not already at least one initialized instance.voidremoveInitParameter(java.lang.String name)Remove the specified initialization parameter from this servlet.voidremoveMapping(java.lang.String mapping)Remove a mapping associated with the wrapper.voidremoveNotificationListener(javax.management.NotificationListener listener)Remove a JMX-NotificationListenervoidremoveNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object object)Remove a JMX notificationListenervoidremoveSecurityReference(java.lang.String name)Remove any security role reference for the specified role name.voidsetAsyncSupported(boolean asyncSupported)Set the async support for the associated Servlet.voidsetAvailable(long available)Set the available date/time for this servlet, in milliseconds since the epoch.voidsetEnabled(boolean enabled)Sets the enabled attribute for the associated servlet.voidsetLoadOnStartup(int value)Set the load-on-startup order value (negative value means load on first call).voidsetLoadOnStartupString(java.lang.String value)Set the load-on-startup order value from a (possibly null) string.voidsetMaxInstances(int maxInstances)Deprecated.This will be removed in Tomcat 10.1 onwards.voidsetMultipartConfigElement(MultipartConfigElement multipartConfigElement)Set the multi-part configuration for the associated Servlet.voidsetOverridable(boolean overridable)Sets the overridable attribute for this Servlet.voidsetParent(Container container)Set the parent Container of this Wrapper, but only if it is a Context.voidsetRunAs(java.lang.String runAs)Set the run-as identity for this servlet.voidsetServlet(Servlet servlet)Set the associated servlet instance.voidsetServletClass(java.lang.String servletClass)Set the fully qualified servlet class name for this servlet.voidsetServletName(java.lang.String name)Set the name of this servlet.protected voidstartInternal()Start this component and implement the requirements ofLifecycleBase.startInternal().protected voidstopInternal()Stop this component and implement the requirements ofLifecycleBase.stopInternal().voidunavailable(UnavailableException unavailable)Process an UnavailableException, marking this servlet as unavailable for the specified amount of time.voidunload()Unload all initialized instances of this servlet, after calling thedestroy()method for each instance.- 
Methods inherited from class org.apache.catalina.core.ContainerBaseaddContainerListener, addPropertyChangeListener, addValve, destroyInternal, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getCatalinaBase, getCatalinaHome, getChildren, getCluster, getClusterInternal, getDomainInternal, getLogger, getLogName, getMBeanKeyProperties, getName, getParent, getParentClassLoader, getPipeline, getRealm, getRealmInternal, getStartChildren, getStartStopThreads, logAccess, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setName, setParentClassLoader, setRealm, setStartChildren, setStartStopThreads, threadStart, threadStop, toString
 - 
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBasegetDomain, getObjectName, initInternal, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister
 - 
Methods inherited from class org.apache.catalina.util.LifecycleBaseaddLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.catalina.ContaineraddContainerListener, addPropertyChangeListener, findChild, findChildren, findContainerListeners, fireContainerEvent, getAccessLog, getBackgroundProcessorDelay, getCatalinaBase, getCatalinaHome, getCluster, getDomain, getLogger, getLogName, getMBeanKeyProperties, getName, getObjectName, getParent, getParentClassLoader, getPipeline, getRealm, getStartStopThreads, logAccess, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setName, setParentClassLoader, setRealm, setStartStopThreads
 - 
Methods inherited from interface org.apache.catalina.LifecycleaddLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_SERVLET_METHODSprotected static final java.lang.String[] DEFAULT_SERVLET_METHODS 
 - 
availableprotected long available The date and time at which this servlet will become available (in milliseconds since the epoch), or zero if the servlet is available. If this value equals Long.MAX_VALUE, the unavailability of this servlet is considered permanent.
 - 
broadcasterprotected final javax.management.NotificationBroadcasterSupport broadcaster The broadcaster that sends j2ee notifications.
 - 
countAllocatedprotected final java.util.concurrent.atomic.AtomicInteger countAllocated The count of allocations that are currently active (even if they are for the same instance, as will be true on a non-STM servlet).
 - 
facadeprotected final StandardWrapperFacade facade The facade associated with this wrapper.
 - 
instanceprotected volatile Servlet instance The (single) possibly uninitialized instance of this servlet.
 - 
instanceInitializedprotected volatile boolean instanceInitialized Flag that indicates if this instance has been initialized
 - 
loadOnStartupprotected int loadOnStartup The load-on-startup order value (negative value means load on first call) for this servlet.
 - 
mappingsprotected final java.util.ArrayList<java.lang.String> mappings Mappings associated with the wrapper.
 - 
parametersprotected java.util.HashMap<java.lang.String,java.lang.String> parameters The initialization parameters for this servlet, keyed by parameter name.
 - 
referencesprotected java.util.HashMap<java.lang.String,java.lang.String> references The security role references for this servlet, keyed by role name used in the servlet. The corresponding value is the role name of the web application itself.
 - 
runAsprotected java.lang.String runAs The run-as identity for this servlet.
 - 
sequenceNumberprotected long sequenceNumber The notification sequence number.
 - 
servletClassprotected java.lang.String servletClass The fully qualified servlet class name for this servlet.
 - 
singleThreadModel@Deprecated protected volatile boolean singleThreadModel Deprecated.This will be removed in Tomcat 10.1 onwards.Does this servlet implement the SingleThreadModel interface?
 - 
unloadingprotected volatile boolean unloading Are we unloading our servlet instance at the moment?
 - 
maxInstances@Deprecated protected int maxInstances Deprecated.This will be removed in Tomcat 10.1 onwards.Maximum number of STM instances.
 - 
nInstances@Deprecated protected int nInstances Deprecated.This will be removed in Tomcat 10.1 onwards.Number of instances currently loaded for a STM servlet.
 - 
instancePool@Deprecated protected java.util.Stack<Servlet> instancePool Deprecated.This will be removed in Tomcat 10.1 onwards.Stack containing the STM instances.
 - 
unloadDelayprotected long unloadDelay Wait time for servlet unload in ms.
 - 
isJspServletprotected boolean isJspServlet True if this StandardWrapper is for the JspServlet
 - 
jspMonitorONprotected javax.management.ObjectName jspMonitorON The ObjectName of the JSP monitoring mbean
 - 
swallowOutputprotected boolean swallowOutput Should we swallow System.out
 - 
swValveprotected org.apache.catalina.core.StandardWrapperValve swValve 
 - 
loadTimeprotected long loadTime 
 - 
classLoadTimeprotected int classLoadTime 
 - 
multipartConfigElementprotected MultipartConfigElement multipartConfigElement Multipart config
 - 
asyncSupportedprotected boolean asyncSupported Async support
 - 
enabledprotected boolean enabled Enabled
 - 
classTypeprotected static java.lang.Class<?>[] classType Static class array used when the SecurityManager is turned on andServlet.initis invoked.
 - 
notificationInfoprotected javax.management.MBeanNotificationInfo[] notificationInfo 
 
- 
 - 
Method Detail- 
isOverridablepublic boolean isOverridable() Description copied from interface:WrapperIs the Servlet overridable by a ServletContainerInitializer?- Specified by:
- isOverridablein interface- Wrapper
- Returns:
- trueif the Servlet can be overridden in a ServletContainerInitializer
 
 - 
setOverridablepublic void setOverridable(boolean overridable) Description copied from interface:WrapperSets the overridable attribute for this Servlet.- Specified by:
- setOverridablein interface- Wrapper
- Parameters:
- overridable- the new value
 
 - 
getAvailablepublic long getAvailable() Return the available date/time for this servlet, in milliseconds since the epoch. If this date/time is Long.MAX_VALUE, it is considered to mean that unavailability is permanent and any request for this servlet will return an SC_NOT_FOUND error. If this date/time is in the future, any request for this servlet will return an SC_SERVICE_UNAVAILABLE error. If it is zero, the servlet is currently available.- Specified by:
- getAvailablein interface- Wrapper
- Returns:
- the available date/time for this servlet, in milliseconds since the epoch. If this date/time is in the future, any request for this servlet will return an SC_SERVICE_UNAVAILABLE error. If it is zero, the servlet is currently available. A value equal to Long.MAX_VALUE is considered to mean that unavailability is permanent.
 
 - 
setAvailablepublic void setAvailable(long available) Set the available date/time for this servlet, in milliseconds since the epoch. If this date/time is Long.MAX_VALUE, it is considered to mean that unavailability is permanent and any request for this servlet will return an SC_NOT_FOUND error. If this date/time is in the future, any request for this servlet will return an SC_SERVICE_UNAVAILABLE error.- Specified by:
- setAvailablein interface- Wrapper
- Parameters:
- available- The new available date/time
 
 - 
getCountAllocatedpublic int getCountAllocated() - Returns:
- the number of active allocations of this servlet, even if they are all for the same instance (as will be
             true for servlets that do not implement SingleThreadModel.
 
 - 
getLoadOnStartuppublic int getLoadOnStartup() - Specified by:
- getLoadOnStartupin interface- Wrapper
- Returns:
- the load-on-startup order value (negative value means load on first call).
 
 - 
setLoadOnStartuppublic void setLoadOnStartup(int value) Set the load-on-startup order value (negative value means load on first call).- Specified by:
- setLoadOnStartupin interface- Wrapper
- Parameters:
- value- New load-on-startup value
 
 - 
setLoadOnStartupStringpublic void setLoadOnStartupString(java.lang.String value) Set the load-on-startup order value from a (possibly null) string. Per the specification, any missing or non-numeric value is converted to a zero, so that this servlet will still be loaded at startup time, but in an arbitrary order.- Parameters:
- value- New load-on-startup value
 
 - 
getLoadOnStartupStringpublic java.lang.String getLoadOnStartupString() - Returns:
- the load-on-startup value that was parsed
 
 - 
getMaxInstances@Deprecated public int getMaxInstances() Deprecated.This will be removed in Tomcat 10.1 onwards.- Returns:
- maximum number of instances that will be allocated when a single thread model servlet is used.
 
 - 
setMaxInstances@Deprecated public void setMaxInstances(int maxInstances) Deprecated.This will be removed in Tomcat 10.1 onwards.Set the maximum number of instances that will be allocated when a single thread model servlet is used.- Parameters:
- maxInstances- New value of maxInstances
 
 - 
setParentpublic void setParent(Container container) Set the parent Container of this Wrapper, but only if it is a Context.- Specified by:
- setParentin interface- Container
- Overrides:
- setParentin class- ContainerBase
- Parameters:
- container- Proposed parent Container
 
 - 
getRunAspublic java.lang.String getRunAs() 
 - 
setRunAspublic void setRunAs(java.lang.String runAs) Set the run-as identity for this servlet.
 - 
getServletClasspublic java.lang.String getServletClass() - Specified by:
- getServletClassin interface- Wrapper
- Returns:
- the fully qualified servlet class name for this servlet.
 
 - 
setServletClasspublic void setServletClass(java.lang.String servletClass) Set the fully qualified servlet class name for this servlet.- Specified by:
- setServletClassin interface- Wrapper
- Parameters:
- servletClass- Servlet class name
 
 - 
setServletNamepublic void setServletName(java.lang.String name) Set the name of this servlet. This is an alias for the normalContainer.setName()method, and complements thegetServletName()method required by theServletConfiginterface.- Parameters:
- name- The new name of this servlet
 
 - 
isSingleThreadModel@Deprecated public java.lang.Boolean isSingleThreadModel() Deprecated.This will be removed in Tomcat 10.1 onwards.Does the servlet class represented by this component implement theSingleThreadModelinterface? This can only be determined once the class is loaded. Calling this method will not trigger loading the class since that may cause the application to behave unexpectedly.- Returns:
- nullif the class has not been loaded, otherwise- trueif the servlet does implement- SingleThreadModeland- falseif it does not.
 
 - 
isUnavailablepublic boolean isUnavailable() - Specified by:
- isUnavailablein interface- Wrapper
- Returns:
- trueif the Servlet has been marked unavailable.
 
 - 
getServletMethodspublic java.lang.String[] getServletMethods() throws ServletExceptionDescription copied from interface:WrapperGets the names of the methods supported by the underlying servlet. This is the same set of methods included in the Allow response header in response to an OPTIONS request method processed by the underlying servlet.- Specified by:
- getServletMethodsin interface- Wrapper
- Returns:
- Array of names of the methods supported by the underlying servlet
- Throws:
- ServletException- If the target servlet cannot be loaded
 
 - 
getServletpublic Servlet getServlet() - Specified by:
- getServletin interface- Wrapper
- Returns:
- the associated servlet instance.
 
 - 
setServletpublic void setServlet(Servlet servlet) Set the associated servlet instance.- Specified by:
- setServletin interface- Wrapper
- Parameters:
- servlet- The associated Servlet
 
 - 
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.- Specified by:
- backgroundProcessin interface- Container
- Overrides:
- backgroundProcessin class- ContainerBase
 
 - 
getRootCausepublic static java.lang.Throwable getRootCause(ServletException e) Extract the root cause from a servlet exception.- Parameters:
- e- The servlet exception
- Returns:
- the root cause of the Servlet exception
 
 - 
addChildpublic void addChild(Container child) Refuse to add a child Container, because Wrappers are the lowest level of the Container hierarchy.- Specified by:
- addChildin interface- Container
- Overrides:
- addChildin class- ContainerBase
- Parameters:
- child- Child container to be added
 
 - 
addInitParameterpublic void addInitParameter(java.lang.String name, java.lang.String value)Add a new servlet initialization parameter for this servlet.- Specified by:
- addInitParameterin interface- Wrapper
- Parameters:
- name- Name of this initialization parameter to add
- value- Value of this initialization parameter to add
 
 - 
addMappingpublic void addMapping(java.lang.String mapping) Add a mapping associated with the Wrapper.- Specified by:
- addMappingin interface- Wrapper
- Parameters:
- mapping- The new wrapper mapping
 
 - 
addSecurityReferencepublic void addSecurityReference(java.lang.String name, java.lang.String link)Add a new security role reference record to the set of records for this servlet.- Specified by:
- addSecurityReferencein interface- Wrapper
- Parameters:
- name- Role name used within this servlet
- link- Role name used within the web application
 
 - 
allocatepublic Servlet allocate() throws ServletException Allocate an initialized instance of this Servlet that is ready to have itsservice()method called. If the servlet class does not implementSingleThreadModel, the (only) initialized instance may be returned immediately. If the servlet class implementsSingleThreadModel, the Wrapper implementation must ensure that this instance is not allocated again until it is deallocated by a call todeallocate().- Specified by:
- allocatein interface- Wrapper
- Returns:
- a new Servlet instance
- Throws:
- ServletException- if the servlet init() method threw an exception
- ServletException- if a loading error occurs
 
 - 
deallocatepublic void deallocate(Servlet servlet) throws ServletException Return this previously allocated servlet to the pool of available instances. If this servlet class does not implement SingleThreadModel, no action is actually required.- Specified by:
- deallocatein interface- Wrapper
- Parameters:
- servlet- The servlet to be returned
- Throws:
- ServletException- if a deallocation error occurs
 
 - 
findInitParameterpublic java.lang.String findInitParameter(java.lang.String name) Return the value for the specified initialization parameter name, if any; otherwise returnnull.- Specified by:
- findInitParameterin interface- Wrapper
- Parameters:
- name- Name of the requested initialization parameter
- Returns:
- the value for the specified initialization parameter name,
 if any; otherwise return null.
 
 - 
findInitParameterspublic java.lang.String[] findInitParameters() Return the names of all defined initialization parameters for this servlet.- Specified by:
- findInitParametersin interface- Wrapper
- Returns:
- the names of all defined initialization parameters for this servlet.
 
 - 
findMappingspublic java.lang.String[] findMappings() Return the mappings associated with this wrapper.- Specified by:
- findMappingsin interface- Wrapper
- Returns:
- the mappings associated with this wrapper.
 
 - 
findSecurityReferencepublic java.lang.String findSecurityReference(java.lang.String name) Return the security role link for the specified security role reference name, if any; otherwise returnnull.- Specified by:
- findSecurityReferencein interface- Wrapper
- Parameters:
- name- Security role reference used within this servlet
- Returns:
- the security role link for the specified security role
 reference name, if any; otherwise return null.
 
 - 
findSecurityReferencespublic java.lang.String[] findSecurityReferences() Return the set of security role reference names associated with this servlet, if any; otherwise return a zero-length array.- Specified by:
- findSecurityReferencesin interface- Wrapper
- Returns:
- the set of security role reference names associated with this servlet, if any; otherwise return a zero-length array.
 
 - 
loadpublic void load() throws ServletExceptionLoad and initialize an instance of this servlet, if there is not already at least one initialized instance. This can be used, for example, to load servlets that are marked in the deployment descriptor to be loaded at server startup time.IMPLEMENTATION NOTE: Servlets whose classnames begin with org.apache.catalina.(so-called "container" servlets) are loaded by the same classloader that loaded this class, rather than the classloader for the current web application. This gives such classes access to Catalina internals, which are prevented for classes loaded for web applications.- Specified by:
- loadin interface- Wrapper
- Throws:
- ServletException- if the servlet init() method threw an exception
- ServletException- if some other loading problem occurs
 
 - 
loadServletpublic Servlet loadServlet() throws ServletException Load and initialize an instance of this servlet, if there is not already at least one initialized instance. This can be used, for example, to load servlets that are marked in the deployment descriptor to be loaded at server startup time.- Returns:
- the loaded Servlet instance
- Throws:
- ServletException- for a Servlet load error
 
 - 
removeInitParameterpublic void removeInitParameter(java.lang.String name) Remove the specified initialization parameter from this servlet.- Specified by:
- removeInitParameterin interface- Wrapper
- Parameters:
- name- Name of the initialization parameter to remove
 
 - 
removeMappingpublic void removeMapping(java.lang.String mapping) Remove a mapping associated with the wrapper.- Specified by:
- removeMappingin interface- Wrapper
- Parameters:
- mapping- The pattern to remove
 
 - 
removeSecurityReferencepublic void removeSecurityReference(java.lang.String name) Remove any security role reference for the specified role name.- Specified by:
- removeSecurityReferencein interface- Wrapper
- Parameters:
- name- Security role used within this servlet to be removed
 
 - 
unavailablepublic void unavailable(UnavailableException unavailable) Process an UnavailableException, marking this servlet as unavailable for the specified amount of time.- Specified by:
- unavailablein interface- Wrapper
- Parameters:
- unavailable- The exception that occurred, or- nullto mark this servlet as permanently unavailable
 
 - 
unloadpublic void unload() throws ServletExceptionUnload all initialized instances of this servlet, after calling thedestroy()method for each instance. This can be used, for example, prior to shutting down the entire servlet engine, or prior to reloading all of the classes from the Loader associated with our Loader's repository.- Specified by:
- unloadin interface- Wrapper
- Throws:
- ServletException- if an exception is thrown by the destroy() method
 
 - 
getInitParameterpublic java.lang.String getInitParameter(java.lang.String name) Description copied from interface:javax.servlet.ServletConfigReturns aStringcontaining the value of the named initialization parameter, ornullif the parameter does not exist.- Specified by:
- getInitParameterin interface- ServletConfig
- Parameters:
- name- Name of the initialization parameter to retrieve
- Returns:
- the initialization parameter value for the specified name, if any; otherwise return null.
 
 - 
getInitParameterNamespublic java.util.Enumeration<java.lang.String> getInitParameterNames() Description copied from interface:javax.servlet.ServletConfigReturns the names of the servlet's initialization parameters as anEnumerationofStringobjects, or an emptyEnumerationif the servlet has no initialization parameters.- Specified by:
- getInitParameterNamesin interface- ServletConfig
- Returns:
- the set of initialization parameter names defined for this servlet. If none are defined, an empty Enumeration is returned.
 
 - 
getServletContextpublic ServletContext getServletContext() Description copied from interface:javax.servlet.ServletConfigReturns a reference to theServletContextin which the caller is executing.- Specified by:
- getServletContextin interface- ServletConfig
- Returns:
- the servlet context with which this servlet is associated.
- See Also:
- ServletContext
 
 - 
getServletNamepublic java.lang.String getServletName() Description copied from interface:javax.servlet.ServletConfigReturns the name of this servlet instance. The name may be provided via server administration, assigned in the web application deployment descriptor, or for an unregistered (and thus unnamed) servlet instance it will be the servlet's class name.- Specified by:
- getServletNamein interface- ServletConfig
- Returns:
- the name of this servlet.
 
 - 
getProcessingTimepublic long getProcessingTime() 
 - 
getMaxTimepublic long getMaxTime() 
 - 
getMinTimepublic long getMinTime() 
 - 
getRequestCountpublic int getRequestCount() 
 - 
getErrorCountpublic int getErrorCount() 
 - 
incrementErrorCountpublic void incrementErrorCount() Increment the error count used for monitoring.- Specified by:
- incrementErrorCountin interface- Wrapper
 
 - 
getLoadTimepublic long getLoadTime() 
 - 
getClassLoadTimepublic int getClassLoadTime() 
 - 
getMultipartConfigElementpublic MultipartConfigElement getMultipartConfigElement() - Specified by:
- getMultipartConfigElementin interface- Wrapper
- Returns:
- the multi-part configuration for the associated Servlet. If no
 multi-part configuration has been defined, then nullwill be returned.
 
 - 
setMultipartConfigElementpublic void setMultipartConfigElement(MultipartConfigElement multipartConfigElement) Description copied from interface:WrapperSet the multi-part configuration for the associated Servlet. To clear the multi-part configuration specifynullas the new value.- Specified by:
- setMultipartConfigElementin interface- Wrapper
- Parameters:
- multipartConfigElement- The configuration associated with the Servlet
 
 - 
isAsyncSupportedpublic boolean isAsyncSupported() Description copied from interface:WrapperDoes the associated Servlet support async processing? Defaults tofalse.- Specified by:
- isAsyncSupportedin interface- Wrapper
- Returns:
- trueif the Servlet supports async
 
 - 
setAsyncSupportedpublic void setAsyncSupported(boolean asyncSupported) Description copied from interface:WrapperSet the async support for the associated Servlet.- Specified by:
- setAsyncSupportedin interface- Wrapper
- Parameters:
- asyncSupported- the new value
 
 - 
isEnabledpublic boolean isEnabled() Description copied from interface:WrapperIs the associated Servlet enabled? Defaults totrue.
 - 
setEnabledpublic void setEnabled(boolean enabled) Description copied from interface:WrapperSets the enabled attribute for the associated servlet.- Specified by:
- setEnabledin interface- Wrapper
- Parameters:
- enabled- the new value
 
 - 
getAllDeclaredMethodsprotected java.lang.reflect.Method[] getAllDeclaredMethods(java.lang.Class<?> c) 
 - 
startInternalprotected void startInternal() throws LifecycleExceptionStart this component and implement the requirements ofLifecycleBase.startInternal().- Overrides:
- startInternalin class- ContainerBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
 - 
stopInternalprotected void stopInternal() throws LifecycleExceptionStop this component and implement the requirements ofLifecycleBase.stopInternal().- Overrides:
- stopInternalin class- ContainerBase
- Throws:
- LifecycleException- if this component detects a fatal error that prevents this component from being used
 
 - 
getObjectNameKeyPropertiesprotected java.lang.String getObjectNameKeyProperties() Description 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
 
 - 
removeNotificationListenerpublic void removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object object) throws javax.management.ListenerNotFoundExceptionRemove a JMX notificationListener- Specified by:
- removeNotificationListenerin interface- javax.management.NotificationEmitter
- Throws:
- javax.management.ListenerNotFoundException
- See Also:
- NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
 
 - 
getNotificationInfopublic javax.management.MBeanNotificationInfo[] getNotificationInfo() Get JMX Broadcaster Info- Specified by:
- getNotificationInfoin interface- javax.management.NotificationBroadcaster
- See Also:
- NotificationBroadcaster.getNotificationInfo()
 
 - 
addNotificationListenerpublic void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object object) throws java.lang.IllegalArgumentExceptionAdd a JMX-NotificationListener- Specified by:
- addNotificationListenerin interface- javax.management.NotificationBroadcaster
- Throws:
- java.lang.IllegalArgumentException
- See Also:
- NotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
 
 - 
removeNotificationListenerpublic void removeNotificationListener(javax.management.NotificationListener listener) throws javax.management.ListenerNotFoundExceptionRemove a JMX-NotificationListener- Specified by:
- removeNotificationListenerin interface- javax.management.NotificationBroadcaster
- Throws:
- javax.management.ListenerNotFoundException
- See Also:
- NotificationBroadcaster.removeNotificationListener(javax.management.NotificationListener)
 
 
- 
 
-