    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.jigsaw.servlet.ServletWrapper

    java.lang.Object
       |
       +----org.w3c.tools.resources.AttributeHolder
               |
               +----org.w3c.tools.resources.Resource
                       |
                       +----org.w3c.tools.resources.FramedResource
                               |
                               +----org.w3c.jigsaw.servlet.ServletWrapper

public class ServletWrapper
extends FramedResource
implements ServletConfig

##

ATTR_AUTO_RELOAD
  Attribute index - use auto-reload?
ATTR_PARAMETERS
  Attribute index - The init parameters for that servlet.
ATTR_SERVLET_CLASS
  Attributes index - The servlet class name.
ATTR_SERVLET_CONTEXT
  Attribute index - Our parent-inherited servlet context.
ATTR_SESSION_CONTEXT
  Attribute index - Our parent-inherited session context.
debug
inited
  Is out servler initialized ?
loader
servlet
  The servlet wrapped within that Jigsaw resource.

##

ServletWrapper()

##

checkServletClass()
destroyServlet()
  Destroy the servlet we are wrapping.
getAutoReloadFlag()
  Should we use LocalClassLoader? (auto-reload)
getInitParameter(String)
  Servlet stub implementation - Get an init parameter value.
getInitParameterNames()
  Servlet stub implementation - Get all init parameters.
getLocalServletLoader()
  Get or create a suitable LocalServletLoader instance to load that servlet.
getNewLocalServletLoader(boolean)
getServlet()
  Get the servlet we are wrapping.
getServletClass()
  Get the class name of the wrapped servlet.
getServletContext()
  Servlet stub implementation - Get that servlet context.
getServletDirectory()
  The Path where we can find the servlet class file.
getServletParameters()
  Get the init parameters for our wrapped servlet.
getSessionContext()
initialize(Object[])
  Initialize this servlet wrapper resource.
isInited()
launchServlet()
  Launch the servlet we are wrapping.
launchServlet(Class)
  Initialize our servlet from the given (loaded) class.
notifyUnload()
  This resource is being unloaded.
service(Request, Reply)
setValue(int, Object)
  Catch assignements to the servlet class name attribute.
setValueOfSuperClass(int, Object)

##

loader

     protected LocalServletLoader loader

debug

     protected static final boolean debug

ATTR_SERVLET_CLASS

     protected static int ATTR_SERVLET_CLASS

  Attributes index - The servlet class name.

ATTR_PARAMETERS

     protected static int ATTR_PARAMETERS

  Attribute index - The init parameters for that servlet.

ATTR_SERVLET_CONTEXT

     protected static int ATTR_SERVLET_CONTEXT

  Attribute index - Our parent-inherited servlet context.

ATTR_SESSION_CONTEXT

     protected static int ATTR_SESSION_CONTEXT

  Attribute index - Our parent-inherited session context.

ATTR_AUTO_RELOAD

     protected static int ATTR_AUTO_RELOAD

  Attribute index - use auto-reload?

servlet

     protected Servlet servlet

  The servlet wrapped within that Jigsaw resource.

inited

     protected boolean inited

  Is out servler initialized ?

##

ServletWrapper

     public ServletWrapper()

##

getAutoReloadFlag

     protected boolean getAutoReloadFlag()

  Should we use LocalClassLoader? (auto-reload)

getServletDirectory

     public File getServletDirectory()

  The Path where we can find the servlet class file.

getInitParameter

     public synchronized String getInitParameter(String string)

  Servlet stub implementation - Get an init parameter value.

getInitParameterNames

     public synchronized Enumeration getInitParameterNames()

  Servlet stub implementation - Get all init parameters.

getServletContext

     public ServletContext getServletContext()

  Servlet stub implementation - Get that servlet context.

getSessionContext

     public JigsawHttpSessionContext getSessionContext()

checkServletClass

     protected void checkServletClass()

isInited

     protected boolean isInited()

service

     protected void service(Request request,
                            Reply reply) throws ServletException, IOException

getServletClass

     public String getServletClass()

  Get the class name of the wrapped servlet.

  Returns:
    The class name for the servlet if attribute is defined. Otherwise the class name is deduced from the resource identifier.

getServletParameters

     public ArrayDictionary getServletParameters()

  Get the init parameters for our wrapped servlet.

  Returns:
    An ArrayDictionary instance if the attribute is defined, false otherwise.

setValueOfSuperClass

     protected void setValueOfSuperClass(int idx,
                                         Object value)

setValue

     public void setValue(int idx,
                          Object value)

  Catch assignements to the servlet class name attribute.

  When a change to that attribute is detected, the servlet is automatically reinitialized.

  Overrides:
    setValue in class FramedResource

destroyServlet

     protected synchronized void destroyServlet()

  Destroy the servlet we are wrapping.

getServlet

     public Servlet getServlet()

  Get the servlet we are wrapping.

  Returns:
    A servlet instance, if the servlet is alredy running, null otherwise.

launchServlet

     protected boolean launchServlet(Class cls)

  Initialize our servlet from the given (loaded) class.

  Parameters:
    cls - The servlet loaded main class.
  Returns:
    A boolean, true if servlet was successfully initialised, false otherwise.

launchServlet

     protected boolean launchServlet()

  Launch the servlet we are wrapping.

  This method either succeed, or the wrapper resource itself will fail to initialize, acting as transparently as possible (in some sense).

  Returns:
    A boolean, true if servlet launched.

notifyUnload

     public void notifyUnload()

  This resource is being unloaded.

  Overrides:
    notifyUnload in class FramedResource

getLocalServletLoader

     protected synchronized LocalServletLoader getLocalServletLoader()

  Get or create a suitable LocalServletLoader instance to load that servlet.

  Returns:
    A LocalServletLoader instance.

getNewLocalServletLoader

     protected synchronized LocalServletLoader getNewLocalServletLoader(boolean keepold)

initialize

     public void initialize(Object values[])

  Initialize this servlet wrapper resource. After the wrapper itself is inited, it performs the servlet initialzation.

  Parameters:
    values - The default attribute values.
  Overrides:
    initialize in class FramedResource

    All Packages  Class Hierarchy  This Package  Previous  Next  Index