Modifier and Type | Class and Description |
---|---|
static class |
NOOPHstCache.NOOPCacheElement |
Constructor and Description |
---|
NOOPHstCache() |
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) |
public CacheElement createElement(Object key, Object content)
createElement
in interface HstCache
public CacheElement createUncacheableElement(Object key, Object content)
createUncacheableElement
in interface HstCache
CacheElement
that is marked to be uncacheablepublic void put(CacheElement object)
public boolean isKeyInCache(Object key)
isKeyInCache
in interface HstCache
public CacheElement get(Object key)
HstCache
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.get
in interface HstCache
CacheElement
for key
and null
otherwisepublic CacheElement get(Object key, Callable<? extends CacheElement> valueLoader)
get
in interface HstCache
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
public int getMaxSize()
getMaxSize
in interface HstCache
public int getTimeToIdleSeconds()
getTimeToIdleSeconds
in interface HstCache
public int getTimeToLiveSeconds()
getTimeToLiveSeconds
in interface HstCache
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.