|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache<K,V>
A Cache efficiently stores temporary objects primarily to improve an application's performance.
Shiro doesn't implement a full Cache mechanism itself, since that is outside the core competency of a Security framework. Instead, this interface provides an abstraction (wrapper) API on top of an underlying cache framework's cache instance (e.g. JCache, Ehcache, JCS, OSCache, JBossCache, TerraCotta, Coherence, GigaSpaces, etc, etc), allowing a Shiro user to configure any cache mechanism they choose.
Method Summary | |
---|---|
void |
clear()
Clear all entries from the cache. |
V |
get(K key)
Returns the Cached value stored under the specified key or
null if there is no Cache entry for that key . |
Set<K> |
keys()
Returns a view of all the keys for entries contained in this cache. |
V |
put(K key,
V value)
Adds a Cache entry. |
V |
remove(K key)
Remove the cache entry corresponding to the specified key. |
int |
size()
Returns the number of entries in the cache. |
Collection<V> |
values()
Returns a view of all of the values contained in this cache. |
Method Detail |
---|
V get(K key) throws CacheException
key
or
null
if there is no Cache entry for that key
.
key
- the key that the value was previous added with
null
if there is no entry for the specified key
CacheException
- if there is a problem accessing the underlying cache systemV put(K key, V value) throws CacheException
key
- the key used to identify the object being stored.value
- the value to be stored in the cache.
key
or null
if there was previous value
CacheException
- if there is a problem accessing the underlying cache systemV remove(K key) throws CacheException
key
- the key of the entry to be removed.
key
or null
if there was previous value
CacheException
- if there is a problem accessing the underlying cache systemvoid clear() throws CacheException
CacheException
- if there is a problem accessing the underlying cache systemint size()
Set<K> keys()
Collection<V> values()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |