addChild
public void addChild(Container child)
Refuse to add a child Container, because Wrappers are the lowest level
of the Container hierarchy.
- addChild in interface Container
- addChild in interface ContainerBase
child
- Child container to be added
addDefaultMapper
protected void addDefaultMapper(String mapperClass)
Add a default Mapper implementation if none have been configured
explicitly.
mapperClass
- Java class name of the default Mapper
addInitParameter
public void addInitParameter(String name,
String value)
Add a new servlet initialization parameter for this servlet.
- addInitParameter in interface Wrapper
name
- Name of this initialization parameter to addvalue
- Value of this initialization parameter to add
addMapping
public void addMapping(String mapping)
Add a mapping associated with the Wrapper.
- addMapping in interface Wrapper
mapping
- The new wrapper mapping
addSecurityReference
public void addSecurityReference(String name,
String link)
Add a new security role reference record to the set of records for
this servlet.
- addSecurityReference in interface Wrapper
name
- Role name used within this servletlink
- Role name used within the web application
allocate
public Servlet allocate()
throws ServletException
Allocate an initialized instance of this Servlet that is ready to have
its service()
method called. If the servlet class does
not implement SingleThreadModel
, the (only) initialized
instance may be returned immediately. If the servlet class implements
SingleThreadModel
, the Wrapper implementation must ensure
that this instance is not allocated again until it is deallocated by a
call to deallocate()
.
- allocate in interface Wrapper
deallocate
public 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.
- deallocate in interface Wrapper
servlet
- The servlet to be returned
findInitParameter
public String findInitParameter(String name)
Return the value for the specified initialization parameter name,
if any; otherwise return null
.
- findInitParameter in interface Wrapper
name
- Name of the requested initialization parameter
findInitParameters
public String[] findInitParameters()
Return the names of all defined initialization parameters for this
servlet.
- findInitParameters in interface Wrapper
findMappingObject
public Wrapper findMappingObject()
FIXME: Fooling introspection ...
findMappings
public String[] findMappings()
Return the mappings associated with this wrapper.
- findMappings in interface Wrapper
findSecurityReference
public String findSecurityReference(String name)
Return the security role link for the specified security role
reference name, if any; otherwise return null
.
- findSecurityReference in interface Wrapper
name
- Security role reference used within this servlet
findSecurityReferences
public String[] findSecurityReferences()
Return the set of security role reference names associated with
this servlet, if any; otherwise return a zero-length array.
- findSecurityReferences in interface Wrapper
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.
- getAvailable in interface Wrapper
getClassLoadTime
public int getClassLoadTime()
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 implement SingleThreadModel
.
getDebug
public int getDebug()
Return the debugging detail level for this component.
- getDebug in interface ContainerBase
getEngineName
public String getEngineName()
getErrorCount
public int getErrorCount()
getInfo
public String getInfo()
Return descriptive information about this Container implementation and
the corresponding version number, in the format
<description>/<version>
.
- getInfo in interface Container
- getInfo in interface ContainerBase
getInitParameter
public String getInitParameter(String name)
Return the initialization parameter value for the specified name,
if any; otherwise return null
.
name
- Name of the initialization parameter to retrieve
getInitParameterNames
public Enumeration getInitParameterNames()
Return the set of initialization parameter names defined for this
servlet. If none are defined, an empty Enumeration is returned.
getInstanceSupport
public InstanceSupport getInstanceSupport()
Return the InstanceSupport object for this Wrapper instance.
getJspFile
public String getJspFile()
Return the context-relative URI of the JSP file for this servlet.
- getJspFile in interface Wrapper
getLoadOnStartup
public int getLoadOnStartup()
Return the load-on-startup order value (negative value means
load on first call).
- getLoadOnStartup in interface Wrapper
getLoadOnStartupString
public String getLoadOnStartupString()
getLoadTime
public long getLoadTime()
getMaxInstances
public int getMaxInstances()
Return maximum number of instances that will be allocated when a single
thread model servlet is used.
getMaxTime
public long getMaxTime()
getMinTime
public long getMinTime()
getProcessingTime
public long getProcessingTime()
getRequestCount
public int getRequestCount()
getRunAs
public String getRunAs()
Return the run-as identity for this servlet.
- getRunAs in interface Wrapper
getServletClass
public String getServletClass()
Return the fully qualified servlet class name for this servlet.
- getServletClass in interface Wrapper
getServletContext
public ServletContext getServletContext()
Return the servlet context with which this servlet is associated.
getServletName
public String getServletName()
Return the name of this servlet.
incrementErrorCount
public void incrementErrorCount()
Increment the error count used for monitoring.
- incrementErrorCount in interface Wrapper
isEventProvider
public boolean isEventProvider()
isSingleThreadModel
public boolean isSingleThreadModel()
Return true
if the servlet class represented by this
component implements the SingleThreadModel
interface.
isStateManageable
public boolean isStateManageable()
isStatisticsProvider
public boolean isStatisticsProvider()
isUnavailable
public boolean isUnavailable()
Is this servlet currently unavailable?
- isUnavailable in interface Wrapper
load
public void load()
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.
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.
- load in interface Wrapper
loadServlet
public 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.
logName
protected String logName()
Log the abbreviated name of this Container for logging messages.
- logName in interface ContainerBase
removeInitParameter
public void removeInitParameter(String name)
Remove the specified initialization parameter from this servlet.
- removeInitParameter in interface Wrapper
name
- Name of the initialization parameter to remove
removeMapping
public void removeMapping(String mapping)
Remove a mapping associated with the wrapper.
- removeMapping in interface Wrapper
mapping
- The pattern to remove
removeSecurityReference
public void removeSecurityReference(String name)
Remove any security role reference for the specified role name.
- removeSecurityReference in interface Wrapper
name
- Security role used within this servlet to be removed
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.
- setAvailable in interface Wrapper
available
- The new available date/time
setDebug
public void setDebug(int debug)
Set the debugging detail level for this component.
- setDebug in interface ContainerBase
debug
- The new debugging detail level
setErrorCount
public void setErrorCount(int errorCount)
setJspFile
public void setJspFile(String jspFile)
Set the context-relative URI of the JSP file for this servlet.
- setJspFile in interface Wrapper
jspFile
- JSP file URI
setLoadOnStartup
public void setLoadOnStartup(int value)
Set the load-on-startup order value (negative value means
load on first call).
- setLoadOnStartup in interface Wrapper
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.
value
- New load-on-startup value
setLoadTime
public void setLoadTime(long loadTime)
setMaxInstances
public void setMaxInstances(int maxInstances)
Set the maximum number of instances that will be allocated when a single
thread model servlet is used.
maxInstances
- New value of maxInstances
setMaxTime
public void setMaxTime(long maxTime)
setMinTime
public void setMinTime(long minTime)
setParent
public void setParent(Container container)
Set the parent Container of this Wrapper, but only if it is a Context.
- setParent in interface Container
- setParent in interface ContainerBase
container
- Proposed parent Container
setProcessingTime
public void setProcessingTime(long processingTime)
setRequestCount
public void setRequestCount(int requestCount)
setRunAs
public void setRunAs(String runAs)
Set the run-as identity for this servlet.
- setRunAs in interface Wrapper
runAs
- New run-as identity value
setServletClass
public void setServletClass(String servletClass)
Set the fully qualified servlet class name for this servlet.
- setServletClass in interface Wrapper
servletClass
- Servlet class name
setServletName
public void setServletName(String name)
Set the name of this servlet. This is an alias for the normal
Container.setName()
method, and complements the
getServletName()
method required by the
ServletConfig
interface.
name
- The new name of this servlet
toString
public String toString()
Return a String representation of this component.
unavailable
public void unavailable(UnavailableException unavailable)
Process an UnavailableException, marking this servlet as unavailable
for the specified amount of time.
- unavailable in interface Wrapper
unavailable
- The exception that occurred, or null
to mark this servlet as permanently unavailable
unload
public void unload()
throws ServletException
Unload all initialized instances of this servlet, after calling the
destroy()
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.
- unload in interface Wrapper