public class SpringCache2kCache extends Object implements org.springframework.cache.Cache
| Modifier and Type | Field and Description |
|---|---|
protected org.cache2k.Cache<Object,Object> |
cache |
| Constructor and Description |
|---|
SpringCache2kCache(org.cache2k.Cache<Object,Object> cache)
Create an adapter instance for the given cache2k instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
May work async.
|
void |
evict(Object key)
May work async.
|
boolean |
evictIfPresent(Object key)
Returns when evicted.
|
org.springframework.cache.Cache.ValueWrapper |
get(Object key) |
<T> T |
get(Object key,
Callable<T> valueLoader)
This method is called instead of
get(java.lang.Object) and put(java.lang.Object, java.lang.Object) in case sync=true is
specified on the Cachable annotation. |
<T> T |
get(Object key,
Class<T> type) |
String |
getName() |
org.cache2k.Cache<Object,Object> |
getNativeCache() |
boolean |
invalidate()
Like clear, but returns when everything is cleared.
|
boolean |
isLoaderPresent() |
void |
put(Object key,
Object value) |
org.springframework.cache.Cache.ValueWrapper |
putIfAbsent(Object key,
Object value) |
public String getName()
getName in interface org.springframework.cache.Cachepublic org.cache2k.Cache<Object,Object> getNativeCache()
getNativeCache in interface org.springframework.cache.Cachepublic org.springframework.cache.Cache.ValueWrapper get(Object key)
get in interface org.springframework.cache.Cachepublic <T> T get(Object key, Class<T> type)
get in interface org.springframework.cache.Cachepublic <T> T get(Object key, Callable<T> valueLoader)
get(java.lang.Object) and put(java.lang.Object, java.lang.Object) in case sync=true is
specified on the Cachable annotation.get in interface org.springframework.cache.Cachepublic void put(Object key, Object value)
put in interface org.springframework.cache.Cachepublic org.springframework.cache.Cache.ValueWrapper putIfAbsent(Object key, Object value)
putIfAbsent in interface org.springframework.cache.Cachepublic void evict(Object key)
evict in interface org.springframework.cache.Cachepublic void clear()
clear in interface org.springframework.cache.Cachepublic boolean evictIfPresent(Object key)
evictIfPresent in interface org.springframework.cache.Cachepublic boolean invalidate()
invalidate in interface org.springframework.cache.Cachepublic boolean isLoaderPresent()
cache2k API documentation. Copyright © 2000–2020 headissue GmbH, Munich.