Interface COM.ibm.jaws.services.bcfw.CacheManager
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface COM.ibm.jaws.services.bcfw.CacheManager

public interface CacheManager
extends Object
A BaseCollectionEC (EC stands for external cache) can delegate its cache management to a CacheManager, simplifying the BaseCollectionEC implementation. A CacheManager instance can be shared by multiple BaseCollectionEC instances, improving performance by allowing the cache space resource to be used where most needed. The CacheManager determines the criteria for keeping or discarding the Cached objects. The CacheManager keeps cache status information in a CacheEntry, which can either be supported directly by the Cached object or can be a separate generic object that references its Cached object. The BaseCollectionEC can tell the CacheManager to uncache any of the BaseCollectionEC's objects.

A BaseCollectionEC must be aware that it is using an external CacheManager. The CacheManager is an initialization input parameter to these BaseCollectionEC's. The BaseCollectionEC calls the CacheManager using the interface described here. The CacheManager calls the BaseCollectionEC with an interface called BaseCollectionEC to notify the BaseCollectionEC that one of its Cached object's is being discarded from the cache.

A BaseCollectionEC that supports the single-object case (ie, the Cached object supports the CachedEntry interface, so there is a single object at runtime), the BaseCollectionEC news this object. A BaseCollectionEC that supports the two-object case (ie, the Cached object does not support the CacheEntry interface, so there are two objects at runtime), the BaseCollectionEC asks the CacheManager to create a CacheEntry.


Method Index

 o cacheEntrys()
Returns an Enumeration of all the CacheEntrys in this cache.
 o cacheEntrys(BaseCollectionEC)
Returns an Enumeration of all the CacheEntrys in this cache for Cached objects owned by the indicated BaseCollectionEC.
 o cacheObject(BaseCollectionEC, String, Manageable)
Adds an entry to the cache.
 o getEntry(BaseCollectionEC, String)
Returns the CacheEntry for the entry owned by the indicated BaseCollectionEC with the specified key.
 o getNewCacheEntry()
This method is used by a BaseCollectionEC that supports the two-object case to get a new CacheEntry.
 o uncacheAllObjects()
This method remove all CacheEntrys in the cache.
 o uncacheAllObjects(BaseCollectionEC)
This method removes all Cached objects in the cache owned by the specified BaseCollectionEC.
 o uncacheObject(BaseCollectionEC, String)
This method allows the BaseCollectionEC to take a single CacheEntry out of the cache.
 o uncacheObject(CacheEntry)
This method allows the BaseCollectionEC to take a single CacheEntry out of the cache.

Methods

 o getNewCacheEntry
  public abstract CacheEntry getNewCacheEntry()
This method is used by a BaseCollectionEC that supports the two-object case to get a new CacheEntry.
Returns:
is a newly created an uninitialized CacheEntry object.
 o cacheObject
  public abstract CacheEntry cacheObject(BaseCollectionEC base,
                                         String key,
                                         Manageable cachedObject)
Adds an entry to the cache.
Parameters:
base - is the BaseCollectionEC that manages the Cached object.
key - is the String Identifier for the object to be cached.
cachedObject - is the Cached object to be added to the cache.
Returns:
is a CacheEntry is returned for this entry. It is used to notify this CacheManager about the use of the entry.
 o getEntry
  public abstract CacheEntry getEntry(BaseCollectionEC base,
                                      String key)
Returns the CacheEntry for the entry owned by the indicated BaseCollectionEC with the specified key.
Parameters:
base - is the BaseCollectionEC that manages the Cached object.
key - is the String Identifier that idicates the entry within the BaseCollectionEC.
Returns:
is a CacheEntry representing the Cached object identified or null if the requested entry is not in the cache.
 o uncacheObject
  public abstract void uncacheObject(CacheEntry entry)
This method allows the BaseCollectionEC to take a single CacheEntry out of the cache. The BaseCollectionEC should do this if the Cached object is remove()ed or if the BaseCollectionEC decides to override CacheManager's criteria for cache residency. Otherwise, the BaseCollectionEC lets the CacheManager decide how long the Cached object stays in the cache. If the entry is not in the cache, then nothing happens.
Parameters:
entry - is the CacheEntry representing the Cached object to be removed from the cache.
 o uncacheObject
  public abstract CacheEntry uncacheObject(BaseCollectionEC base,
                                           String key)
This method allows the BaseCollectionEC to take a single CacheEntry out of the cache. The BaseCollectionEC should do this if the Cached object is remove()ed or if the BaseCollectionEC decides to override CacheManager's criteria for cache residency. Otherwise, the BaseCollectionEC lets the CacheManager decide how long the Cached object stays in the cache. If the entry is not in the cache, then nothing happens.
Parameters:
bc - the BaseCollectionEC that manages the Cached object to be removed from the cache.
key - the key of the entry to be removed.
 o uncacheAllObjects
  public abstract void uncacheAllObjects(BaseCollectionEC base)
This method removes all Cached objects in the cache owned by the specified BaseCollectionEC. The BaseCollectionEC does this when it is deactivated.
 o uncacheAllObjects
  public abstract void uncacheAllObjects()
This method remove all CacheEntrys in the cache.
 o cacheEntrys
  public abstract Enumeration cacheEntrys()
Returns an Enumeration of all the CacheEntrys in this cache.
Returns:
is an Enumeration of CacheEntrys.
 o cacheEntrys
  public abstract Enumeration cacheEntrys(BaseCollectionEC base)
Returns an Enumeration of all the CacheEntrys in this cache for Cached objects owned by the indicated BaseCollectionEC.
Parameters:
base - the BaseCollectionEC whose CacheEntrys are enumerated. This is useful during the implementation of the cleanAll() method of the BaseCollectionEC.
Returns:
is an Enumeration of the CacheEntrys for the Cached objects owned by the BaseCollectionEC.

All Packages  Class Hierarchy  This Package  Previous  Next  Index