com.ibm.websphere.cache
Interface Cache


public interface Cache

This is the underlying cache mechanism that is used by the servlet, JSP, webservices, command 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.Collection getAllDependencyIds()
          This method returns the dependency ids for all cache entries.
 java.util.Enumeration getAllIds()
          This method returns the cache ids for all cache entries.
 java.util.Collection getCacheIdsByDependency(java.lang.String dependency)
          This method returns the cache ids of the entries dependent on the dependency id passed as a parameter or null if no entry depends on it.
 java.util.Collection getCacheIdsByTemplate(java.lang.String template)
          This method returns the cache ids of the entries that have the template passed as a parameter or null if no entry has this template.
 int getDefaultPriority()
          This method gets the default priority value as set in the Admin GUI/dynacache.xml file.
 CacheEntry getEntry(EntryInfo entryInfo)
          This returns the cache entry identified by the specified entry info.
 CacheEntry getEntry(java.lang.String id)
          Deprecated.  
 int getMaxNumberCacheEntries()
          This method gets the maximum number of cache entries.
 int getNumberCacheEntries()
          This method gets the current number of cache entries.
 java.lang.Object getValue(EntryInfo entryInfo, boolean askPermission)
          This tries to find a value in the cache.
 java.lang.Object getValue(java.lang.String id, boolean askPermission)
          Deprecated.  
 void invalidateById(java.lang.String id, boolean waitOnInvalidation)
          This method invalidates in all caches all entries dependent on the specified id.
 void invalidateByTemplate(java.lang.String template, boolean waitOnInvalidation)
          This method invalidates in all caches all entries dependent on the specified template.
 

Method Detail

getEntry

public CacheEntry getEntry(EntryInfo entryInfo)
This returns the cache entry identified by the specified entry info. It returns null if not in the cache.
Parameters:
entryInfo - The entry info object for the entry to be found. It cannot be null.
Returns:
The entry indentified by the cache id.

getEntry

public CacheEntry getEntry(java.lang.String id)
Deprecated.  

This returns the cache entry identified by the specified cache id. It returns null if not in the cache.
Parameters:
id - The cache id object for the entry to be found. It cannot be null.
Returns:
The entry indentified by the cache id.

getValue

public java.lang.Object getValue(EntryInfo entryInfo,
                                 boolean askPermission)
This tries to find a value in the cache. If it is not there, it will try to execute it.
Parameters:
entryInfo - The entry info object for the entry to be found. It cannot be null.
askPermission - True implies that execution must ask the coordinating CacheUnit for permission.
Returns:
Value of the cache entry idetified by the entry info.

getValue

public java.lang.Object getValue(java.lang.String id,
                                 boolean askPermission)
Deprecated.  

This method tries to find a value in the cache. If it is not there, it will try to execute it.
Parameters:
id - The cache id for the entry to be found. It cannot be null.
askPermission - True implies that execution must ask the coordinating CacheUnit for permission.

invalidateById

public void invalidateById(java.lang.String id,
                           boolean waitOnInvalidation)
This method 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 method 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 method gets the maximum number of cache entries.
Returns:
The maximum number of cache entries.

getNumberCacheEntries

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

getDefaultPriority

public int getDefaultPriority()
This method gets the default priority value as set in the Admin GUI/dynacache.xml file.
Returns:
The default priority for this appserver.

getAllDependencyIds

public java.util.Collection getAllDependencyIds()
This method returns the dependency ids for all cache entries.
Returns:
A Collection of dependency ids.

getCacheIdsByDependency

public java.util.Collection getCacheIdsByDependency(java.lang.String dependency)
This method returns the cache ids of the entries dependent on the dependency id passed as a parameter or null if no entry depends on it.
Parameters:
Dependency - ID for which Cache IDs are needed.
Returns:
A Collection of cache IDs or null.

getCacheIdsByTemplate

public java.util.Collection getCacheIdsByTemplate(java.lang.String template)
This method returns the cache ids of the entries that have the template passed as a parameter or null if no entry has this template.
Parameters:
Template - for which Cache IDs are needed.
Returns:
A Collection of cache IDs or null.