public interface Wrapper extends Container
Implementations of Wrapper are responsible for managing the servlet life cycle for their underlying servlet class, including calling init() and destroy() at appropriate times, as well as respecting the existence of the SingleThreadModel declaration on the servlet class itself.
The parent Container attached to a Wrapper will generally be an implementation of Context, representing the servlet context (and therefore the web application) within which this servlet executes.
Child Containers are not allowed on Wrapper implementations, so the
addChild()
method should throw an
IllegalArgumentException
.
ADD_CHILD_EVENT, ADD_MAPPER_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_MAPPER_EVENT, REMOVE_VALVE_EVENT
Modifier and Type | Method and Description |
---|---|
void |
addInitParameter(String name,
String value)
Add a new servlet initialization parameter for this servlet.
|
void |
addInstanceListener(InstanceListener listener)
Add a new listener interested in InstanceEvents.
|
void |
addMapping(String mapping)
Add a mapping associated with the Wrapper.
|
void |
addSecurityReference(String name,
String link)
Add a new security role reference record to the set of records for
this servlet.
|
javax.servlet.Servlet |
allocate()
Allocate an initialized instance of this Servlet that is ready to have
its
service() method called. |
void |
deallocate(javax.servlet.Servlet servlet)
Return this previously allocated servlet to the pool of available
instances.
|
String |
findInitParameter(String name)
Return the value for the specified initialization parameter name,
if any; otherwise return
null . |
String[] |
findInitParameters()
Return the names of all defined initialization parameters for this
servlet.
|
String[] |
findMappings()
Return the mappings associated with this wrapper.
|
String |
findSecurityReference(String name)
Return the security role link for the specified security role
reference name, if any; otherwise return
null . |
String[] |
findSecurityReferences()
Return the set of security role reference names associated with
this servlet, if any; otherwise return a zero-length array.
|
boolean |
getAsyncSupported()
Return the async supported value.
|
long |
getAvailable()
Return the available date/time for this servlet, in milliseconds since
the epoch.
|
String |
getDescription()
Return the Servlet description.
|
boolean |
getEnabled()
Return the enabled value.
|
javax.servlet.ServletRegistration |
getFacade()
Get the facade ServletRegistration.
|
InstanceSupport |
getInstanceSupport()
Return the InstanceSupport object for this Wrapper instance.
|
String |
getJspFile()
Return the context-relative URI of the JSP file for this servlet.
|
int |
getLoadOnStartup()
Return the load-on-startup order value (negative value means
load on first call).
|
Multipart |
getMultipartConfig()
Multipart configuration for this Servlet.
|
String |
getRunAs()
Return the run-as identity for this servlet.
|
javax.servlet.Servlet |
getServlet()
Return the associated servlet instance.
|
String |
getServletClass()
Return the fully qualified servlet class name for this servlet.
|
String[] |
getServletMethods()
Gets the names of the methods supported by the underlying servlet.
|
javax.servlet.ServletSecurityElement |
getServletSecurity()
Get an associated ServletSecurity, if any.
|
void |
incrementErrorCount()
Increment the error count value used when monitoring.
|
boolean |
isDynamic()
Get the flag that indicates if the wrapper was added programmatically.
|
boolean |
isOverridable()
Is the Servlet overridable by a ServletContainerInitializer?
|
boolean |
isUnavailable()
Is this servlet currently unavailable?
|
void |
load()
Load and initialize an instance of this servlet, if there is not already
at least one initialized instance.
|
void |
removeInitParameter(String name)
Remove the specified initialization parameter from this servlet.
|
void |
removeInstanceListener(InstanceListener listener)
Remove a listener no longer interested in InstanceEvents.
|
void |
removeMapping(String mapping)
Remove a mapping associated with the wrapper.
|
void |
removeSecurityReference(String name)
Remove any security role reference for the specified role name.
|
void |
setAsyncSupported(boolean asyncSupported)
Set the async supported value.
|
void |
setAvailable(long available)
Set the available date/time for this servlet, in milliseconds since the
epoch.
|
void |
setDescription(String description)
Set the description.
|
void |
setDynamic(boolean dynamic)
Set a flag that indicates if the wrapper was added programmatically.
|
void |
setEnabled(boolean enabled)
Set the enabled value.
|
void |
setJspFile(String jspFile)
Set the context-relative URI of the JSP file for this servlet.
|
void |
setLoadOnStartup(int value)
Set the load-on-startup order value (negative value means
load on first call).
|
void |
setMultipartConfig(Multipart multipartConfig)
Set the multipart configuration for this Servlet.
|
void |
setOverridable(boolean overridable)
Sets the overridable attribute for this Servlet.
|
void |
setRunAs(String runAs)
Set the run-as identity for this servlet.
|
void |
setServlet(javax.servlet.Servlet servlet)
Set the associated servlet instance.
|
void |
setServletClass(String servletClass)
Set the fully qualified servlet class name for this servlet.
|
Set<String> |
setServletSecurity(javax.servlet.ServletSecurityElement servletSecurity)
Set an associated ServletSecurity.
|
void |
unavailable(javax.servlet.UnavailableException unavailable)
Process an UnavailableException, marking this servlet as unavailable
for the specified amount of time.
|
void |
unload()
Unload all initialized instances of this servlet, after calling the
destroy() method for each instance. |
addChild, addContainerListener, addPropertyChangeListener, backgroundProcess, findChild, findChildren, findContainerListeners, fireContainerEvent, getBackgroundProcessorDelay, getCluster, getInfo, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getPipeline, getRealm, getResources, invoke, isStarted, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCluster, setLoader, setManager, setName, setParent, setParentClassLoader, setRealm, setResources
boolean getAsyncSupported()
void setAsyncSupported(boolean asyncSupported)
value
- New async supported valuelong getAvailable()
void setAvailable(long available)
available
- The new available date/timeString getDescription()
void setDescription(String description)
boolean isDynamic()
void setDynamic(boolean dynamic)
value
- New async supported valueboolean getEnabled()
void setEnabled(boolean enabled)
value
- New async supported valueInstanceSupport getInstanceSupport()
String getJspFile()
void setJspFile(String jspFile)
jspFile
- JSP file URIint getLoadOnStartup()
void setLoadOnStartup(int value)
value
- New load-on-startup valueMultipart getMultipartConfig()
void setMultipartConfig(Multipart multipartConfig)
String getRunAs()
void setRunAs(String runAs)
runAs
- New run-as identity valueString getServletClass()
void setServletClass(String servletClass)
servletClass
- Servlet class nameString[] getServletMethods() throws javax.servlet.ServletException
javax.servlet.ServletException
boolean isUnavailable()
void addInitParameter(String name, String value)
name
- Name of this initialization parameter to addvalue
- Value of this initialization parameter to addvoid addInstanceListener(InstanceListener listener)
listener
- The new listenervoid addMapping(String mapping)
mapping
- The new wrapper mappingvoid addSecurityReference(String name, String link)
name
- Role name used within this servletlink
- Role name used within the web applicationjavax.servlet.Servlet allocate() throws javax.servlet.ServletException
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()
.javax.servlet.ServletException
- if the servlet init() method threw
an exceptionjavax.servlet.ServletException
- if a loading error occursvoid deallocate(javax.servlet.Servlet servlet) throws javax.servlet.ServletException
servlet
- The servlet to be returnedjavax.servlet.ServletException
- if a deallocation error occursjavax.servlet.ServletRegistration getFacade()
javax.servlet.Servlet getServlet()
void setServlet(javax.servlet.Servlet servlet)
String findInitParameter(String name)
null
.name
- Name of the requested initialization parameterString[] findInitParameters()
String[] findMappings()
String findSecurityReference(String name)
null
.name
- Security role reference used within this servletString[] findSecurityReferences()
void incrementErrorCount()
void load() throws javax.servlet.ServletException
javax.servlet.ServletException
- if the servlet init() method threw
an exceptionjavax.servlet.ServletException
- if some other loading problem occursvoid removeInitParameter(String name)
name
- Name of the initialization parameter to removevoid removeInstanceListener(InstanceListener listener)
listener
- The listener to removevoid removeMapping(String mapping)
mapping
- The pattern to removevoid removeSecurityReference(String name)
name
- Security role used within this servlet to be removedvoid unavailable(javax.servlet.UnavailableException unavailable)
unavailable
- The exception that occurred, or null
to mark this servlet as permanently unavailablevoid unload() throws javax.servlet.ServletException
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.javax.servlet.ServletException
- if an unload error occursSet<String> setServletSecurity(javax.servlet.ServletSecurityElement servletSecurity)
javax.servlet.ServletSecurityElement getServletSecurity()
boolean isOverridable()
void setOverridable(boolean overridable)
Copyright © 2016 JBoss by Red Hat. All rights reserved.