public interface ICache extends ICacheType
This allows for a suite of reusable components for accessing such structures, for example asynchronous access via an event queue.
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Prepares for shutdown.
|
ICacheElement |
get(java.io.Serializable key)
Gets an item from the cache.
|
java.lang.String |
getCacheName()
Returns the cache name.
|
java.util.Map |
getMatching(java.lang.String pattern)
Gets items from the cache matching the given pattern.
|
java.util.Map |
getMultiple(java.util.Set keys)
Gets multiple items from the cache based on the given set of keys.
|
int |
getSize()
Returns the current cache size in number of elements.
|
java.lang.String |
getStats()
Returns the cache stats.
|
int |
getStatus()
Returns the cache status.
|
boolean |
remove(java.io.Serializable key)
Removes an item from the cache.
|
void |
removeAll()
Removes all cached items from the cache.
|
void |
setKeyMatcher(IKeyMatcher keyMatcher)
Sets the key matcher used by get matching.
|
void |
update(ICacheElement element)
Puts an item to the cache.
|
getCacheType
void update(ICacheElement element) throws java.io.IOException
element
- java.io.IOException
ICacheElement get(java.io.Serializable key) throws java.io.IOException
key
- java.io.IOException
java.util.Map getMultiple(java.util.Set keys) throws java.io.IOException
keys
- java.io.IOException
java.util.Map getMatching(java.lang.String pattern) throws java.io.IOException
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 _
pattern
- java.io.IOException
boolean remove(java.io.Serializable key) throws java.io.IOException
key
- java.io.IOException
void removeAll() throws java.io.IOException
java.io.IOException
void dispose() throws java.io.IOException
java.io.IOException
int getSize()
int getStatus()
java.lang.String getStats()
java.lang.String getCacheName()
void setKeyMatcher(IKeyMatcher keyMatcher)
keyMatcher
- Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.