Class JCacheCacheManager
java.lang.Object
org.springframework.cache.support.AbstractCacheManager
org.springframework.cache.transaction.AbstractTransactionSupportingCacheManager
org.springframework.cache.jcache.JCacheCacheManager
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.cache.CacheManager
CacheManager implementation
backed by a JCache javax.cache.CacheManager.
Note: This class has been updated for JCache 1.0, as of Spring 4.0.
- Since:
- 3.2
- Author:
- Juergen Hoeller, Stephane Nicoll
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newJCacheCacheManagerwithout a backing JCachejavax.cache.CacheManager.JCacheCacheManager(javax.cache.CacheManager cacheManager) Create a newJCacheCacheManagerfor the given backing JCachejavax.cache.CacheManager. -
Method Summary
Modifier and TypeMethodDescriptionvoid@Nullable javax.cache.CacheManagerReturn the backing JCachejavax.cache.CacheManager.protected @Nullable org.springframework.cache.CachegetMissingCache(String name) booleanReturn whether this cache manager accepts and convertsnullvalues for all of its caches.protected Collection<org.springframework.cache.Cache> voidsetAllowNullValues(boolean allowNullValues) Specify whether to accept and convertnullvalues for all caches in this cache manager.voidsetCacheManager(@Nullable javax.cache.CacheManager cacheManager) Set the backing JCachejavax.cache.CacheManager.Methods inherited from class AbstractTransactionSupportingCacheManager
decorateCache, isTransactionAware, setTransactionAwareMethods inherited from class org.springframework.cache.support.AbstractCacheManager
getCache, getCacheNames, initializeCaches, lookupCache
-
Constructor Details
-
JCacheCacheManager
public JCacheCacheManager()Create a newJCacheCacheManagerwithout a backing JCachejavax.cache.CacheManager.The backing JCache
javax.cache.CacheManagercan be set via thesetCacheManager(CacheManager)bean property. -
JCacheCacheManager
public JCacheCacheManager(javax.cache.CacheManager cacheManager) Create a newJCacheCacheManagerfor the given backing JCachejavax.cache.CacheManager.- Parameters:
cacheManager- the backing JCachejavax.cache.CacheManager
-
-
Method Details
-
setCacheManager
Set the backing JCachejavax.cache.CacheManager. -
getCacheManager
Return the backing JCachejavax.cache.CacheManager. -
setAllowNullValues
public void setAllowNullValues(boolean allowNullValues) Specify whether to accept and convertnullvalues for all caches in this cache manager.Default is "true", despite JSR-107 itself not supporting
nullvalues. An internal holder object will be used to store user-levelnulls. -
isAllowNullValues
public boolean isAllowNullValues()Return whether this cache manager accepts and convertsnullvalues for all of its caches. -
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.cache.support.AbstractCacheManager
-
loadCaches
- Specified by:
loadCachesin classorg.springframework.cache.support.AbstractCacheManager
-
getMissingCache
-