Interface IServletWrapper
- All Superinterfaces:
- RequestProcessor
- All Known Implementing Classes:
- GenericServletWrapper
Generic RequestProcessor representation of a compiled servlet. Any entity which
 ends up begin a Servlet will be wrapper by a wrapper of this type. This wrapper
 may be added as targets into the ServletContext, and the webcontainer will
 dispatch requests intended for this resource in an optimized way.
 
 NOTE: Components wishing to provide their own servlet wrappers are strongly
 urged to extend the GenericServletWrapper class, which has convenience methods
 to help with better integration with the webcontainer
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a ServletReferenceListener to this wrappervoiddestroy()Signals that this wrapper should now be destroyed.longReturns the time when this wrapper was last accessedReturns the servlet config associated with this servlet wrapperjakarta.servlet.ServletContextReturns the servlet context associated with this servlet wrapper.Returns the servlet name of the servlet wrapped by this servlet wrapperjakarta.servlet.ServletGets the target Servlet that this wrapper is wrappingReturns the ClassLoader instance that was used to load, or will be used to load the Servlet wrapped by this servlet wrappervoidhandleRequest(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res) This method will be called by the webcontainer when a request is intended for this wrapper.voidinitialize(IServletConfig config) Initializes this wrapper with the specified config.booleanReturns whether the requested wrapper resource exists.voidload()Loads the servlet and calls the Servlet's init method with the previously passed IServletConfig.voidInitializes this wrapper with the specified config.voidmodifyTarget(jakarta.servlet.Servlet s) voidSignals that this wrapper is going to be recycledvoidservice(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) voidsetParent(IServletContext parent) Sets the parent context for this servletwrappervoidsetTarget(jakarta.servlet.Servlet target) Sets the target Servlet that this wrapper should wrapvoidsetTargetClassLoader(ClassLoader loader) Instructs the webcontainer to use the specified ClassLoader to load the Servlet wrapped by this servlet wrapper.Methods inherited from interface com.ibm.wsspi.webcontainer.RequestProcessorgetName, isInternal
- 
Method Details- 
getServletConfigIServletConfig getServletConfig()Returns the servlet config associated with this servlet wrapper- Returns:
 
- 
getServletContextjakarta.servlet.ServletContext getServletContext()Returns the servlet context associated with this servlet wrapper.- Returns:
 
- 
setParentSets the parent context for this servletwrapper
- 
getServletNameString getServletName()Returns the servlet name of the servlet wrapped by this servlet wrapper- Returns:
 
- 
setTargetClassLoaderInstructs the webcontainer to use the specified ClassLoader to load the Servlet wrapped by this servlet wrapper.- Parameters:
- loader-
 
- 
getTargetClassLoaderClassLoader getTargetClassLoader()Returns the ClassLoader instance that was used to load, or will be used to load the Servlet wrapped by this servlet wrapper- Parameters:
- loader-
 
- 
setTargetvoid setTarget(jakarta.servlet.Servlet target) Sets the target Servlet that this wrapper should wrap- Parameters:
- target-
 
- 
getTargetjakarta.servlet.Servlet getTarget()Gets the target Servlet that this wrapper is wrapping- Returns:
 
- 
initializeInitializes this wrapper with the specified config. Depending on the startup weight specified in the config, the underlying target Servlet will either be initialized within this call. NOTE: This initialization behaviour of the target Servlet can be controlled by calling the setStartUpWeight() method on the IServletConfig- Parameters:
- config-
- Throws:
- Exception
- See Also:
 
- 
loadOnStartupCheckInitializes this wrapper with the specified config. Depending on the startup weight specified in the config, the underlying target Servlet will either be initialized within this call. NOTE: This initialization behaviour of the target Servlet can be controlled by calling the setStartUpWeight() method on the IServletConfig- Parameters:
- config-
- Throws:
- Exception
- See Also:
 
- 
handleRequestvoid handleRequest(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res) throws Exception This method will be called by the webcontainer when a request is intended for this wrapper. Classes directly implementing this interface (without extending GenericServletWrapper) will have to handle all aspects of the request processing. NOTE: Components wishing to provide their own servlet wrappers are strongly urged to extend the GenericServletWrapper class, which has convenience methods to help with better integration with the webcontainer. Subclasses can delegate request processing to the GenericServletWrapper by invoking the super.handleRequest() method- Specified by:
- handleRequestin interface- RequestProcessor
- Throws:
- Exception
 
- 
prepareForReloadvoid prepareForReload()Signals that this wrapper is going to be recycled
- 
addServletReferenceListenerAdds a ServletReferenceListener to this wrapper- Parameters:
- wrapper-
 
- 
getLastAccessTimelong getLastAccessTime()Returns the time when this wrapper was last accessed- Returns:
 
- 
destroyvoid destroy()Signals that this wrapper should now be destroyed.
- 
servicevoid service(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) throws IOException, jakarta.servlet.ServletException - Parameters:
- request-
- response-
- Throws:
- IOException
- jakarta.servlet.ServletException
 
- 
isAvailableboolean isAvailable()Returns whether the requested wrapper resource exists.
- 
loadLoads the servlet and calls the Servlet's init method with the previously passed IServletConfig. One component that calls this is SIP.- Throws:
- Exception
 
- 
modifyTargetvoid modifyTarget(jakarta.servlet.Servlet s) 
 
-