public abstract class GenericServletWrapper extends java.lang.Object implements IServletWrapper
| Constructor and Description |
|---|
GenericServletWrapper(IServletContext parent)
Public constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addServletReferenceListener(ServletReferenceListener listener)
Add a listener which will listen to the invalidation events for this
wrapper instance.
|
void |
destroy()
This method will be invoked when the parent container wishes to destroy
this IServletWrapper instance.
|
long |
getLastAccessTime()
This method will be called by the webcontainer's reaper mechanism which
polls for the access times of the wrappers in its datastructures, and
invalidates them if they have been inactive for a preconfigured amount of
time.
|
java.lang.String |
getName() |
IServletConfig |
getServletConfig()
Returns the ServletConfig associated with the target
|
javax.servlet.ServletContext |
getServletContext()
Returns the servlet context associated with this servlet wrapper.
|
java.lang.String |
getServletName()
Returns the servlet name of the target
|
javax.servlet.Servlet |
getTarget()
Returns the target Servlet instance
|
java.lang.ClassLoader |
getTargetClassLoader()
Returns the current classloader which loaded (or will, in the future, load)
the target.
|
void |
handleRequest(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res)
Method that processes the request, and ultimately invokes the service() on the
Servlet target.
|
void |
initialize(IServletConfig config)
Method that handles the initialization of this IServletWrapper instance.
|
boolean |
isAvailable()
Returns whether the requested wrapper resource exists.
|
boolean |
isInternal() |
void |
load()
Loads the servlet and calls the Servlet's init method with the previously passed IServletConfig.
|
void |
loadOnStartupCheck()
Initializes this wrapper with the specified config.
|
void |
modifyTarget(javax.servlet.Servlet s) |
void |
nameSpacePostInvoke() |
void |
nameSpacePreInvoke() |
void |
prepareForReload()
Gracefully invalidates the target by overseeing its lifecycle (destroy())
This method must be called before the target is invalidated for reload.
|
void |
service(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response) |
void |
setParent(IServletContext parent)
Sets the parent context for this servletwrapper
|
void |
setTarget(javax.servlet.Servlet target)
Sets the target for this IServletWrapper.
|
void |
setTargetClassLoader(java.lang.ClassLoader loader)
Instructs the underlying implementation to use the supplied class loader
to instantiate the target instance.
|
public GenericServletWrapper(IServletContext parent) throws java.lang.Exception
parent - The IServletContext that this IServletWrapper will be a part ofjava.lang.Exceptionpublic void initialize(IServletConfig config) throws java.lang.Exception
initialize in interface IServletWrapperconfig - the IServletConfig associated with this IServletWrapperjava.lang.ExceptionIServletConfigpublic void handleRequest(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res)
throws java.lang.Exception
handleRequest in interface RequestProcessorhandleRequest in interface IServletWrapperjava.lang.Exceptionpublic void prepareForReload()
prepareForReload in interface IServletWrapperpublic java.lang.String getServletName()
getServletName in interface IServletWrapperpublic IServletConfig getServletConfig()
getServletConfig in interface IServletWrapperpublic javax.servlet.ServletContext getServletContext()
IServletWrappergetServletContext in interface IServletWrapperpublic void setTargetClassLoader(java.lang.ClassLoader loader)
setTargetClassLoader in interface IServletWrapperpublic javax.servlet.Servlet getTarget()
getTarget in interface IServletWrapperpublic java.lang.ClassLoader getTargetClassLoader()
getTargetClassLoader in interface IServletWrapperpublic void setTarget(javax.servlet.Servlet target)
setTarget in interface IServletWrapperpublic void addServletReferenceListener(ServletReferenceListener listener)
addServletReferenceListener in interface IServletWrapperpublic long getLastAccessTime()
getLastAccessTime in interface IServletWrapperpublic void destroy()
destroy in interface IServletWrapperpublic void service(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
service in interface IServletWrapperjava.io.IOExceptionjavax.servlet.ServletExceptionpublic void setParent(IServletContext parent)
IServletWrappersetParent in interface IServletWrapperpublic boolean isAvailable()
isAvailable in interface IServletWrapperpublic void nameSpacePostInvoke()
public void nameSpacePreInvoke()
public java.lang.String getName()
getName in interface RequestProcessorpublic boolean isInternal()
isInternal in interface RequestProcessorpublic void loadOnStartupCheck()
throws java.lang.Exception
IServletWrapperloadOnStartupCheck in interface IServletWrapperjava.lang.ExceptionIServletConfigpublic void load()
throws java.lang.Exception
IServletWrapperload in interface IServletWrapperjava.lang.Exceptionpublic void modifyTarget(javax.servlet.Servlet s)
modifyTarget in interface IServletWrapper