Class w3c.www.protocol.http.cache.jdbmResourceStore
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.www.protocol.http.cache.jdbmResourceStore

java.lang.Object
   |
   +----w3c.www.protocol.http.cache.jdbmResourceStore

public class jdbmResourceStore
extends Object
implements ResourceStore

Variable Index

 o defdefs
 o LOADED_LIMIT
 o LOADED_THRESOLD

Constructor Index

 o jdbmResourceStore()

Method Index

 o addResource(Resource)
Add this resource to this resource store.
 o dbmError(Exception, String)
A jdbm error has occured, this is potentially serious.
 o enumerateResourceIdentifiers()
Enumerate all the resources saved in this store.
 o getLoadedCount()
 o getResourceBytes(String)
Get the bytes that are the pickled version of the given resource.
 o hasResource(String)
Check for the existence of a resource in this store.
 o initialize(ResourceStoreManager, File)
This resource store is being built, initialize it with the given arg.
 o listLRU(PrintStream, String)
 o loadResource(String)
 o loadResource(String, Hashtable)
Restore the resource whose name is given.
 o lockResource(ResourceLocker, String)
Lock the given resource in the cache.
 o lookupResource(String)
Get this resource, but only if already loaded.
 o main(String[])
Dump all resources.
 o markModified(String)
Mark this resource as modified.
 o removeResource(String)
Remove this resource from the repository.
 o renameResource(String, String)
 o runStoreSweeper()
 o save()
Save this store.
 o saveResource(jdbmResource)
 o saveResource(String)
Stabilize the resource having the given identifier.
 o setPersist(Resource)
 o shutdown()
Shutdown this store.
 o unloadResource()
Unload one selected resource from the store.
 o unlockResource(ResourceLocker, String)
Unlock the given resource in the cache.

Variables

 o LOADED_LIMIT
  public final static int LOADED_LIMIT
 o LOADED_THRESOLD
  public final static int LOADED_THRESOLD
 o defdefs
  protected Hashtable defdefs

Constructors

 o jdbmResourceStore
  public jdbmResourceStore()

Methods

 o setPersist
  public void setPersist(Resource resource)
 o listLRU
  public void listLRU(PrintStream out,
                      String msg)
 o runStoreSweeper
  public void runStoreSweeper()
 o getLoadedCount
  public final int getLoadedCount()
 o unloadResource
  public void unloadResource()
Unload one selected resource from the store.
 o dbmError
  protected void dbmError(Exception ex,
                          String msg)
A jdbm error has occured, this is potentially serious.
Parameters:
ex - The dbm exception.
msg - An informative description of the error.
 o getResourceBytes
  protected synchronized byte[] getResourceBytes(String identifier)
Get the bytes that are the pickled version of the given resource. This opens the file for each resource, it could of course be optimized for the cases were all the resources are to be loaded at once.
Parameters:
identifier - The resource identifier.
Returns:
The length, in the instance buffer, of the bytes that makes this resource.
 o saveResource
  protected void saveResource(jdbmResource entry)
 o loadResource
  public Resource loadResource(String identifier,
                               Hashtable defs) throws InvalidResourceException
Restore the resource whose name is given.
Parameters:
identifier - The identifier of the resource to restore.
defs - Default attribute values. If the resource needs to be restored from its pickled version, this Hashtable provides a set of default values for some of the attributes.
Returns:
A Resource instance, or null.
 o loadResource
  public Resource loadResource(String identifier) throws InvalidResourceException
 o renameResource
  public synchronized void renameResource(String oldid,
                                          String newid)
 o lookupResource
  public Resource lookupResource(String identifier)
Get this resource, but only if already loaded. The resource store may (recommended) maintain a cache of the resource it loads from its store. If the resource having this identifier has already been loaded, return it, otherwise, return null.
Parameters:
identifier - The resource identifier.
Returns:
A Resource instance, or null.
 o saveResource
  public void saveResource(String identifier) throws UnknownResourceException
Stabilize the resource having the given identifier.
Parameters:
identifier - The resource identifier.
Throws: UnknownResourceException
If the resource is unknown.
 o lockResource
  public boolean lockResource(ResourceLocker locker,
                              String identifier)
Lock the given resource in the cache.
Parameters:
identifier - The identifier of the resource to be locked in cache.
Returns:
A boolean true if locking succeeded.
 o unlockResource
  public void unlockResource(ResourceLocker locker,
                             String identifier)
Unlock the given resource in the cache.
Parameters:
identifier - The identifier of the resource to be unlocked.
 o addResource
  public void addResource(Resource resource)
Add this resource to this resource store.
Parameters:
resource - The resource to be added.
 o removeResource
  public void removeResource(String identifier)
Remove this resource from the repository.
Parameters:
identifier - The identifier of the resource to be removed.
 o markModified
  public void markModified(String identifier)
Mark this resource as modified.
Parameters:
identifier - The identifier of the modified resource.
 o shutdown
  public void shutdown()
Shutdown this store.
 o save
  public synchronized void save()
Save this store.
 o enumerateResourceIdentifiers
  public Enumeration enumerateResourceIdentifiers()
Enumerate all the resources saved in this store.
Returns:
An enumeration of Strings, giving the identifier for all the resources that this store knows about.
 o hasResource
  public boolean hasResource(String identifier)
Check for the existence of a resource in this store.
Parameters:
identifier - The identifier of the resource to check.
Returns:
A boolean true if the resource exists in this store, false otherwise.
 o initialize
  public void initialize(ResourceStoreManager manager,
                         File repository)
This resource store is being built, initialize it with the given arg.
Parameters:
repository - A file, giving the location of the associated repository.
 o main
  public static void main(String args[])
Dump all resources.

All Packages  Class Hierarchy  This Package  Previous  Next  Index