com.ibm.wsspi.webcontainer.servlet

Interface IServletWrapper

All Superinterfaces:
RequestProcessor
All known implementing classes:
GenericServletWrapper

  1. public interface IServletWrapper
  2. extends RequestProcessor
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:
GenericServletWrapper

Method Summary

Modifier and Type Method and Description
  1. void
addServletReferenceListener(ServletReferenceListener wrapper)
Adds a ServletReferenceListener to this wrapper
  1. void
destroy()
Signals that this wrapper should now be destroyed.
  1. long
getLastAccessTime()
Returns the time when this wrapper was last accessed
  1. IServletConfig
getServletConfig()
Returns the servlet config associated with this servlet wrapper
  1. ServletContext
getServletContext()
Returns the servlet context associated with this servlet wrapper.
  1. java.lang.String
getServletName()
Returns the servlet name of the servlet wrapped by this servlet wrapper
  1. Servlet
getTarget()
Gets the target Servlet that this wrapper is wrapping
  1. java.lang.ClassLoader
getTargetClassLoader()
Returns the ClassLoader instance that was used to load, or will be used to load the Servlet wrapped by this servlet wrapper
  1. void
handleRequest(ServletRequest req,ServletResponse res)
This method will be called by the webcontainer when a request is intended for this wrapper.
  1. void
initialize(IServletConfig config)
Initializes this wrapper with the specified config.
  1. boolean
isAvailable()
Returns whether the requested wrapper resource exists.
  1. void
load()
Loads the servlet and calls the Servlet's init method with the previously passed IServletConfig.
  1. void
loadOnStartupCheck()
Initializes this wrapper with the specified config.
  1. void
modifyTarget(Servlet s)
  1. void
prepareForReload()
Signals that this wrapper is going to be recycled
  1. void
service(ServletRequest request,ServletResponse response)
  1. void
setParent(IServletContext parent)
Sets the parent context for this servletwrapper
  1. void
setTarget(Servlet target)
Sets the target Servlet that this wrapper should wrap
  1. void
setTargetClassLoader(java.lang.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.RequestProcessor
getName, isInternal

Method Detail

getServletConfig

  1. IServletConfig getServletConfig( )
Returns the servlet config associated with this servlet wrapper
Returns:

getServletContext

  1. ServletContext getServletContext( )
Returns the servlet context associated with this servlet wrapper.
Returns:

setParent

  1. void setParent(IServletContext parent)
Sets the parent context for this servletwrapper

getServletName

  1. java.lang.String getServletName( )
Returns the servlet name of the servlet wrapped by this servlet wrapper
Returns:

setTargetClassLoader

  1. void setTargetClassLoader(java.lang.ClassLoader loader)
Instructs the webcontainer to use the specified ClassLoader to load the Servlet wrapped by this servlet wrapper.
Parameters:
loader -

getTargetClassLoader

  1. java.lang.ClassLoader getTargetClassLoader( )
Returns the ClassLoader instance that was used to load, or will be used to load the Servlet wrapped by this servlet wrapper

setTarget

  1. void setTarget(Servlet target)
Sets the target Servlet that this wrapper should wrap
Parameters:
target -

getTarget

  1. Servlet getTarget()
Gets the target Servlet that this wrapper is wrapping
Returns:

initialize

  1. void initialize(IServletConfig config)
  2. throws java.lang.Exception
Initializes 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:
java.lang.Exception
See Also:

loadOnStartupCheck

  1. void loadOnStartupCheck()
  2. throws java.lang.Exception
Initializes 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
Throws:
java.lang.Exception
See Also:

handleRequest

  1. void handleRequest(ServletRequest req,
  2. ServletResponse res)
  3. throws java.lang.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:
Throws:
java.lang.Exception

prepareForReload

  1. void prepareForReload()
Signals that this wrapper is going to be recycled

addServletReferenceListener

  1. void addServletReferenceListener( ServletReferenceListener wrapper)
Adds a ServletReferenceListener to this wrapper
Parameters:
wrapper -

getLastAccessTime

  1. long getLastAccessTime()
Returns the time when this wrapper was last accessed
Returns:

destroy

  1. void destroy()
Signals that this wrapper should now be destroyed.

service

  1. void service(ServletRequest request,
  2. ServletResponse response)
  3. throws java.io.IOException
  4. ServletException
Parameters:
request -
response -
Throws:
java.io.IOException
ServletException

isAvailable

  1. boolean isAvailable()
Returns whether the requested wrapper resource exists.

load

  1. void load()
  2. throws java.lang.Exception
Loads the servlet and calls the Servlet's init method with the previously passed IServletConfig. One component that calls this is SIP.
Throws:
java.lang.Exception

modifyTarget

  1. void modifyTarget(Servlet s)