public class JCacheCacheManager extends AbstractTransactionSupportingCacheManager
CacheManager implementation
backed by a JCache CacheManager.
Note: This class has been updated for JCache 0.11, as of Spring 4.0.
| Constructor and Description |
|---|
JCacheCacheManager()
Create a new JCacheCacheManager, setting the target JCache CacheManager
through the
setCacheManager(javax.cache.CacheManager) bean property. |
JCacheCacheManager(javax.cache.CacheManager cacheManager)
Create a new JCacheCacheManager for the given backing JCache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
Cache |
getCache(String name)
Return the cache associated with the given name.
|
javax.cache.CacheManager |
getCacheManager()
Return the backing JCache
CacheManager. |
boolean |
isAllowNullValues()
Return whether this cache manager accepts and converts null values
for all of its caches.
|
protected Collection<Cache> |
loadCaches()
Load the caches for this cache manager.
|
void |
setAllowNullValues(boolean allowNullValues)
Specify whether to accept and convert null values for all caches
in this cache manager.
|
void |
setCacheManager(javax.cache.CacheManager cacheManager)
Set the backing JCache
CacheManager. |
decorateCache, isTransactionAware, setTransactionAwareaddCache, getCacheNamespublic JCacheCacheManager()
setCacheManager(javax.cache.CacheManager) bean property.public JCacheCacheManager(javax.cache.CacheManager cacheManager)
cacheManager - the backing JCache CacheManagerpublic void setCacheManager(javax.cache.CacheManager cacheManager)
CacheManager.public javax.cache.CacheManager getCacheManager()
CacheManager.public void setAllowNullValues(boolean allowNullValues)
Default is "true", despite JSR-107 itself not supporting null values. An internal holder object will be used to store user-level null values.
public boolean isAllowNullValues()
public void afterPropertiesSet()
InitializingBeanThis method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet in interface InitializingBeanafterPropertiesSet in class AbstractCacheManagerprotected Collection<Cache> loadCaches()
AbstractCacheManagerloadCaches in class AbstractCacheManagerpublic Cache getCache(String name)
CacheManagergetCache in interface CacheManagergetCache in class AbstractCacheManagername - cache identifier (must not be null)null if none is found