All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.tools.store.SampleContainer

java.lang.Object
   |
   +----w3c.tools.store.AttributeHolder
           |
           +----w3c.tools.store.Resource
                   |
                   +----w3c.tools.store.SampleContainer

public abstract class SampleContainer
extends Resource
implements ContainerInterface, ResourceStoreHolder
A raw container class, taht is itself a resource. This class implements the ContainerInterface by relying solely on the ResourceStore interface.


Variable Index

 o children
 o manager

Constructor Index

 o SampleContainer(String, ResourceStoreManager, File)

Method Index

 o acceptStoreUnload(ResourceStore)
ResourceStoreHolder implementation - Get rid of our store.
 o acquireChildren()
Acquire the resource store.
 o delete()
Delete this Resource instance, and remove it from its store.
 o delete(String)
 o enumerateResourceIdentifiers()
 o enumerateResourceIdentifiers(boolean)
Enumerate the name (ie identifiers) of our children.
 o getDefaultAttributes()
 o getResourceStore(ResourceStoreHolder)
ContainerInterface implementation - Hold underlying resource store.
 o hasResourceStore()
ContainerInterface implementation - Do we manage a store ?
 o lookup(String)
 o notifyStoreShutdown(ResourceStore)
ResourceStoreHolder implementation - Shutdown our associated store.
 o notifyStoreStabilize(ResourceStore)
ResourceStoreHolder implementation - Save our store.
 o registerResource(String, Resource, Hashtable)

Variables

 o children
 protected ResourceStore children
 o manager
 protected ResourceStoreManager manager

Constructors

 o SampleContainer
 public SampleContainer(String id,
                        ResourceStoreManager manager,
                        File repository)

Methods

 o getDefaultAttributes
 protected abstract Hashtable getDefaultAttributes()
 o acquireChildren
 protected final synchronized void acquireChildren()
Acquire the resource store. Should only be called from a synchronized method.

 o acceptStoreUnload
 public synchronized boolean acceptStoreUnload(ResourceStore store)
ResourceStoreHolder implementation - Get rid of our store. The resource store manager has decided that our store hasn't been used enough in the past to be worth keeping around.

We can still defer this operation by returning false in case a user is editing the store for example.

Parameters:
store - The store that to be freed.
Returns:
A boolean true if the resource store has been shutdown properly, false otherwise.
 o notifyStoreShutdown
 public synchronized void notifyStoreShutdown(ResourceStore store)
ResourceStoreHolder implementation - Shutdown our associated store.

Parameters:
store - The store to shutdown.
 o notifyStoreStabilize
 public void notifyStoreStabilize(ResourceStore store)
ResourceStoreHolder implementation - Save our store. Our store has probably been modified recently, save it.

Parameters:
store - The store to save.
Returns:
A boolean true if success.
 o hasResourceStore
 public boolean hasResourceStore()
ContainerInterface implementation - Do we manage a store ?

Returns:
Always true.
 o getResourceStore
 public synchronized ResourceStore getResourceStore(ResourceStoreHolder h)
ContainerInterface implementation - Hold underlying resource store.

Parameters:
h - The resource store holder.
Returns:
A pointer to our underlying store.
 o enumerateResourceIdentifiers
 public synchronized Enumeration enumerateResourceIdentifiers(boolean all)
Enumerate the name (ie identifiers) of our children.

Parameters:
all - Should all resources be listed.
Returns:
An enumeration, providing one element per child, which is the name of the child, as a String.
 o enumerateResourceIdentifiers
 public Enumeration enumerateResourceIdentifiers()
 o lookup
 public synchronized Resource lookup(String name) throws InvalidResourceException
 o delete
 public synchronized void delete()
Delete this Resource instance, and remove it from its store.

Overrides:
delete in class Resource
 o delete
 public synchronized void delete(String name)
 o registerResource
 public synchronized void registerResource(String id,
                                           Resource resource,
                                           Hashtable defs)

All Packages  Class Hierarchy  This Package  Previous  Next  Index