: Class JigsawServletContext

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.w3c.jigsaw.servlet
Class JigsawServletContext

    java.lang.Object
      |
      +--org.w3c.tools.resources.event.StructureChangedAdapter
            |
            +--org.w3c.jigsaw.servlet.JigsawServletContext

public class JigsawServletContext
extends StructureChangedAdapter
implements javax.servlet.ServletContext, PropertyMonitoring

Field Summary
`protected static java.lang.String` | `deflogfile`
`protected static java.lang.String` | `logdir`
`static java.lang.String` | `TEMPDIR_P`

Constructor Summary
`protected` | `JigsawServletContext(ResourceReference ref, ObservableProperties props)` Create a new ServletContext.

Method Summary
`protected AutoReloadServletLoader` | `createNewLocalServletLoader(boolean keepold)`
`java.lang.Object` | `getAttribute(java.lang.String name)` ServletContext implementation - Get an attribute value.
`java.util.Enumeration` | `getAttributeNames()`
`javax.servlet.ServletContext` | `getContext(java.lang.String uripath)`
`protected static java.lang.String` | `getFilePath(DirectoryResource dir)`
`java.lang.String` | `getInitParameter(java.lang.String name)` Returns a `String` containing the value of the named context-wide initialization parameter, or `null` if the parameter does not exist.
`java.util.Enumeration` | `getInitParameterNames()` Returns the names of the context's initialization parameters as an `Enumeration` of `String` objects, or an empty `Enumeration` if the context has no initialization parameters.
`protected static ResourceReference` | `getLocalRoot(ResourceReference rr_root, ResourceReference ref)`
`protected AutoReloadServletLoader` | `getLocalServletLoader()` Get or create a suitable LocalServletLoader instance to load that servlet.
`int` | `getMajorVersion()`
`java.lang.String` | `getMimeType(java.lang.String filename)` ServletContext implementation - Get the MIME type for given file.
`int` | `getMinorVersion()`
`javax.servlet.RequestDispatcher` | `getNamedDispatcher(java.lang.String name)` Returns a `RequestDispatcher` object that acts as a wrapper for the named servlet.
`java.lang.String` | `getRealPath(java.lang.String path)` ServletContext implementation - Translate a piece of path.
`protected static java.lang.String` | `getRealPath(java.lang.String path, ResourceReference rr_root, ResourceReference rr)` ServletContext implementation - Translate a piece of path.
`javax.servlet.RequestDispatcher` | `getRequestDispatcher(java.lang.String urlpath)` Returns a RequestDispatcher object for the specified URL path if the context knows of an active source (such as a servlet, JSP page, CGI script, etc) of content for the particular path.
`java.net.URL` | `getResource(java.lang.String path)`
`java.io.InputStream` | `getResourceAsStream(java.lang.String path)`
`ServerInterface` | `getServer()`
`java.lang.String` | `getServerInfo()` ServletContext implementation - Get server informations.
`javax.servlet.Servlet` | `getServlet(java.lang.String name)` Deprecated. since jsdk2.1
`java.io.File` | `getServletDirectory()`
`java.io.File` | `getServletLogFile()`
`java.util.Enumeration` | `getServletNames()` Deprecated. since jsdk2.1
`java.util.Enumeration` | `getServlets()` Deprecated. since jsdk2.1
`protected long` | `getServletTimeout()`
`protected static java.lang.String` | `guessContentTypeFromName(java.lang.String fname)` A useful utility routine that tries to guess the content-type of an object based upon its extension.
`void` | `log(java.lang.Exception ex, java.lang.String msg)` Deprecated. since jsdk2.1
`void` | `log(java.lang.String msg)` ServletContext implementation - Log a message.
`void` | `log(java.lang.String message, java.lang.Throwable throwable)`
`boolean` | `propertyChanged(java.lang.String name)` The callback method, invoked when any property change occurs.
`void` | `removeAttribute(java.lang.String name)`
`void` | `resourceUnloaded(StructureChangedEvent evt)` A resource is about to be unloaded This handles the `RESOURCE_UNLOADED` kind of events.
`void` | `setAttribute(java.lang.String name, java.lang.Object object)`

