All Packages Class Hierarchy This Package Previous Next Index
Interface w3c.tools.store.ContainerInterface
- public interface ContainerInterface
The duties assigned to a resource container.
A resource container may or may not be a resource itself, in all cases,
it must provide the following methods.
-
delete(String)
- Remove a child resource from that container.
-
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(String)
- Lookup a children in the container.
-
registerResource(String, Resource, Hashtable)
- Initialize and register the given resource within that container.
hasResourceStore
public abstract boolean 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.
The only reason for a container not to use a resource store to hold
its children, is if these children are created dynamically, or on
demand.
- Returns:
- A boolean, true if the container uses a
resource store to hold its children.
getResourceStore
public abstract ResourceStore getResourceStore(ResourceStoreHolder holder)
- Get the store of that resource container.
Provides access to the underlying store of the container, when possible.
The holder is attached to the underlying resource store of the resource
container.
- Parameters:
- holder - The holder to attach to the container's store.
- Returns:
- A pointer to the underlying store, on success, null
on failure.
enumerateResourceIdentifiers
public abstract Enumeration enumerateResourceIdentifiers(boolean all)
- Enumerate children resource identifiers.
- Parameters:
- all - Should all resources be enumerated ? Resources are often
created on demand only, this flag allows the caller to tell the
container about wether it is interested only in already created
resources, or in all resources (even the one that have not yet been
created).
- Returns:
- An String enumeration, one element per child.
lookup
public abstract Resource lookup(String name) throws InvalidResourceException
- Lookup a children in the container.
- Parameters:
- name - The name of the children to lookup.
- Throws: InvalidResourceException
- If the container could not restore
the resource from its store.
delete
public abstract void delete(String name)
- Remove a child resource from that container.
- Parameters:
- name - The name of the child to remove.
registerResource
public abstract void registerResource(String name,
Resource resource,
Hashtable defs)
- Initialize and register the given resource within that container.
- Parameters:
- name - The identifier for the resource.
- resource - An unitialized resource instance.
- defs - A default set of init attribute values (may be
null).
All Packages Class Hierarchy This Package Previous Next Index