Interface ICache<K,V> 
- All Superinterfaces:
- ICacheType
- All Known Subinterfaces:
- AuxiliaryCache<K,,- V> - IRemoteCacheClient<K,- V> 
- All Known Implementing Classes:
- AbstractAuxiliaryCache,- AbstractAuxiliaryCacheEventLogging,- AbstractDiskCache,- AbstractRemoteAuxiliaryCache,- AbstractRemoteCacheNoWaitFacade,- BlockDiskCache,- CompositeCache,- IndexedDiskCache,- JDBCDiskCache,- LateralCache,- LateralCacheNoWait,- LateralCacheNoWaitFacade,- MySQLDiskCache,- RemoteCache,- RemoteCacheNoWait,- RemoteCacheNoWaitFacade,- RemoteHttpCache
This is the top level interface for all cache like structures. It defines the methods used
 internally by JCS to access, modify, and instrument such structures.
 This allows for a suite of reusable components for accessing such structures, for example
 asynchronous access via an event queue.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.commons.jcs3.engine.behavior.ICacheTypeICacheType.CacheType
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()Prepares for shutdown.Gets an item from the cache.Returns the cache name.Map<K,ICacheElement<K, V>> getMatching(String pattern) Gets items from the cache matching the given pattern.Map<K,ICacheElement<K, V>> getMultiple(Set<K> keys) Gets multiple items from the cache based on the given set of keys.intgetSize()Returns the current cache size in number of elements.getStats()Returns the cache stats.Returns the cache status.booleanRemoves an item from the cache.voidRemoves all cached items from the cache.voidsetKeyMatcher(IKeyMatcher<K> keyMatcher) Sets the key matcher used by get matching.voidupdate(ICacheElement<K, V> element) Puts an item to the cache.Methods inherited from interface org.apache.commons.jcs3.engine.behavior.ICacheTypegetCacheType
- 
Field Details- 
NAME_COMPONENT_DELIMITERDelimiter of a cache name component. This is used for hierarchical deletion- See Also:
 
 
- 
- 
Method Details- 
updatePuts an item to the cache.- Parameters:
- element-
- Throws:
- IOException
 
- 
getGets an item from the cache.- Parameters:
- key-
- Returns:
- a cache element, or null if there is no data in cache for this key
- Throws:
- IOException
 
- 
getMultipleGets multiple items from the cache based on the given set of keys.- Parameters:
- keys-
- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache for any of these keys
- Throws:
- IOException
 
- 
getMatchingGets items from the cache matching the given pattern. Items from memory will replace those from remote sources. This only works with string keys. It's too expensive to do a toString on every key. Auxiliaries will do their best to handle simple expressions. For instance, the JDBC disk cache will convert * to % and . to _- Parameters:
- pattern-
- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data matching the pattern.
- Throws:
- IOException
 
- 
removeRemoves an item from the cache.- Parameters:
- key-
- Returns:
- false if there was an error in removal
- Throws:
- IOException
 
- 
removeAllRemoves all cached items from the cache.- Throws:
- IOException
 
- 
disposePrepares for shutdown.- Throws:
- IOException
 
- 
getSizeint getSize()Returns the current cache size in number of elements.- Returns:
- number of elements
 
- 
getStatusReturns the cache status.- Returns:
- Alive or Error
 
- 
getStatsReturns the cache stats.- Returns:
- String of important historical information.
 
- 
getCacheNameReturns the cache name.- Returns:
- usually the region name.
 
- 
setKeyMatcherSets the key matcher used by get matching.- Parameters:
- keyMatcher-
 
 
-