org.springframework.cache.Cache implementation on top of a
javax.cache.Cache instance.Note
This class has been updated for JCache 1.0, as of Spring 4.0.
JCacheCacheManager
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Cache | |
| private final JCacheCache. |
| Access | Constructor and Description |
|---|---|
| public | JCacheCache(Cache<Object, Object>
backing JCache Cache instance jcache)Create a |
| public | JCacheCache(Cache<Object, Object>
backing JCache Cache instance jcache, boolean whether to accept and convert null values for this cache allowNullValues)Create a |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements org. Clear the cache through removing all mappings. |
| public void | evict(Object
the key whose mapping is to be removed from the cache key)Implements org. Evict the mapping for this key from this cache if it is present. |
| public boolean | evictIfPresent(Object
the key whose mapping is to be removed from the cache key)Overrides default org. Evict the mapping for this key from this cache if it is present, expecting the key to be immediately invisible for subsequent lookups. |
| public <T> T | get(Object
the key whose associated value is to be returned key, Callable<T> valueLoader)Implements org. Return the value to which this cache maps the specified key, obtaining
that value from |
| public final String | |
| public final Cache | getNativeCache()
Implements org. Return the underlying native cache provider. |
| public boolean | invalidate()
Overrides default org. Invalidate the cache through removing all mappings, expecting all entries to be immediately invisible for subsequent lookups. |
| protected Object | lookup(Object
the key whose associated value is to be returned key)Implements abstract org. Perform an actual lookup in the underlying store. |
| public void | put(Object
the key with which the specified value is to be associated key, Object the value to be associated with the specified key value)Implements org. Associate the specified value with the specified key in this cache. |
| public Cache. | putIfAbsent(Object
the key with which the specified value is to be associated key, Object the value to be associated with the specified key value)Overrides default org. Atomically associate the specified value with the specified key in this cache if it is not set already. |
| cache | back to summary |
|---|---|
| private final Cache<Object, Object> cache | |
| valueLoaderEntryProcessor | back to summary |
|---|---|
| private final JCacheCache. | |
| JCacheCache | back to summary |
|---|---|
| public JCacheCache(Cache<Object, Object> jcache) Create a | |
| JCacheCache | back to summary |
|---|---|
| public JCacheCache(Cache<Object, Object> jcache, boolean allowNullValues) Create a | |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Doc from org. Clear the cache through removing all mappings. Actual clearing may be performed in an asynchronous or deferred
fashion, with subsequent lookups possibly still seeing the entries.
This may for example be the case with transactional cache decorators.
Use If the cache is supposed to be compatible with
| |
| evict | back to summary |
|---|---|
| public void evict(Object key) Implements org. Doc from org. Evict the mapping for this key from this cache if it is present. Actual eviction may be performed in an asynchronous or deferred
fashion, with subsequent lookups possibly still seeing the entry.
This may for example be the case with transactional cache decorators.
Use If the cache is supposed to be compatible with | |
| evictIfPresent | back to summary |
|---|---|
| public boolean evictIfPresent(Object key) Overrides default org. Doc from org. Evict the mapping for this key from this cache if it is present, expecting the key to be immediately invisible for subsequent lookups. The default implementation delegates to | |
| get | back to summary |
|---|---|
| public <T> T get(Object key, Callable<T> valueLoader) Implements org. Doc from org. Return the value to which this cache maps the specified key, obtaining
that value from If possible, implementations should ensure that the loading operation
is synchronized so that the specified If the
| |
| getName | back to summary |
|---|---|
| public final String getName() Implements org. Doc from org. Return the cache name.
| |
| getNativeCache | back to summary |
|---|---|
| public final Cache Implements org. Doc from org. Return the underlying native cache provider.
| |
| invalidate | back to summary |
|---|---|
| public boolean invalidate() Overrides default org. Doc from org. Invalidate the cache through removing all mappings, expecting all entries to be immediately invisible for subsequent lookups.
| |
| lookup | back to summary |
|---|---|
| protected Object lookup(Object key) Implements abstract org. Doc from org. Perform an actual lookup in the underlying store. | |
| put | back to summary |
|---|---|
| public void put(Object key, Object value) Implements org. Doc from org. Associate the specified value with the specified key in this cache. If the cache previously contained a mapping for this key, the old value is replaced by the specified value. Actual registration may be performed in an asynchronous or deferred
fashion, with subsequent lookups possibly not seeing the entry yet.
This may for example be the case with transactional cache decorators.
Use If the cache is supposed to be compatible with | |
| putIfAbsent | back to summary |
|---|---|
| public Cache. Overrides default org. Doc from org. Atomically associate the specified value with the specified key in this cache if it is not set already. This is equivalent to:
except that the action is performed atomically. While all out-of-the-box
CacheManager implementations are able to perform the put atomically,
the operation may also be implemented in two steps, e.g. with a check for
presence and a subsequent put, in a non-atomic way. Check the documentation
of the native cache implementation that you are using for more details.
The default implementation delegates to
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final JCacheCache. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Object | process(MutableEntry<Object, Object>
the entry entry, Object... a number of arguments to the process. arguments)Implements javax. Process an entry. |
| INSTANCE | back to summary |
|---|---|
| private static final JCacheCache. | |
| PutIfAbsentEntryProcessor | back to summary |
|---|---|
| private PutIfAbsentEntryProcessor() | |
| process | back to summary |
|---|---|
| public Object process(MutableEntry<Object, Object> entry, Object... arguments) throws EntryProcessorException Implements javax. Doc from javax. Process an entry.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Function | |
| private final Function |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Object | process(MutableEntry<Object, Object>
the entry entry, Object... a number of arguments to the process. arguments)Implements javax. Process an entry. |
| fromStoreValue | back to summary |
|---|---|
| private final Function<Object, Object> fromStoreValue | |
| toStoreValue | back to summary |
|---|---|
| private final Function<Object, Object> toStoreValue | |
| ValueLoaderEntryProcessor | back to summary |
|---|---|
| private ValueLoaderEntryProcessor(Function<Object, Object> fromStoreValue, Function<Object, Object> toStoreValue) | |
| process | back to summary |
|---|---|
| public Object process(MutableEntry<Object, Object> entry, Object... arguments) throws EntryProcessorException Implements javax. Doc from javax. Process an entry.
| |