    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.jigsaw.resources.ContainerResource

    java.lang.Object
       |
       +----w3c.tools.store.AttributeHolder
               |
               +----w3c.tools.store.Resource
                       |
                       +----w3c.jigsaw.resources.HTTPResource
                               |
                               +----w3c.jigsaw.resources.FilteredResource
                                       |
                                       +----w3c.jigsaw.resources.ContainerResource

public abstract class ContainerResource
extends FilteredResource
implements ContainerInterface

The ContainerResource is a resource that can have children. By defining the abstract method of that class, you allow the generic ContainerResource editor to edit the content of your sub-class.

##

ContainerResource()

##

createDefaultResource(String)
  Create a default child resource in that container.
delete(String)
  Remove a child resource from that container.
enumerateResourceIdentifiers()
  Enumerate the children resource identifiers.
enumerateResourceIdentifiers(boolean)
  Enumerate children resource identifiers.
getResourceStore(ResourceStoreHolder)
  Get the store of that resource container.
hasResourceStore()
  Does this container manages its children through a ResourceStore ? If the container uses a resource store to hold its children, it must implement properly the `getResourceStore` method.
lookup(LookupState, LookupResult)
  Looking up inside a filtered resource.
lookup(String)
  Lookup a resource in that container.
registerResource(String, Resource, Hashtable)
  Initialize and register the given resource under the given name.

##

ContainerResource

     public ContainerResource()

##

registerResource

     public abstract void registerResource(String name,
                                           Resource child,
                                           Hashtable defs)

  Initialize and register the given resource under the given name. This method is called by the container resource editor to add a new child to the resource. The instance of the child is already created, but it is left up to the container to initialize the resource with its own set of default attributes.

  Parameters:
    name - The identifier of that resource in the container.
    child - The un-initialized children resource to be added.
    defs - The set f default attribute values.

enumerateResourceIdentifiers

     public Enumeration enumerateResourceIdentifiers()

  Enumerate the children resource identifiers.

  Returns:
    An enumeration of String, one item per child resource. In principle, a `lookup` on each String should return a valid resource (except if some other thread is fidling with the container).

lookup

     public abstract Resource lookup(String name) throws InvalidResourceException

  Lookup a resource in that container. Lookup a resource in that container.

  Parameters:
    name - The name (od identifier) of the resource to lookup.
  Returns:
    A instance of Resource, or null if such a resource doesn't exist.
  Throws: InvalidResourceException
    If such a resource exists, but couldn't be loaded from the store.

createDefaultResource

     public abstract HTTPResource createDefaultResource(String name)

  Create a default child resource in that container. This method is called by the editor to add a default resource in the container under the given name. The meaning of default is left up to the container here.

  Parameters:
    name - The identifier for the new resource.

lookup

     public boolean lookup(LookupState ls,
                           LookupResult lr) throws HTTPException

  Looking up inside a filtered resource. This is the place we apply the lookup filters, if any. If a filter knows how to compute the reply (for example, if it maintains a cache) then, it will return a true boolean indicating that processing this request shouldn't go further ahead (it has been done).

  Parameters:
    ls - The lookup state.
    lr - The in-progress lookup result.
  Returns:
    A boolean true if the lookup process is done (either becasue some reply was computed or because the target was found) false if request lookup should continue normally.
  Throws: HTTPException
    If some error occured during lookup.
  Overrides:
    lookup in class FilteredResource

    All Packages  Class Hierarchy  This Package  Previous  Next  Index