Methods inherited from class org.w3c.tools.resources.event.StructureChangedAdapter
`resourceCreated, resourceModified, resourceRemoved`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TEMPDIR_P

    public static final java.lang.String TEMPDIR_P

### logdir

    protected static java.lang.String logdir

### deflogfile

    protected static java.lang.String deflogfile

Constructor Detail

### JigsawServletContext

    protected JigsawServletContext(ResourceReference ref,
                                   ObservableProperties props)

  Create a new ServletContext.
  Parameters:
    `ref` - a ResourceReference pointing on a ServletDirectoryFrame.

Method Detail

### propertyChanged

    public boolean propertyChanged(java.lang.String name)

  Description copied from interface: PropertyMonitoring
  The callback method, invoked when any property change occurs.
  Specified by:
    propertyChanged in interface PropertyMonitoring
  Tags copied from interface: PropertyMonitoring
  Parameters:
    `name` - The name of the property that changed.
  Returns:
    A boolean, if true, accept the new property value, otherwise, reject it and reset the property to its old value.

### resourceUnloaded

    public void resourceUnloaded(StructureChangedEvent evt)

  Description copied from class: StructureChangedAdapter
  A resource is about to be unloaded This handles the `RESOURCE_UNLOADED` kind of events.
  Overrides:
    resourceUnloaded in class StructureChangedAdapter
  Tags copied from class: StructureChangedAdapter
  Parameters:
    `evt` - The event describing the change.

### getServletTimeout

    protected long getServletTimeout()

### guessContentTypeFromName

    protected static java.lang.String guessContentTypeFromName(java.lang.String fname)

  A useful utility routine that tries to guess the content-type of an object based upon its extension.

### getMimeType

    public java.lang.String getMimeType(java.lang.String filename)

  ServletContext implementation - Get the MIME type for given file.
  Specified by:
    getMimeType in interface javax.servlet.ServletContext

### getServer

    public ServerInterface getServer()

### getServletLogFile

    public java.io.File getServletLogFile()

### getServlet

    public javax.servlet.Servlet getServlet(java.lang.String name)

  Deprecated. since jsdk2.1

  ServletContext implementation - Lookup a given servlet.
  Specified by:
    getServlet in interface javax.servlet.ServletContext

### getServlets

    public java.util.Enumeration getServlets()

  Deprecated. since jsdk2.1

  ServletContext implementation - Enumerate all servlets within context.
  Specified by:
    getServlets in interface javax.servlet.ServletContext

### getServletNames

    public java.util.Enumeration getServletNames()

  Deprecated. since jsdk2.1

  ServletContext implementation - Enumerate all servlets names within context.
  Specified by:
    getServletNames in interface javax.servlet.ServletContext

### log

    public void log(java.lang.String msg)

  ServletContext implementation - Log a message.
  Specified by:
    log in interface javax.servlet.ServletContext

### log

    public void log(java.lang.Exception ex,
                    java.lang.String msg)

  Deprecated. since jsdk2.1

  Specified by:
    log in interface javax.servlet.ServletContext

### log

    public void log(java.lang.String message,
                    java.lang.Throwable throwable)

  Specified by:
    log in interface javax.servlet.ServletContext

### getRealPath

    protected static java.lang.String getRealPath(java.lang.String path,
                                                  ResourceReference rr_root,
                                                  ResourceReference rr)

  ServletContext implementation - Translate a piece of path.
  Parameters:
    `path` - the virtual path to translate
    `rr_root` - the Root ResourceReference
    `rr` - the target ResourceReference
  Returns:
    the real path

### getRealPath

    public java.lang.String getRealPath(java.lang.String path)

  ServletContext implementation - Translate a piece of path.
  Specified by:
    getRealPath in interface javax.servlet.ServletContext
  Parameters:
    `path` - the virtual path to translate
  Returns:
    the real path

### getFilePath

    protected static java.lang.String getFilePath(DirectoryResource dir)

### getLocalRoot

    protected static ResourceReference getLocalRoot(ResourceReference rr_root,
                                                    ResourceReference ref)

### getServerInfo

    public java.lang.String getServerInfo()

  ServletContext implementation - Get server informations.
  Specified by:
    getServerInfo in interface javax.servlet.ServletContext

### getAttribute

    public java.lang.Object getAttribute(java.lang.String name)

  ServletContext implementation - Get an attribute value. We map this into the ServletWrapper attributes, without support for name clashes though.
  Specified by:
    getAttribute in interface javax.servlet.ServletContext
  Parameters:
    `name` - The attribute name.

### setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.Object object)

  Specified by:
    setAttribute in interface javax.servlet.ServletContext

### removeAttribute

    public void removeAttribute(java.lang.String name)

  Specified by:
    removeAttribute in interface javax.servlet.ServletContext

### getAttributeNames

    public java.util.Enumeration getAttributeNames()

  Specified by:
    getAttributeNames in interface javax.servlet.ServletContext

### getInitParameter

    public java.lang.String getInitParameter(java.lang.String name)

  Returns a `String` containing the value of the named context-wide initialization parameter, or `null` if the parameter does not exist.

  This method can make available configuration information useful to an entire "web application". For example, it can provide a webmaster's email address or the name of a system that holds critical data.

  Specified by:
    getInitParameter in interface javax.servlet.ServletContext
  Parameters:
    `name` - a `String` containing the name of the parameter whose value is requested
  Returns:
    a `String` containing at least the servlet container name and version number
  See Also:
    `ServletConfig.getInitParameter(java.lang.String)`

### getInitParameterNames

    public java.util.Enumeration getInitParameterNames()

  Returns the names of the context's initialization parameters as an `Enumeration` of `String` objects, or an empty `Enumeration` if the context has no initialization parameters.
  Specified by:
    getInitParameterNames in interface javax.servlet.ServletContext
  Returns:
    an `Enumeration` of `String` objects containing the names of the context's initialization parameters
  See Also:
    `ServletConfig.getInitParameter(java.lang.String)`

### getLocalServletLoader

    protected AutoReloadServletLoader getLocalServletLoader()

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

### createNewLocalServletLoader

    protected AutoReloadServletLoader createNewLocalServletLoader(boolean keepold)

### getServletDirectory

    public java.io.File getServletDirectory()

### getRequestDispatcher

    public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String urlpath)

  Returns a RequestDispatcher object for the specified URL path if the context knows of an active source (such as a servlet, JSP page, CGI script, etc) of content for the particular path. This format of the URL path must be of the form /dir/dir/file.ext. The servlet engine is responsible for implementing whatever functionality is required to wrap the target source with an implementation of the RequestDispatcher interface.
  Specified by:
    getRequestDispatcher in interface javax.servlet.ServletContext
  Parameters:
    `urlpath` - Path to use to look up the target server resource

### getNamedDispatcher

    public javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String name)

  Returns a `RequestDispatcher` object that acts as a wrapper for the named servlet.

  Servlets (and JSP pages also) may be given names via server administration or via a web application deployment descriptor. A servlet instance can determine its name using `ServletConfig.getServletName()`.

  This method returns `null` if the `ServletContext` cannot return a `RequestDispatcher` for any reason.

  Specified by:
    getNamedDispatcher in interface javax.servlet.ServletContext
  Parameters:
    `name` - a `String` specifying the name of a servlet to wrap
  Returns:
    a `RequestDispatcher` object that acts as a wrapper for the named servlet
  See Also:
    `RequestDispatcher`, `ServletContext.getContext(java.lang.String)`, `ServletConfig.getServletName()`

### getMajorVersion

    public int getMajorVersion()

  Specified by:
    getMajorVersion in interface javax.servlet.ServletContext

### getMinorVersion

    public int getMinorVersion()

  Specified by:
    getMinorVersion in interface javax.servlet.ServletContext

### getContext

    public javax.servlet.ServletContext getContext(java.lang.String uripath)

  Specified by:
    getContext in interface javax.servlet.ServletContext

### getResource

    public java.net.URL getResource(java.lang.String path)
                             throws java.net.MalformedURLException

  Specified by:
    getResource in interface javax.servlet.ServletContext

### getResourceAsStream

    public java.io.InputStream getResourceAsStream(java.lang.String path)

  Specified by:
    getResourceAsStream in interface javax.servlet.ServletContext

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD