public interface HstCache
Modifier and Type | Method and Description |
---|---|
void |
clear() |
CacheElement |
createElement(Object key,
Object content) |
CacheElement |
createUncacheableElement(Object key,
Object content) |
CacheElement |
get(Object key)
|
CacheElement |
get(Object key,
Callable<? extends CacheElement> valueLoader) |
int |
getMaxSize() |
int |
getSize() |
int |
getTimeToIdleSeconds() |
int |
getTimeToLiveSeconds() |
boolean |
isKeyInCache(Object key) |
void |
put(CacheElement object) |
boolean |
remove(Object key) |
CacheElement createElement(Object key, Object content)
CacheElement createUncacheableElement(Object key, Object content)
CacheElement
that is marked to be uncacheablevoid put(CacheElement object)
CacheElement get(Object key)
CacheElement
for key
and null
otherwise. Please
be aware that if the underlying cache such as ehcache BlockingCache sets a lock using the key
,
then typically you need to free this lock your self.key
- CacheElement
for key
and null
otherwiseCacheElement get(Object key, Callable<? extends CacheElement> valueLoader) throws Exception
key
- the key
to get from the cache or to put an object for in the cache when the cache does
not yet contain key
valueLoader
- will be used to load the value for key
if cache does not yet contain an
object for key
. The loaded value is put in the cache.
The valueLoader
is not allowed to return null
but is allowed to
return a CacheElement
with content
null.valueloader
Exception
boolean isKeyInCache(Object key)
boolean remove(Object key)
void clear()
int getTimeToIdleSeconds()
int getTimeToLiveSeconds()
int getSize()
int getMaxSize()
Copyright © 2008–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.