Class w3c.jigsaw.resources.ResourceStoreManager
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.resources.ResourceStoreManager

java.lang.Object
   |
   +----w3c.jigsaw.resources.ResourceStoreManager

public class ResourceStoreManager
extends Object

Variable Index

 o closed
Is this store shutdown ?
 o entries
The loaded resource stores.
 o head
The fake head of our LRU list for store entries.
 o server
The server we are attached to.
 o sweeper
Our sweeper thread:
 o tail
The fake tail of our LRU list fro store entries.

Constructor Index

 o ResourceStoreManager(httpd)
Create a new resource store for the given server.

Method Index

 o checkClosed()
Check that this resource store manager isn't closed.
 o collect()
Collect enough entries to go back into fixed limits.
 o getMaxEntries()
 o loadResourceStore(ResourceStoreHolder, File)
Load a resource store.
 o lookupEntry(File, ResourceStoreHolder, boolean)
Lookup an entry in the store.
 o markUsed(File)
Mark the given store as having been used recently.
 o pickLRUEntry()
Pick the least recently used entry, and remove all links to it.
 o shutdown()
Shutdown this resource store manager.
 o unholdResourceStore(ResourceStoreHolder, File)
Unhold the given store.

Variables

 o entries
  protected Hashtable entries
The loaded resource stores.
 o closed
  protected boolean closed
Is this store shutdown ?
 o server
  protected httpd server
The server we are attached to.
 o head
  protected StoreEntry head
The fake head of our LRU list for store entries.
 o tail
  protected StoreEntry tail
The fake tail of our LRU list fro store entries.
 o sweeper
  protected StoreManagerSweeper sweeper
Our sweeper thread:

Constructors

 o ResourceStoreManager
  public ResourceStoreManager(httpd server)
Create a new resource store for the given server.
Parameters:
server - The server that wants a resource store manager.

Methods

 o getMaxEntries
  protected final int getMaxEntries()
 o checkClosed
  protected final synchronized void checkClosed()
Check that this resource store manager isn't closed.
Throws: RuntimeException
If the store manager was closed.
 o lookupEntry
  protected synchronized StoreEntry lookupEntry(File repository,
                                                ResourceStoreHolder holder,
                                                boolean create)
Lookup an entry in the store.
Parameters:
repository - The repository of the store to lookup.
create - Create a new entry if it doesn't exist.
 o pickLRUEntry
  protected synchronized StoreEntry pickLRUEntry()
Pick the least recently used entry, and remove all links to it. After this method as run, the least recently used entry for some store will be returned. The store manager will have discarded all its link to it, and the entry shutdown will have to be performed by the caller.
Returns:
An StoreEntry instance, to be cleaned up.
 o collect
  public void collect()
Collect enough entries to go back into fixed limits.
 o loadResourceStore
  public ResourceStore loadResourceStore(ResourceStoreHolder holder,
                                         File repository)
Load a resource store.
Parameters:
holder - The holder for the resource store.
repository - Its associated repository.
 o unholdResourceStore
  public void unholdResourceStore(ResourceStoreHolder holder,
                                  File repository)
Unhold the given store. For some reason, the holder for this store has decided to close it. Remove from ths list of this store holder. When this call is made, the caller is expected to have cleaned-up the store (stabilize it, etc).
Parameters:
holder - The holder of the store.
store - The store this holder doesn't want to hold anymore.
 o shutdown
  public synchronized void shutdown()
Shutdown this resource store manager. Go through all entries, and shut them down.
 o markUsed
  public void markUsed(File repository)
Mark the given store as having been used recently.
Parameters:
repository - The repository of the store that has been used.

All Packages  Class Hierarchy  This Package  Previous  Next  Index