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.Exception
public void initialize(IServletConfig config) throws java.lang.Exception
initialize
in interface IServletWrapper
config
- the IServletConfig associated with this IServletWrapperjava.lang.Exception
IServletConfig
public void handleRequest(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) throws java.lang.Exception
handleRequest
in interface RequestProcessor
handleRequest
in interface IServletWrapper
java.lang.Exception
public void prepareForReload()
prepareForReload
in interface IServletWrapper
public java.lang.String getServletName()
getServletName
in interface IServletWrapper
public IServletConfig getServletConfig()
getServletConfig
in interface IServletWrapper
public javax.servlet.ServletContext getServletContext()
IServletWrapper
getServletContext
in interface IServletWrapper
public void setTargetClassLoader(java.lang.ClassLoader loader)
setTargetClassLoader
in interface IServletWrapper
public javax.servlet.Servlet getTarget()
getTarget
in interface IServletWrapper
public java.lang.ClassLoader getTargetClassLoader()
getTargetClassLoader
in interface IServletWrapper
public void setTarget(javax.servlet.Servlet target)
setTarget
in interface IServletWrapper
public void addServletReferenceListener(ServletReferenceListener listener)
addServletReferenceListener
in interface IServletWrapper
public long getLastAccessTime()
getLastAccessTime
in interface IServletWrapper
public void destroy()
destroy
in interface IServletWrapper
public void service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws java.io.IOException, javax.servlet.ServletException
service
in interface IServletWrapper
java.io.IOException
javax.servlet.ServletException
public void setParent(IServletContext parent)
IServletWrapper
setParent
in interface IServletWrapper
public boolean isAvailable()
isAvailable
in interface IServletWrapper
public void nameSpacePostInvoke()
public void nameSpacePreInvoke()
public java.lang.String getName()
getName
in interface RequestProcessor
public boolean isInternal()
isInternal
in interface RequestProcessor
public void loadOnStartupCheck() throws java.lang.Exception
IServletWrapper
loadOnStartupCheck
in interface IServletWrapper
java.lang.Exception
IServletConfig
public void load() throws java.lang.Exception
IServletWrapper
load
in interface IServletWrapper
java.lang.Exception
public void modifyTarget(javax.servlet.Servlet s)
modifyTarget
in interface IServletWrapper