| Constructor and Description |
|---|
EhCache(net.sf.ehcache.Ehcache cache)
Constructs a new EhCache instance with the given cache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements in the cache, but leaves the cache in a useable state.
|
V |
get(K key)
Gets a value of an element which matches the given key.
|
long |
getDiskStoreSize()
Returns the size (in bytes) that this EhCache's disk store is consuming or
-1 if
that number is unknown or cannot be calculated. |
long |
getMemoryStoreSize()
Returns the size (in bytes) that this EhCache's memory store is using (RAM), or
-1 if
that number is unknown or cannot be calculated. |
long |
getMemoryUsage()
Returns the size (in bytes) that this EhCache is using in memory (RAM), or
-1 if that
number is unknown or cannot be calculated. |
Set<K> |
keys() |
V |
put(K key,
V value)
Puts an object into the cache.
|
V |
remove(K key)
Removes the element which matches the key.
|
int |
size() |
String |
toString()
Returns "EhCache [" + cache.getName() + "]"
|
Collection<V> |
values() |
public EhCache(net.sf.ehcache.Ehcache cache)
cache - - delegate EhCache instance this Shiro cache instance will wrap.public V get(K key) throws CacheException
get in interface Cache<K,V>key - the key of the element to return.CacheExceptionpublic V put(K key, V value) throws CacheException
put in interface Cache<K,V>key - the key.value - the value.CacheExceptionpublic V remove(K key) throws CacheException
If no element matches, nothing is removed and no Exception is thrown.
remove in interface Cache<K,V>key - the key of the element to removeCacheExceptionpublic void clear()
throws CacheException
clear in interface Cache<K,V>CacheExceptionpublic long getMemoryUsage()
-1 if that
number is unknown or cannot be calculated.-1 if that
number is unknown or cannot be calculated.public long getMemoryStoreSize()
-1 if
that number is unknown or cannot be calculated.-1 if
that number is unknown or cannot be calculated.public long getDiskStoreSize()
-1 if
that number is unknown or cannot be calculated.-1 if
that number is unknown or cannot be calculated.Copyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.