    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.tools.resources.ResourceContext

    java.lang.Object
       |
       +----org.w3c.tools.resources.ResourceContext

public class ResourceContext
extends Object

The resource context.

##

container
  The ResourceReference of the resource container.
debug
  debug flag
modules
  The set of registered modules.
parent
  Our parent context, if any.
reference
  The ResourceReference of our resource.
server
  The server of that resource context.
space
  Our Resource Space.

##

ResourceContext(ContainerResource)
  Create a ResourceContext from a container.
ResourceContext(ResourceContext)
  Create a ResourceContext from the parent context.
ResourceContext(ResourceReference)
  Create a ResourceContext from a container ResourceReference.
ResourceContext(ResourceSpace, ServerInterface)
  Create a ResourceContext.
ResourceContext(ServerInterface)
  Create a ResourceContext.

##

getContainer()
  Get the container of the resource.
getModule(String)
  Lookup a module within that context, and up the hierarchy of contexts.
getModule(String, boolean)
  Lookup a module within that resource context.
getParent()
  Get that context's ancestor.
getResourceReference()
  Get the ResourceReference of the resource.
getServer()
  Get the server this context is attached to.
getSpace()
  Get our Resource Space.
registerModule(String, Object)
  Register a module within that resource context.
setResourceReference(ResourceReference)
  Set the ResourceReference of the resource.
setSpace(ResourceSpace)
  Set the Resource Space.
toString()

##

debug

     public static boolean debug

  debug flag

parent

     protected ResourceContext parent

  Our parent context, if any.

modules

     public Hashtable modules

  The set of registered modules.

space

     protected ResourceSpace space

  Our Resource Space.

server

     protected ServerInterface server

  The server of that resource context.

reference

     protected ResourceReference reference

  The ResourceReference of our resource.

container

     protected ResourceReference container

  The ResourceReference of the resource container.

##

ResourceContext

     public ResourceContext(ContainerResource container)

  Create a ResourceContext from a container.

  Parameters:
    container - The resource container.

ResourceContext

     public ResourceContext(ResourceReference rr_container)

  Create a ResourceContext from a container ResourceReference.

  Parameters:
    container - The resource reference of the container. Must be an instance of ContainerResource.

ResourceContext

     public ResourceContext(ResourceContext parent)

  Create a ResourceContext from the parent context.

  Parameters:
    parent - The parent resource context.

ResourceContext

     public ResourceContext(ResourceSpace space,
                            ServerInterface server)

  Create a ResourceContext.

  Parameters:
    space - The ResourceSpace.
    server - The server.

ResourceContext

     public ResourceContext(ServerInterface server)

  Create a ResourceContext.

  Parameters:
    server - The server.

##

getContainer

     public ResourceReference getContainer()

  Get the container of the resource.

  Returns:
    A ResourceReference instance.

getResourceReference

     public ResourceReference getResourceReference()

  Get the ResourceReference of the resource.

  Returns:
    a ResourceReference instance.

setResourceReference

     public void setResourceReference(ResourceReference reference)

  Set the ResourceReference of the resource.

  Parameters:
    reference - The ResourceReference to set.

getSpace

     public ResourceSpace getSpace()

  Get our Resource Space.

  Returns:
    A ResourceSpace instance.

setSpace

     public void setSpace(ResourceSpace space)

  Set the Resource Space.

  Parameters:
    space - Our Resource Space.

getServer

     public ServerInterface getServer()

  Get the server this context is attached to.

  Returns:
    An ServerInterface instance (guaranteed not to be null.)

getParent

     public ResourceContext getParent()

  Get that context's ancestor.

  Returns:
    A ResourceContext instance, or null.

registerModule

     public synchronized void registerModule(String name,
                                             Object impl)

  Register a module within that resource context.

  Parameters:
    name - The module's name.
    impl - The module's implementation.

getModule

     public Object getModule(String name,
                             boolean inherited)

  Lookup a module within that resource context.

  Parameters:
    name - Name of the module to look for.
    inherited - Also look within the contexts hierarchy for an inherited module having that name.

getModule

     public Object getModule(String name)

  Lookup a module within that context, and up the hierarchy of contexts.

  Parameters:
    name - The module's name.
  Returns:
    An object implementing that module.

toString

     public String toString()

  Overrides:
    toString in class Object

    All Packages  Class Hierarchy  This Package  Previous  Next  Index