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

public class JCacheCacheManager extends AbstractTransactionSupportingCacheManager
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 Details

    • JCacheCacheManager

      public JCacheCacheManager()
      Create a new JCacheCacheManager without a backing JCache javax.cache.CacheManager.

      The backing JCache javax.cache.CacheManager can be set via the setCacheManager(javax.cache.CacheManager) bean property.

    • JCacheCacheManager

      public JCacheCacheManager(javax.cache.CacheManager cacheManager)
      Create a new JCacheCacheManager for the given backing JCache javax.cache.CacheManager.
      Parameters:
      cacheManager - the backing JCache javax.cache.CacheManager
  • Method Details

    • setCacheManager

      public void setCacheManager(@Nullable javax.cache.CacheManager cacheManager)
      Set the backing JCache javax.cache.CacheManager.
    • getCacheManager

      @Nullable public javax.cache.CacheManager getCacheManager()
      Return the backing JCache javax.cache.CacheManager.
    • setAllowNullValues

      public void setAllowNullValues(boolean allowNullValues)
      Specify whether to accept and convert null values for all caches in this cache manager.

      Default is "true", despite JSR-107 itself not supporting null values. An internal holder object will be used to store user-level nulls.

    • isAllowNullValues

      public boolean isAllowNullValues()
      Return whether this cache manager accepts and converts null values for all of its caches.
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class org.springframework.cache.support.AbstractCacheManager
    • loadCaches

      protected Collection<org.springframework.cache.Cache> loadCaches()
      Specified by:
      loadCaches in class org.springframework.cache.support.AbstractCacheManager
    • getMissingCache

      protected org.springframework.cache.Cache getMissingCache(String name)
      Overrides:
      getMissingCache in class org.springframework.cache.support.AbstractCacheManager