com.ibm.wsspi.cache
Class Cache
- java.lang.Object
com.ibm.wsspi.cache.Cache
- public class Cache
- extends java.lang.Object
Constructor Summary
Constructor and Description |
---|
Cache(Cache ci)
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
clear()
This method clears everything from the cache,
so that it is just like when it was instantiated.
|
|
clearDisk()
This method clears everything from the disk cache.
|
|
getAllDependencyIds()
This method returns the dependency IDs for all cache entries in the memory cache.
|
|
getAllIds()
This method returns the cache IDs for all cache entries from memory cache.
|
|
getCacheIdsByDependency(java.lang.String dependency)
This method returns the cache IDs of the entries in the memory cache specified by the dependency ID.
|
|
getCacheIdsByTemplate(java.lang.String template)
This method returns the cache IDs of the entries in the memory cache specified by the template.
|
getCacheStatisticsListener()
This method returns an instance of CacheStatisticsListener.
|
|
|
getCleanupFrequency()
This method returns a value for the disk cache cleanup frequency, in minutes.
|
|
getDefaultPriority()
This method returns the default priority value as set in the Administrator console GUI/dynacache.xml file.
|
|
getDelayOffload()
This method returns a boolean to indicate whether the disk cache is using buffers for dependency
IDs and templates.
|
|
getDelayOffloadDepIdBuckets()
This method returns a value for the maximum number of dependency identifier buckets in the disk cache
metadata in memory.
|
|
getDelayOffloadEntriesLimit()
This method returns a value for the maximum number of cache identifiers that are stored for an
individual dependency ID or template in the disk cache metadata in memory.
|
|
getDelayOffloadTemplateBuckets()
This method returns a value for the maximum number of template buckets in the disk cache
metadata in memory.
|
|
getDepIdsByRangeDisk(int index,int length)
This method returns the dependency IDs found in the disk cache based on specified the index and the length.
|
|
getDepIdsSizeDisk()
This method returns the current number of dependency IDs in the disk cache.
|
|
getDepIdValueDisk(java.lang.Object depId)
This method returns the cache IDs of the entries in the disk cache specified by the dependency ID.
|
|
getDiskCacheEntrySizeInMBLimit()
This method returns the maximum size of an individual cache entry in megabytes (MB).
|
|
getDiskCacheEvictionPolicy()
This method returns the eviction algorithm that the disk cache will use to evict entries
once the high threshold is reached.
|
|
getDiskCacheHighThreshold()
This method returns the high threshold is expressed in terms of the percentage of the disk cache
size in GB or entries.
|
|
getDiskCacheLowThreshold()
This method returns the low threshold is expressed in terms of the percentage of the disk cache
size in GB or entries.
|
|
getDiskCachePerformanceLevel()
This method returns the performance level to tune the performance of the disk cache.
|
|
getDiskCacheSizeInGBLimit()
This method returns the maximum number of disk cache size in gigabytes (GB).
|
|
getDiskCacheSizeInMBs()
This method returns the current disk cache size in Megabytes (MB).
|
|
getDiskCacheSizeLimit()
This method returns the maximum number of cache entries that are held in disk cache.
|
getEntry(java.lang.Object cacheId)
This method returns an instance of CacheEntry specified cache ID.
|
|
getEntryDisk(java.lang.Object cacheId)
This method returns the cache entry specified by cache ID from the disk cache.
|
|
|
getFlushToDiskOnStop()
This method returns a boolean to indicate whether in-memory cached objects are saved to disk when the server stops.
|
|
getIdsByRangeDisk(int index,int length)
This method returns the cache IDs found in the disk cache based on specified the index and the length.
|
|
getIdsSizeDisk()
This method returns the current number of cache entries in the disk cache.
|
|
getMaxCacheSizeInMB()
This method returns the maximum space on the JVM heap that can be occupied by
the cache entries.
|
|
getMaxNumberCacheEntries()
This method returns the maximum number of cache entries that are held in memory cache.
|
|
getMemoryCacheSizeInMB()
This method returns the current space on the JVM heap that is occupied by
the cache entries.
|
|
getNumberCacheEntries()
This method returns the current number of cache entries for this cache instance.
|
|
getSwapToDisk()
This method determines the disk offloaded feature is enabled or not.
|
|
getTemplatesByRangeDisk(int index,int length)
This method returns the templates found in the disk cache based on specified the index and the length.
|
|
getTemplatesSizeDisk()
This method returns the current number of templates in the disk cache.
|
|
getTemplateValueDisk(java.lang.String template)
This method returns the cache IDs of the entries in the disk cache specified by the template.
|
|
invalidateById(java.lang.String id,boolean waitOnInvalidation)
This method invalidates in all caches all entries dependent on the specified
id.
|
|
invalidateByTemplate(java.lang.String template,boolean waitOnInvalidation)
This method invalidates in all caches all entries dependent on the specified
template.
|
|
refreshEntry(CacheEntry ce)
This method moves the specified entry to the end of the LRU queue.
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
Cache
- public Cache(Cache ci)
Method Detail
refreshEntry
- public void refreshEntry(CacheEntry ce)
This method moves the specified entry to the end of the LRU queue.
Parameters:
ce
- The cache entry getSwapToDisk
- public boolean getSwapToDisk()
This method determines the disk offloaded feature is enabled or not.
Returns:
True if disk offload feature is enabled. False if disk offload is disabled.
getEntryDisk
- public CacheEntry getEntryDisk( java.lang.Object cacheId)
This method returns the cache entry specified by cache ID from the disk cache.
Parameters:
cacheId
- the cache ID Returns:
The cache entry. NULL if cache ID does not exist.
clearDisk
- public void clearDisk()
This method clears everything from the disk cache.
getIdsByRangeDisk
- public java.util.Collection getIdsByRangeDisk( int index,
- int length)
This method returns the cache IDs found in the disk cache based on specified the index and the length.
If index = 1 or -1, the set might contain "DISKCACHE_MORE" to indicate there are more cache IDs in the disk cache.
The caller need to remove DISKCACHE_MORE" from the set before it is being used.
Parameters:
index
- If index = 0, it starts the beginning. If index = 1, it means "next". If Index = -1, it means "previous". length
- The max number of cache IDs to be read. If length = -1, it reads all cache IDs until the end. Returns:
The collecton of cache IDs.
getTemplatesByRangeDisk
- public java.util.Collection getTemplatesByRangeDisk( int index,
- int length)
This method returns the templates found in the disk cache based on specified the index and the length.
If index = 1 or -1, the set might contain "DISKCACHE_MORE" to indicate there are more templates in the disk cache.
The caller need to remove DISKCACHE_MORE" from the set before it is being used.
Parameters:
index
- If index = 0, it starts the beginning. If index = 1, it means "next". If Index = -1, it means "previous". length
- The max number of templates to be read. If length = -1, it reads all templates until the end. Returns:
The collecton of templates.
getCacheStatisticsListener
- public CacheStatisticsListener getCacheStatisticsListener( )
This method returns an instance of CacheStatisticsListener.
Returns:
The instance of CacheStatisticsListener
getEntry
- public CacheEntry getEntry(java.lang.Object cacheId)
This method returns an instance of CacheEntry specified cache ID.
Parameters:
cacheId
- the cache ID Returns:
The instance of CacheEntry
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 from memory cache.
Returns:
The Enumeration of cache ids.
getMaxNumberCacheEntries
- public int getMaxNumberCacheEntries( )
This method returns the maximum number of cache entries that are held in memory cache.
Returns:
The maximum of cache entries.
getNumberCacheEntries
- public int getNumberCacheEntries( )
This method returns the current number of cache entries for this cache instance.
Returns:
The current number of cache entries.
getMaxCacheSizeInMB
- public int getMaxCacheSizeInMB( )
This method returns the maximum space on the JVM heap that can be occupied by
the cache entries.
Returns:
The maximum size of cache allowed in terms of JVM heap.
getMemoryCacheSizeInMB
- public float getMemoryCacheSizeInMB( )
This method returns the current space on the JVM heap that is occupied by
the cache entries.
Returns:
The current size of cache in terms of JVM heap.
getDefaultPriority
- public int getDefaultPriority()
This method returns the default priority value as set in the Administrator console GUI/dynacache.xml file.
Returns:
The default priority
getAllDependencyIds
- public java.util.Collection getAllDependencyIds( )
This method returns the dependency IDs for all cache entries in the memory cache.
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 in the memory cache specified by the dependency ID.
Parameters:
dependency
- ID for the group of cache IDs. Returns:
A Collection of cache IDs
getCacheIdsByTemplate
- public java.util.Collection getCacheIdsByTemplate( java.lang.String template)
This method returns the cache IDs of the entries in the memory cache specified by the template.
Parameters:
template
- for the group of cache IDs. Returns:
A Collection of cache IDs
getTemplatesSizeDisk
- public int getTemplatesSizeDisk( )
This method returns the current number of templates in the disk cache.
Returns:
The current number of templates
getTemplateValueDisk
- public java.util.Collection getTemplateValueDisk( java.lang.String template)
This method returns the cache IDs of the entries in the disk cache specified by the template.
Parameters:
template
- for the group of cache IDs. Returns:
A Collection of cache IDs
getIdsSizeDisk
- public int getIdsSizeDisk()
This method returns the current number of cache entries in the disk cache.
Returns:
The current number of cache entries
getDepIdsSizeDisk
- public int getDepIdsSizeDisk()
This method returns the current number of dependency IDs in the disk cache.
Returns:
The current number of dependency IDs
getDepIdsByRangeDisk
- public java.util.Collection getDepIdsByRangeDisk( int index,
- int length)
This method returns the dependency IDs found in the disk cache based on specified the index and the length.
If index = 1 or -1, the set might contain "DISKCACHE_MORE" to indicate there are more dependency IDs in the disk cache.
The caller need to remove DISKCACHE_MORE" from the set before it is being used.
Parameters:
index
- If index = 0, it starts the beginning. If index = 1, it means "next". If Index = -1, it means "previous". length
- The max number of dependency IDs to be read. If length = -1, it reads all dependency IDs until the end. Returns:
The collecton of dependency IDs.
getDepIdValueDisk
- public java.util.Collection getDepIdValueDisk( java.lang.Object depId)
This method returns the cache IDs of the entries in the disk cache specified by the dependency ID.
Parameters:
depId
- for the group of cache IDs. Returns:
A Collection of cache IDs
getDiskCacheSizeLimit
- public long getDiskCacheSizeLimit( )
This method returns the maximum number of cache entries that are held in disk cache.
Returns:
The maximum of disk cache entries.
getDiskCacheSizeInGBLimit
- public long getDiskCacheSizeInGBLimit( )
This method returns the maximum number of disk cache size in gigabytes (GB).
Returns:
The maximum of disk cache size in GB.
getDiskCacheEntrySizeInMBLimit
- public long getDiskCacheEntrySizeInMBLimit( )
This method returns the maximum size of an individual cache entry in megabytes (MB).
Any cache entry that is larger than this, when evicted from memory, will not be offloaded
to disk.
Returns:
The maximum of disk cache entry size in MB.
getFlushToDiskOnStop
- public boolean getFlushToDiskOnStop( )
This method returns a boolean to indicate whether in-memory cached objects are saved to disk when the server stops.
Returns:
boolean flushToDiskOnStop true or false
getDiskCachePerformanceLevel
- public int getDiskCachePerformanceLevel( )
This method returns the performance level to tune the performance of the disk cache.
Returns:
Peformance level 0=low 1=balance 2=custom 3=high
getCleanupFrequency
- public long getCleanupFrequency( )
This method returns a value for the disk cache cleanup frequency, in minutes.
If this value is set to 0, the cleanup runs only at midnight. This setting applies
only when the Disk Offload Performance Level is low, balanced, or custom.
The high performance level does not require disk cleanup, and this value is ignored.
Returns:
Cleanup frequency in minutes
getDelayOffload
- public boolean getDelayOffload( )
This method returns a boolean to indicate whether the disk cache is using buffers for dependency
IDs and templates.
Returns:
boolean delayOffload true or false
getDelayOffloadEntriesLimit
- public long getDelayOffloadEntriesLimit( )
This method returns a value for the maximum number of cache identifiers that are stored for an
individual dependency ID or template in the disk cache metadata in memory. If this limit is exceeded,
the information is offloaded to the disk. This setting applies only when the disk offload performance
level is custom.
Returns:
Delay offload entries limit
getDelayOffloadDepIdBuckets
- public long getDelayOffloadDepIdBuckets( )
This method returns a value for the maximum number of dependency identifier buckets in the disk cache
metadata in memory. If this limit is exceeded, the information is offloaded to the disk. This setting
applies only when the disk cache performance level is custom.
Returns:
Delay offload dependency id buckets
getDelayOffloadTemplateBuckets
- public long getDelayOffloadTemplateBuckets( )
This method returns a value for the maximum number of template buckets in the disk cache
metadata in memory. If this limit is exceeded, the information is offloaded to the disk. This setting
applies only when the disk cache performance level is custom.
Returns:
Delay offload template buckets
getDiskCacheEvictionPolicy
- public int getDiskCacheEvictionPolicy( )
This method returns the eviction algorithm that the disk cache will use to evict entries
once the high threshold is reached.
Returns:
Eviction policy 0=disable 1=random 2:size
getDiskCacheHighThreshold
- public int getDiskCacheHighThreshold( )
This method returns the high threshold is expressed in terms of the percentage of the disk cache
size in GB or entries. The high value is used when limit disk cache size in GB and limit disk
cache size in entries are specified.
Returns:
High threshold in percentage
getDiskCacheLowThreshold
- public int getDiskCacheLowThreshold( )
This method returns the low threshold is expressed in terms of the percentage of the disk cache
size in GB or entries. The lower value is used when limit disk cache size in GB and limit disk
cache size in entries are specified.
Returns:
Low threshold in percentage
getDiskCacheSizeInMBs
- public float getDiskCacheSizeInMBs( )
This method returns the current disk cache size in Megabytes (MB).
Returns:
current disk cache size in MB