Interface ICacheAccessManagement
- All Known Subinterfaces:
ICacheAccess<K,
,V> IGroupCacheAccess<K,
V>
- All Known Implementing Classes:
AbstractCacheAccess
,CacheAccess
,GroupCacheAccess
public interface ICacheAccessManagement
ICacheAccessManagement defines the methods for cache management, cleanup and shutdown.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all of the elements from a region.void
dispose()
Dispose this region.int
freeMemoryElements
(int numberToFree) This instructs the memory cache to remove the numberToFree according to its eviction policy.Gets the ICompositeCacheAttributes of the cache regionGetElementAttributes will return an attribute object describing the current attributes associated with the object name.This returns the ICacheStats object with information on this region and its auxiliaries.getStats()
void
Sets the ICompositeCacheAttributes of the cache regionvoid
This method is does not reset the attributes for items already in the cache.
-
Method Details
-
dispose
void dispose()Dispose this region. Flushes objects to and closes auxiliary caches. This is a shutdown command!To simply remove all elements from the region use clear().
-
clear
Removes all of the elements from a region.- Throws:
CacheException
-
getDefaultElementAttributes
GetElementAttributes will return an attribute object describing the current attributes associated with the object name. If no name parameter is available, the attributes for the region will be returned. The name object must override the Object.equals and Object.hashCode methods.- Returns:
- The elementAttributes value
- Throws:
CacheException
-
setDefaultElementAttributes
This method is does not reset the attributes for items already in the cache. It could potentially do this for items in memory, and maybe on disk (which would be slow) but not remote items. Rather than have unpredictable behavior, this method just sets the default attributes. Items subsequently put into the cache will use these defaults if they do not specify specific attributes.- Parameters:
attr
- the default attributes.- Throws:
CacheException
- if something goes wrong.
-
getCacheAttributes
Gets the ICompositeCacheAttributes of the cache region- Returns:
- ICompositeCacheAttributes
-
setCacheAttributes
Sets the ICompositeCacheAttributes of the cache region- Parameters:
cattr
- The new ICompositeCacheAttribute value
-
freeMemoryElements
This instructs the memory cache to remove the numberToFree according to its eviction policy. For example, the LRUMemoryCache will remove the numberToFree least recently used items. These will be spooled to disk if a disk auxiliary is available.- Parameters:
numberToFree
-- Returns:
- the number that were removed. if you ask to free 5, but there are only 3, you will get 3.
- Throws:
CacheException
-
getStatistics
This returns the ICacheStats object with information on this region and its auxiliaries.This data can be formatted as needed.
- Returns:
- ICacheStats
-
getStats
- Returns:
- A String version of the stats.
-