Package org.apache.catalina.core
Class StandardWrapper
- java.lang.Object
-
- org.apache.catalina.core.ContainerBase
-
- org.apache.catalina.core.StandardWrapper
-
public class StandardWrapper extends ContainerBase implements jakarta.servlet.ServletConfig, Wrapper
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.- Version:
- $Revision: 1.12.2.1 $ $Date: 2008/04/17 18:37:09 $
- Author:
- Craig R. McClanahan, Remy Maucherat
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBase
ContainerBase.ContainerBackgroundProcessor, ContainerBase.PrivilegedAddChild
-
-
Field Summary
Fields Modifier and Type Field Description protected booleaninstanceInitializedFlag that indicates if this instance has been initializedprotected longunloadDelayWait time for servlet unload in ms.-
Fields inherited from class org.apache.catalina.core.ContainerBase
backgroundProcessorDelay, checkIfRequestIsSecure, children, controller, domain, hasCustomPipeline, initialized, lifecycle, listeners, loader, log, logger, manager, name, notifyContainerListeners, oname, parent, parentClassLoader, pipeline, rb, readLock, realm, resources, started, support, writeLock
-
Fields inherited from interface org.apache.catalina.Container
ADD_CHILD_EVENT, ADD_MAPPER_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_MAPPER_EVENT, REMOVE_VALVE_EVENT
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description StandardWrapper()Create a new StandardWrapper component with the default basic Valve.
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.protected voidaddDefaultMapper(String mapperClass)Add a default Mapper implementation if none have been configured explicitly.voidaddInitParameter(String name, String value)Adds the initialization parameter with the given name and value to this servlet.voidaddInstanceListener(InstanceListener listener)Add a new listener interested in InstanceEvents.voidaddMapping(String mapping)Add a mapping associated with theWrapper.voidaddSecurityReference(String name, String link)Add a new security role reference record to the set of records for this servlet.voidaddValve(GlassFishValve valve)Add a new Valve to the end of the pipeline associated with this Container.jakarta.servlet.Servletallocate()Allocate an initialized instance of this Servlet that is ready to have itsservice()method called.voiddeallocate(jakarta.servlet.Servlet servlet)Return this previously allocated servlet to the pool of available instances.StringfindInitParameter(String name)Return the value for the specified initialization parameter name, if any; otherwise returnnull.String[]findInitParameters()Return the names of all defined initialization parameters for this servlet.WrapperfindMappingObject()FIXME: Fooling introspection ...String[]findMappings()Return the mappings associated with this wrapper.StringfindSecurityReference(String name)Return the security role link for the specified security role reference name, if any; otherwise returnnull.String[]findSecurityReferences()Return the set of security role reference names associated with this servlet, if any; otherwise return a zero-length array.longgetAvailable()Return the available date/time for this servlet, in milliseconds since the epoch.intgetClassLoadTime()Gets how long it took for the servlet class to be loaded.intgetCountAllocated()Return 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 implementSingleThreadModel.intgetDebug()Return the debugging detail level for this component.StringgetDescription()Gets the description of this servlet.StringgetEngineName()StringgetInfo()Return descriptive information about this Container implementation and the corresponding version number, in the format<description>/<version>.StringgetInitParameter(String name)Return the initialization parameter value for the specified name, if any; otherwise returnnull.Enumeration<String>getInitParameterNames()Return the set of initialization parameter names defined for this servlet.Map<String,String>getInitParameters()InstanceSupportgetInstanceSupport()Return the InstanceSupport object for this Wrapper instance.StringgetJspFile()Return the context-relative URI of the JSP file for this servlet.intgetLoadOnStartup()Return the load-on-startup order value (negative value means load on first call).StringgetLoadOnStartupString()longgetLoadTime()Gets how long it took for the servlet to be loaded.Collection<String>getMappings()Gets all the mapping associated with theWrapper.intgetMaxInstances()Return maximum number of instances that will be allocated when a single thread model servlet is used.intgetMultipartFileSizeThreshold()Gets the multipart file-size-thresholStringgetMultipartLocation()Gets the multipart locationlonggetMultipartMaxFileSize()Gets the multipart max-file-sizelonggetMultipartMaxRequestSize()Gets the multipart max-request-Sizestatic ThrowablegetRootCause(jakarta.servlet.ServletException e)Extract the root cause from a servlet exception.StringgetRunAs()Return the run-as identity for this servlet.jakarta.servlet.ServletgetServlet()Class<? extends jakarta.servlet.Servlet>getServletClass()StringgetServletClassName()Return the fully qualified servlet class name for this servlet.jakarta.servlet.ServletContextgetServletContext()Return the servlet context with which this servlet is associated.String[]getServletMethods()Gets the names of the methods supported by the underlying servlet.StringgetServletName()Return the name of this servlet.booleanisAsyncSupported()Checks if the wrapped servlet has been annotated or flagged in the deployment descriptor as being able to support asynchronous operations.booleanisEventProvider()booleanisMultipartConfigured()protected booleanisOSGi()Returns whether this is running in an OSGi contextbooleanisStateManageable()booleanisStatisticsProvider()booleanisUnavailable()Is this servlet currently unavailable?voidload()Loads and initializes an instance of the servlet, if there is not already at least one initialized instance.protected StringlogName()Log the abbreviated name of this Container for logging messages.protected voidregisterJMX(StandardContext ctx)voidremoveInitParameter(String name)Remove the specified initialization parameter from this servlet.voidremoveInstanceListener(InstanceListener listener)Remove a listener no longer interested in InstanceEvents.voidremoveMapping(String mapping)Remove a mapping associated with the wrapper.voidremoveSecurityReference(String name)Remove any security role reference for the specified role name.voidsendNotification(Notification notification)Sends a notification to anything listening via JMX.voidsetAvailable(long available)Set the available date/time for this servlet, in milliseconds since the epoch.voidsetDebug(int debug)Set the debugging detail level for this component.voidsetDescription(String description)Sets the description of this servlet.booleansetInitParameter(String name, String value, boolean override)Sets the init parameter with the given name and value on this servlet.Set<String>setInitParameters(Map<String,String> initParameters)Sets the initialization parameters contained in the given map on this servlet.voidsetIsAsyncSupported(boolean isAsyncSupported)Marks the wrapped servlet as supporting async operations or not.voidsetJspFile(String jspFile)Set the context-relative URI of the JSP file for this servlet.voidsetLoadOnStartup(int value)Set the load-on-startup order value (negative value means load on first call).voidsetLoadOnStartupString(String value)Set the load-on-startup order value from a (possibly null) string.voidsetLoadTime(long loadTime)voidsetMaxInstances(int maxInstances)Set the maximum number of instances that will be allocated when a single thread model servlet is used.voidsetMultipartFileSizeThreshold(int fileSizeThreshold)Sets the multipart file-size-thresholdvoidsetMultipartLocation(String location)Sets the multipart locationvoidsetMultipartMaxFileSize(long maxFileSize)Sets the multipart max-file-sizevoidsetMultipartMaxRequestSize(long maxRequestSize)Sets the multipart max-request-sizeprotected voidsetOSGi(boolean osgi)Set whether this is being used in an OSGi contextvoidsetParent(Container container)Set the parent Container of this Wrapper, but only if it is a Context.voidsetRunAs(String runAs)Set the run-as identity for this servlet.voidsetServlet(jakarta.servlet.Servlet instance)Sets the servlet instance for this wrapper.voidsetServletClass(Class<? extends jakarta.servlet.Servlet> clazz)Sets the class object from which this servlet will be instantiated.voidsetServletClassName(String className)Set the fully qualified servlet class name for this servlet.voidsetServletName(String name)Set the name of this servlet.voidstart()Start this component, pre-loading the servlet if the load-on-startup value is set appropriately.voidstop()Stop this component, gracefully shutting down the servlet if it has been initialized.StringtoString()Return a String representation of this component.voidunavailable(jakarta.servlet.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.ContainerBase
addContainerListener, addLifecycleListener, addPropertyChangeListener, addValve, backgroundProcess, createObjectName, destroy, findChild, findChildren, findContainerListeners, findLifecycleListeners, fireContainerEvent, getBackgroundProcessorDelay, getBasic, getChildren, getContainerSuffix, getDomain, getJmxName, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getParentName, getPipeline, getRealm, getResources, getValveObjectNames, getValves, hasCustomPipeline, hasNonBasicValves, init, invoke, isCheckIfRequestIsSecure, log, log, removeChild, removeContainerListener, removeLifecycleListener, removeLifecycleListeners, removePropertyChangeListener, removeValve, setBackgroundProcessorDelay, setBasic, setCheckIfRequestIsSecure, setDomain, setLoader, setLogger, setManager, setName, setParentClassLoader, setRealm, setResources, startChildren, threadStart, threadStop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.catalina.Container
addContainerListener, addPropertyChangeListener, backgroundProcess, findChild, findChildren, findContainerListeners, fireContainerEvent, getBackgroundProcessorDelay, getLoader, getLogger, getManager, getMappingObject, getName, getParent, getParentClassLoader, getPipeline, getRealm, getResources, hasCustomPipeline, invoke, isCheckIfRequestIsSecure, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCheckIfRequestIsSecure, setLoader, setLogger, setManager, setName, setParentClassLoader, setRealm, setResources
-
-
-
-
Method Detail
-
getAvailable
public 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 interfaceWrapper- Returns:
-
setAvailable
public 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 interfaceWrapper- Parameters:
available- The new available date/time
-
getCountAllocated
public int getCountAllocated()
Return 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 implementSingleThreadModel.- Returns:
-
getDebug
public int getDebug()
Return the debugging detail level for this component.- Overrides:
getDebugin classContainerBase- Returns:
-
setDebug
public void setDebug(int debug)
Set the debugging detail level for this component.- Overrides:
setDebugin classContainerBase- Parameters:
debug- The new debugging detail level
-
getEngineName
public String getEngineName()
-
getInfo
public String getInfo()
Return descriptive information about this Container implementation and the corresponding version number, in the format<description>/<version>.- Specified by:
getInfoin interfaceContainer- Overrides:
getInfoin classContainerBase- Returns:
-
getInstanceSupport
public InstanceSupport getInstanceSupport()
Return the InstanceSupport object for this Wrapper instance.- Returns:
-
getJspFile
public String getJspFile()
Return the context-relative URI of the JSP file for this servlet.- Specified by:
getJspFilein interfaceWrapper- Returns:
-
setJspFile
public void setJspFile(String jspFile)
Set the context-relative URI of the JSP file for this servlet.- Specified by:
setJspFilein interfaceWrapper- Parameters:
jspFile- JSP file URI
-
getLoadOnStartup
public int getLoadOnStartup()
Return the load-on-startup order value (negative value means load on first call).- Specified by:
getLoadOnStartupin interfaceWrapper- Returns:
-
setLoadOnStartup
public void setLoadOnStartup(int value)
Set the load-on-startup order value (negative value means load on first call).- Specified by:
setLoadOnStartupin interfaceWrapper- Parameters:
value- New load-on-startup value
-
setLoadOnStartupString
public void setLoadOnStartupString(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
-
getLoadOnStartupString
public String getLoadOnStartupString()
-
setDescription
public void setDescription(String description)
Sets the description of this servlet.- Specified by:
setDescriptionin interfaceWrapper- Parameters:
description-
-
getDescription
public String getDescription()
Gets the description of this servlet.- Specified by:
getDescriptionin interfaceWrapper- Returns:
-
getMaxInstances
public int getMaxInstances()
Return maximum number of instances that will be allocated when a single thread model servlet is used.
-
setMaxInstances
public void setMaxInstances(int maxInstances)
Set the maximum number of instances that will be allocated when a single thread model servlet is used.- Parameters:
maxInstances- New value of maxInstances
-
setParent
public void setParent(Container container)
Set the parent Container of this Wrapper, but only if it is a Context.- Specified by:
setParentin interfaceContainer- Overrides:
setParentin classContainerBase- Parameters:
container- Proposed parent Container
-
getRunAs
public String getRunAs()
Return the run-as identity for this servlet.
-
setRunAs
public void setRunAs(String runAs)
Set the run-as identity for this servlet.
-
setIsAsyncSupported
public void setIsAsyncSupported(boolean isAsyncSupported)
Marks the wrapped servlet as supporting async operations or not.- Specified by:
setIsAsyncSupportedin interfaceWrapper- Parameters:
isAsyncSupported- true if the wrapped servlet supports async mode, false otherwise
-
isAsyncSupported
public boolean isAsyncSupported()
Checks if the wrapped servlet has been annotated or flagged in the deployment descriptor as being able to support asynchronous operations.- Specified by:
isAsyncSupportedin interfaceWrapper- Returns:
- true if the wrapped servlet supports async operations, and false otherwise
-
getServletClassName
public String getServletClassName()
Return the fully qualified servlet class name for this servlet.- Specified by:
getServletClassNamein interfaceWrapper- Returns:
-
setServletClassName
public void setServletClassName(String className)
Set the fully qualified servlet class name for this servlet.- Specified by:
setServletClassNamein interfaceWrapper- Parameters:
className- Servlet class name
-
getServletClass
public Class<? extends jakarta.servlet.Servlet> getServletClass()
- Returns:
- the servlet class, or null if the servlet class has not been loaded yet
-
setServletClass
public void setServletClass(Class<? extends jakarta.servlet.Servlet> clazz)
Sets the class object from which this servlet will be instantiated.- Specified by:
setServletClassin interfaceWrapper- Parameters:
clazz- The class object from which this servlet will be instantiated
-
getServlet
public jakarta.servlet.Servlet getServlet()
- Returns:
- the servlet instance, or null if the servlet has not yet been instantiated
-
setServlet
public void setServlet(jakarta.servlet.Servlet instance)
Sets the servlet instance for this wrapper.- Parameters:
instance- the servlet instance
-
setServletName
public void setServletName(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
-
isUnavailable
public boolean isUnavailable()
Is this servlet currently unavailable?- Specified by:
isUnavailablein interfaceWrapper- Returns:
-
getServletMethods
public String[] getServletMethods() throws jakarta.servlet.ServletException
Gets 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 interfaceWrapper- Returns:
- Array of names of the methods supported by the underlying servlet
- Throws:
jakarta.servlet.ServletException
-
isMultipartConfigured
public boolean isMultipartConfigured()
-
setMultipartLocation
public void setMultipartLocation(String location)
Sets the multipart location- Specified by:
setMultipartLocationin interfaceWrapper- Parameters:
location-
-
getMultipartLocation
public String getMultipartLocation()
Gets the multipart location- Specified by:
getMultipartLocationin interfaceWrapper- Returns:
-
setMultipartMaxFileSize
public void setMultipartMaxFileSize(long maxFileSize)
Sets the multipart max-file-size- Specified by:
setMultipartMaxFileSizein interfaceWrapper- Parameters:
maxFileSize-
-
getMultipartMaxFileSize
public long getMultipartMaxFileSize()
Gets the multipart max-file-size- Specified by:
getMultipartMaxFileSizein interfaceWrapper- Returns:
-
setMultipartMaxRequestSize
public void setMultipartMaxRequestSize(long maxRequestSize)
Sets the multipart max-request-size- Specified by:
setMultipartMaxRequestSizein interfaceWrapper- Parameters:
maxRequestSize-
-
getMultipartMaxRequestSize
public long getMultipartMaxRequestSize()
Gets the multipart max-request-Size- Specified by:
getMultipartMaxRequestSizein interfaceWrapper- Returns:
-
setMultipartFileSizeThreshold
public void setMultipartFileSizeThreshold(int fileSizeThreshold)
Sets the multipart file-size-threshold- Specified by:
setMultipartFileSizeThresholdin interfaceWrapper- Parameters:
fileSizeThreshold-
-
getMultipartFileSizeThreshold
public int getMultipartFileSizeThreshold()
Gets the multipart file-size-threshol- Specified by:
getMultipartFileSizeThresholdin interfaceWrapper- Returns:
-
isOSGi
protected boolean isOSGi()
Returns whether this is running in an OSGi context- Returns:
-
setOSGi
protected void setOSGi(boolean osgi)
Set whether this is being used in an OSGi context- Parameters:
osgi-
-
addValve
public void addValve(GlassFishValve valve)
Description copied from class:ContainerBaseAdd a new Valve to the end of the pipeline associated with this Container. Prior to adding the Valve, the Valve'ssetContainermethod must be called, with this Container as an argument. The method may throw anIllegalArgumentExceptionif this Valve chooses not to be associated with this Container, orIllegalStateExceptionif it is already associated with a different Container.- Specified by:
addValvein interfacePipeline- Overrides:
addValvein classContainerBase- Parameters:
valve- Valve to be added
-
getRootCause
public static Throwable getRootCause(jakarta.servlet.ServletException e)
Extract the root cause from a servlet exception.- Parameters:
e- The servlet exception
-
addChild
public void addChild(Container child)
Refuse to add a child Container, because Wrappers are the lowest level of the Container hierarchy.- Specified by:
addChildin interfaceContainer- Overrides:
addChildin classContainerBase- Parameters:
child- Child container to be added
-
addInitParameter
public void addInitParameter(String name, String value)
Adds the initialization parameter with the given name and value to this servlet.- Specified by:
addInitParameterin interfaceWrapper- Parameters:
name- the name of the init parametervalue- the value of the init parameter
-
setInitParameter
public boolean setInitParameter(String name, String value, boolean override)
Sets the init parameter with the given name and value on this servlet.- Parameters:
name- the init parameter namevalue- the init parameter valueoverride- true if the given init param is supposed to override an existing init param with the same name, and false otherwise- Returns:
- true if the init parameter with the given name and value was set, false otherwise
-
setInitParameters
public Set<String> setInitParameters(Map<String,String> initParameters)
Sets the initialization parameters contained in the given map on this servlet.- Parameters:
initParameters- the map with the init params to set- Returns:
- the (possibly empty) Set of initialization parameter names that are in conflict
-
addInstanceListener
public void addInstanceListener(InstanceListener listener)
Add a new listener interested in InstanceEvents.- Specified by:
addInstanceListenerin interfaceWrapper- Parameters:
listener- The new listener
-
addMapping
public void addMapping(String mapping)
Add a mapping associated with theWrapper.- Specified by:
addMappingin interfaceWrapper- Parameters:
mapping- The new wrapper mapping
-
getMappings
public Collection<String> getMappings()
Gets all the mapping associated with theWrapper.- Returns:
- an unmodifiable list
-
addSecurityReference
public void addSecurityReference(String name, String link)
Add a new security role reference record to the set of records for this servlet.- Specified by:
addSecurityReferencein interfaceWrapper- Parameters:
name- Role name used within this servletlink- Role name used within the web application
-
allocate
public jakarta.servlet.Servlet allocate() throws jakarta.servlet.ServletExceptionAllocate 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().
-
deallocate
public void deallocate(jakarta.servlet.Servlet servlet) throws jakarta.servlet.ServletExceptionReturn 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 interfaceWrapper- Parameters:
servlet- The servlet to be returned- Throws:
jakarta.servlet.ServletException- if a deallocation error occurs
-
findInitParameter
public String findInitParameter(String name)
Return the value for the specified initialization parameter name, if any; otherwise returnnull.- Specified by:
findInitParameterin interfaceWrapper- Parameters:
name- Name of the requested initialization parameter- Returns:
-
findInitParameters
public String[] findInitParameters()
Return the names of all defined initialization parameters for this servlet.- Specified by:
findInitParametersin interfaceWrapper- Returns:
-
findMappings
public String[] findMappings()
Return the mappings associated with this wrapper.- Specified by:
findMappingsin interfaceWrapper- Returns:
-
findSecurityReference
public String findSecurityReference(String name)
Return the security role link for the specified security role reference name, if any; otherwise returnnull.- Specified by:
findSecurityReferencein interfaceWrapper- Parameters:
name- Security role reference used within this servlet- Returns:
-
findSecurityReferences
public 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 interfaceWrapper- Returns:
-
findMappingObject
public Wrapper findMappingObject()
FIXME: Fooling introspection ...- Returns:
-
load
public void load() throws jakarta.servlet.ServletExceptionLoads and initializes an instance of the 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.
-
removeInitParameter
public void removeInitParameter(String name)
Remove the specified initialization parameter from this servlet.- Specified by:
removeInitParameterin interfaceWrapper- Parameters:
name- Name of the initialization parameter to remove
-
removeInstanceListener
public void removeInstanceListener(InstanceListener listener)
Remove a listener no longer interested in InstanceEvents.- Specified by:
removeInstanceListenerin interfaceWrapper- Parameters:
listener- The listener to remove
-
removeMapping
public void removeMapping(String mapping)
Remove a mapping associated with the wrapper.- Specified by:
removeMappingin interfaceWrapper- Parameters:
mapping- The pattern to remove
-
removeSecurityReference
public void removeSecurityReference(String name)
Remove any security role reference for the specified role name.- Specified by:
removeSecurityReferencein interfaceWrapper- Parameters:
name- Security role used within this servlet to be removed
-
toString
public String toString()
Return a String representation of this component.
-
unavailable
public void unavailable(jakarta.servlet.UnavailableException unavailable)
Process an UnavailableException, marking this servlet as unavailable for the specified amount of time.- Specified by:
unavailablein interfaceWrapper- Parameters:
unavailable- The exception that occurred, ornullto mark this servlet as permanently unavailable
-
unload
public void unload() throws jakarta.servlet.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.
-
getInitParameter
public String getInitParameter(String name)
Return the initialization parameter value for the specified name, if any; otherwise returnnull.- Specified by:
getInitParameterin interfacejakarta.servlet.ServletConfig- Parameters:
name- Name of the initialization parameter to retrieve
-
getInitParameterNames
public Enumeration<String> getInitParameterNames()
Return the set of initialization parameter names defined for this servlet. If none are defined, an empty Enumeration is returned.- Specified by:
getInitParameterNamesin interfacejakarta.servlet.ServletConfig
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()
Return the servlet context with which this servlet is associated.- Specified by:
getServletContextin interfacejakarta.servlet.ServletConfig
-
getServletName
public String getServletName()
Return the name of this servlet.- Specified by:
getServletNamein interfacejakarta.servlet.ServletConfig- Specified by:
getServletNamein interfaceWrapper
-
getLoadTime
public long getLoadTime()
Gets how long it took for the servlet to be loaded.- Returns:
- length in milliseconds
-
setLoadTime
public void setLoadTime(long loadTime)
-
getClassLoadTime
public int getClassLoadTime()
Gets how long it took for the servlet class to be loaded.- Returns:
- length in milliseconds
-
addDefaultMapper
protected void addDefaultMapper(String mapperClass)
Add a default Mapper implementation if none have been configured explicitly.- Parameters:
mapperClass- Java class name of the default Mapper
-
logName
protected String logName()
Log the abbreviated name of this Container for logging messages.- Overrides:
logNamein classContainerBase- Returns:
StandardWrapper[<parentName | null> : nameOfContainer]
-
start
public void start() throws LifecycleExceptionStart this component, pre-loading the servlet if the load-on-startup value is set appropriately.- Specified by:
startin interfaceLifecycle- Overrides:
startin classContainerBase- Throws:
LifecycleException- if a fatal error occurs during startup
-
stop
public void stop() throws LifecycleExceptionStop this component, gracefully shutting down the servlet if it has been initialized.- Specified by:
stopin interfaceLifecycle- Overrides:
stopin classContainerBase- Throws:
LifecycleException- if a fatal error occurs during shutdown
-
registerJMX
protected void registerJMX(StandardContext ctx)
-
sendNotification
public void sendNotification(Notification notification)
Sends a notification to anything listening via JMX.This function does not have anything to do with the notification service in Payara.
- Parameters:
notification-- See Also:
NotificationBroadcasterSupport,NotificationService
-
isEventProvider
public boolean isEventProvider()
- Returns:
- false
-
isStateManageable
public boolean isStateManageable()
- Returns:
- false
-
isStatisticsProvider
public boolean isStatisticsProvider()
- Returns:
- false
-
-