public class JCacheCache
extends java.lang.Object
implements org.springframework.cache.Cache
Cache implementation on top of a
Cache instance.
Note: This class has been updated for JCache 1.0, as of Spring 4.0.
| Constructor and Description |
|---|
JCacheCache(javax.cache.Cache<java.lang.Object,java.lang.Object> jcache)
Create an
JCacheCache instance. |
JCacheCache(javax.cache.Cache<java.lang.Object,java.lang.Object> jcache,
boolean allowNullValues)
Create an
JCacheCache instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
evict(java.lang.Object key) |
protected java.lang.Object |
fromStoreValue(java.lang.Object storeValue)
Convert the given value from the internal store to a user value
returned from the get method (adapting
null). |
org.springframework.cache.Cache.ValueWrapper |
get(java.lang.Object key) |
<T> T |
get(java.lang.Object key,
java.lang.Class<T> type) |
java.lang.String |
getName() |
javax.cache.Cache<java.lang.Object,java.lang.Object> |
getNativeCache() |
boolean |
isAllowNullValues() |
void |
put(java.lang.Object key,
java.lang.Object value) |
org.springframework.cache.Cache.ValueWrapper |
putIfAbsent(java.lang.Object key,
java.lang.Object value) |
protected java.lang.Object |
toStoreValue(java.lang.Object userValue)
Convert the given user value, as passed into the put method,
to a value in the internal store (adapting
null). |
public JCacheCache(javax.cache.Cache<java.lang.Object,java.lang.Object> jcache)
JCacheCache instance.jcache - backing JCache Cache instancepublic JCacheCache(javax.cache.Cache<java.lang.Object,java.lang.Object> jcache,
boolean allowNullValues)
JCacheCache instance.jcache - backing JCache Cache instanceallowNullValues - whether to accept and convert null values for this cachepublic final java.lang.String getName()
getName in interface org.springframework.cache.Cachepublic final javax.cache.Cache<java.lang.Object,java.lang.Object> getNativeCache()
getNativeCache in interface org.springframework.cache.Cachepublic final boolean isAllowNullValues()
public org.springframework.cache.Cache.ValueWrapper get(java.lang.Object key)
get in interface org.springframework.cache.Cachepublic <T> T get(java.lang.Object key,
java.lang.Class<T> type)
get in interface org.springframework.cache.Cachepublic void put(java.lang.Object key,
java.lang.Object value)
put in interface org.springframework.cache.Cachepublic org.springframework.cache.Cache.ValueWrapper putIfAbsent(java.lang.Object key,
java.lang.Object value)
putIfAbsent in interface org.springframework.cache.Cachepublic void evict(java.lang.Object key)
evict in interface org.springframework.cache.Cachepublic void clear()
clear in interface org.springframework.cache.Cacheprotected java.lang.Object fromStoreValue(java.lang.Object storeValue)
null).storeValue - the store valueprotected java.lang.Object toStoreValue(java.lang.Object userValue)
null).userValue - the given user value