|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.w3c.tools.resources.AttributeHolder
org.w3c.tools.resources.Resource
org.w3c.tools.resources.FramedResource
org.w3c.jigsaw.servlet.ServletWrapper
public class ServletWrapper
| Nested Class Summary | |
|---|---|
protected class |
ServletWrapper.ServletRunner
|
protected class |
ServletWrapper.TimeoutManager
|
| Field Summary | |
|---|---|
protected static int |
ATTR_PARAMETERS
Attribute index - The init parameters for that servlet. |
protected static int |
ATTR_SERVLET_CLASS
Attributes index - The servlet class name. |
protected static int |
ATTR_SERVLET_CONTEXT
Attribute index - Our parent-inherited servlet context. |
protected static int |
ATTR_SERVLET_INSTANCEMAX
Attributes index - The servlet maxinstances for single thread model servlet instance pool size limitation, tk, 20.10.2001 |
protected static int |
ATTR_SERVLET_TIMEOUT
Attributes index - The servlet timeout |
protected static int |
ATTR_SESSION_CONTEXT
Attribute index - Our parent-inherited session context. |
protected static boolean |
debug
|
static java.lang.String |
ENDED
|
protected boolean |
inited
Is our servler initialized ? |
static java.lang.String |
RUNNER
|
protected org.w3c.jigsaw.servlet.ServletWrapper.ServletPool |
servletPool
Using a limited pool of servlet instances instead of a single instance, tk, 22.10.2001 protected Servlet servlet = null; |
protected ServletWrapper.TimeoutManager |
timeoutManager
|
| Fields inherited from class org.w3c.tools.resources.FramedResource |
|---|
ATTR_OID, attrListener, debugEvent, event_disabled, framesRef, structListener |
| Fields inherited from class org.w3c.tools.resources.Resource |
|---|
ATTR_CONTEXT, ATTR_HELP_URL, ATTR_IDENTIFIER, ATTR_LAST_MODIFIED, ATTR_PARENT, ATTR_RESOURCE_FRAMES, ATTR_STORE_ENTRY, ATTR_URL, co, id |
| Fields inherited from class org.w3c.tools.resources.AttributeHolder |
|---|
attributes, values |
| Constructor Summary | |
|---|---|
ServletWrapper()
|
|
| Method Summary | |
|---|---|
boolean |
acceptUnload()
Is that resource willing to be unloaded. |
protected void |
checkServlet()
Check the servlet class, and try to initialize it. |
protected AutoReloadServletLoader |
createNewLocalServletLoader(boolean keepold)
|
protected void |
destroyServlet()
Destroy the servlet we are wrapping. |
java.lang.String |
getInitParameter(java.lang.String string)
Servlet stub implementation - Get an init parameter value. |
java.util.Enumeration |
getInitParameterNames()
Servlet stub implementation - Get all init parameters. |
protected int |
getInstanceMax()
|
protected AutoReloadServletLoader |
getLocalServletLoader()
Get or create a suitable LocalServletLoader instance to load that servlet. |
javax.servlet.Servlet |
getServlet()
Get the servlet we are wrapping. |
java.lang.String |
getServletClass()
Get the class name of the wrapped servlet. |
javax.servlet.ServletContext |
getServletContext()
Servlet stub implementation - Get that servlet context. |
java.io.File |
getServletDirectory()
The Path where we can find the servlet class file. |
java.lang.String |
getServletName()
Returns the name of this servlet instance. |
ArrayDictionary |
getServletParameters()
Get the init parameters for our wrapped servlet. |
protected long |
getServletTimeout()
|
JigsawHttpSessionContext |
getSessionContext()
|
void |
initialize(java.lang.Object[] values)
Initialize this servlet wrapper resource. |
protected void |
invalidateAllSession()
|
protected boolean |
isInited()
|
boolean |
isServletLoaded()
Check and eventually load the servlet we are wrapping. |
protected boolean |
isWrappingAServlet()
Check if the Servletclass wrapped is a Servlet class without initializing it. |
protected boolean |
launchServlet()
Launch the servlet we are wrapping. |
protected boolean |
launchServlet(java.lang.Class cls)
Initialize our servlet from the given (loaded) class. |
void |
notifyUnload()
This resource is being unloaded. |
protected void |
service(Request request,
Reply reply)
|
void |
setValue(int idx,
java.lang.Object value)
Catch assignements to the servlet class name attribute. |
protected void |
setValueOfSuperClass(int idx,
java.lang.Object value)
|
| Methods inherited from class org.w3c.tools.resources.Resource |
|---|
checkMultipleLock, collectFrames, getContext, getFrame, getFrames, getHelpURL, getHelpURL, getIdentifier, getLastModified, getParent, getResourceReference, getServer, getSpace, getSpaceEntry, getStoreEntry, getURLPath, getValue, getValue, initialize, isInitialized, isUnloaded, pickleValues, setContext, setContext, setValue, unsafeGetContext, unsafeGetFrame, unsafeGetFrames, unsafeGetIdentifier, unsafeGetResourceReference, unsafeGetURLPath, unsafeGetValue, updateAttributes |
| Methods inherited from class org.w3c.tools.resources.AttributeHolder |
|---|
definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, lookupAttribute, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, unsafeDefinesAttribute, unsafeGetDouble, unsafeGetString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String RUNNER
public static final java.lang.String ENDED
protected ServletWrapper.TimeoutManager timeoutManager
protected static final boolean debug
protected static int ATTR_SERVLET_CLASS
protected static int ATTR_SERVLET_TIMEOUT
protected static int ATTR_SERVLET_INSTANCEMAX
protected static int ATTR_PARAMETERS
protected static int ATTR_SERVLET_CONTEXT
protected static int ATTR_SESSION_CONTEXT
protected final org.w3c.jigsaw.servlet.ServletWrapper.ServletPool servletPool
protected boolean inited
| Constructor Detail |
|---|
public ServletWrapper()
| Method Detail |
|---|
public java.io.File getServletDirectory()
public java.lang.String getInitParameter(java.lang.String string)
getInitParameter in interface javax.servlet.ServletConfigpublic java.util.Enumeration getInitParameterNames()
getInitParameterNames in interface javax.servlet.ServletConfigpublic javax.servlet.ServletContext getServletContext()
getServletContext in interface javax.servlet.ServletConfigpublic JigsawHttpSessionContext getSessionContext()
protected long getServletTimeout()
protected int getInstanceMax()
protected void invalidateAllSession()
protected void checkServlet()
throws java.lang.ClassNotFoundException,
javax.servlet.ServletException
java.lang.ClassNotFoundException - if servlet class can't be found.
javax.servlet.ServletException - if servlet can't be initialized.protected boolean isInited()
public boolean isServletLoaded()
protected void service(Request request,
Reply reply)
throws javax.servlet.ServletException,
java.io.IOException
javax.servlet.ServletException
java.io.IOExceptionpublic java.lang.String getServletClass()
public ArrayDictionary getServletParameters()
protected void setValueOfSuperClass(int idx,
java.lang.Object value)
public void setValue(int idx,
java.lang.Object value)
When a change to that attribute is detected, the servlet is automatically reinitialized.
setValue in class FramedResourceidx - The index of the attribute to modify.value - The new attribute value.protected void destroyServlet()
public javax.servlet.Servlet getServlet()
protected boolean launchServlet(java.lang.Class cls)
throws javax.servlet.ServletException
cls - The servlet loaded main class.
javax.servlet.ServletException - if servlet can't be initialized.protected boolean isWrappingAServlet()
ServletIndexer
protected boolean launchServlet()
throws java.lang.ClassNotFoundException,
javax.servlet.ServletException
This method either succeed, or the wrapper resource itself will fail to initialize, acting as transparently as possible (in some sense).
java.lang.ClassNotFoundException - if servlet class can't be found.
javax.servlet.ServletException - if servlet can't be initialized.public boolean acceptUnload()
ResourcenotifyUnload method).
Returning false should never be needed, except for very strange resources.
acceptUnload in class Resourcepublic void notifyUnload()
FramedResource
notifyUnload in class FramedResourceprotected AutoReloadServletLoader getLocalServletLoader()
protected AutoReloadServletLoader createNewLocalServletLoader(boolean keepold)
public java.lang.String getServletName()
getServletName in interface javax.servlet.ServletConfigpublic void initialize(java.lang.Object[] values)
initialize in class FramedResourcevalues - The default attribute values.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||