public class EhCacheCache extends Object implements org.springframework.cache.Cache
Cache
implementation on top of an Ehcache
instance.EhCacheCacheManager
Constructor and Description |
---|
EhCacheCache(Ehcache ehcache)
Create an
EhCacheCache instance. |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
evict(Object key) |
boolean |
evictIfPresent(Object key) |
org.springframework.cache.Cache.ValueWrapper |
get(Object key) |
<T> T |
get(Object key,
Callable<T> valueLoader) |
<T> T |
get(Object key,
Class<T> type) |
String |
getName() |
Ehcache |
getNativeCache() |
boolean |
invalidate() |
void |
put(Object key,
Object value) |
org.springframework.cache.Cache.ValueWrapper |
putIfAbsent(Object key,
Object value) |
public EhCacheCache(Ehcache ehcache)
EhCacheCache
instance.ehcache
- the backing Ehcache instancepublic final String getName()
getName
in interface org.springframework.cache.Cache
public final Ehcache getNativeCache()
getNativeCache
in interface org.springframework.cache.Cache
@Nullable public org.springframework.cache.Cache.ValueWrapper get(Object key)
get
in interface org.springframework.cache.Cache
@Nullable public <T> T get(Object key, @Nullable Class<T> type)
get
in interface org.springframework.cache.Cache
@Nullable public <T> T get(Object key, Callable<T> valueLoader)
get
in interface org.springframework.cache.Cache
public void put(Object key, @Nullable Object value)
put
in interface org.springframework.cache.Cache
@Nullable public org.springframework.cache.Cache.ValueWrapper putIfAbsent(Object key, @Nullable Object value)
putIfAbsent
in interface org.springframework.cache.Cache
public void evict(Object key)
evict
in interface org.springframework.cache.Cache
public boolean evictIfPresent(Object key)
evictIfPresent
in interface org.springframework.cache.Cache
public void clear()
clear
in interface org.springframework.cache.Cache
public boolean invalidate()
invalidate
in interface org.springframework.cache.Cache