com.ibm.websphere.servlet.cache
Interface Cache


public interface Cache

This is the underlying cache mechanism that is used by the JSP/Servlet cache. It contains the methods used to inspect and manage the current state of the cache.


Method Summary
 void clear()
          This method clears everything from the Cache, so that it is just like when it was instantiated.
 java.util.Enumeration getAllIds()
          This method returns the cache ids for all cache entries.
 int getDefaultPriority()
          Get the default priority value as set in the Admin GUI/dynacache.xml file.
 CacheEntry getEntry(java.lang.String id)
          This returns the cache entry identified by the specified cache id.
 int getMaxNumberCacheEntries()
          This gets the maximum number of cache entries.
 int getNumberCacheEntries()
          This gets the current number of cache entries.
 java.io.Serializable getValue(java.lang.String id, boolean askPermission)
          This tries to find a value in the cache.
 void invalidateById(java.lang.String id, boolean waitOnInvalidation)
          This invalidates in all caches all entries dependent on the specified id.
 void invalidateByTemplate(java.lang.String template, boolean waitOnInvalidation)
          This invalidates in all caches all entries dependent on the specified template.
 

Method Detail

getEntry

public CacheEntry getEntry(java.lang.String id)
This returns the cache entry identified by the specified cache id. It returns null if not in the cache.
Parameters:
id - The cache id for the entry. The id cannot be null.
Returns:
The entry indentified by the cache id.

getValue

public java.io.Serializable getValue(java.lang.String id,
                                     boolean askPermission)
This tries to find a value in the cache. If it is not there, it will try to execute it.
Parameters:
id - The cache id of the entry.
askPermission - True implies that execution must ask the coordinating CacheUnit for permission.

invalidateById

public void invalidateById(java.lang.String id,
                           boolean waitOnInvalidation)
This invalidates in all caches all entries dependent on the specified id.
Parameters:
id - The cache id or data id.
waitOnInvalidation - True indicates that this method should not return until the invalidations have taken effect on all caches. False indicates that the invalidations will be queued for later batch processing.

invalidateByTemplate

public void invalidateByTemplate(java.lang.String template,
                                 boolean waitOnInvalidation)
This invalidates in all caches all entries dependent on the specified template.
Parameters:
template - The template name.
waitOnInvalidation - True indicates that this method should not return until the invalidations have taken effect on all caches. False indicates that the invalidations will be queued for later batch processing.

clear

public void clear()
This method clears everything from the Cache, so that it is just like when it was instantiated.

getAllIds

public java.util.Enumeration getAllIds()
This method returns the cache ids for all cache entries.
Returns:
The Enumeration of cache ids.

getMaxNumberCacheEntries

public int getMaxNumberCacheEntries()
This gets the maximum number of cache entries.
Returns:
The maximum number of cache entries.

getNumberCacheEntries

public int getNumberCacheEntries()
This gets the current number of cache entries.
Returns:
The current number of cache entries.

getDefaultPriority

public int getDefaultPriority()
Get the default priority value as set in the Admin GUI/dynacache.xml file.
Parameters:
defaultPriority - The default priority for this appserver.