org.springframework.cache.jcache

Class JCacheCacheManager

    • Constructor Detail

      • 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 Detail

      • 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()
        Description copied from interface: InitializingBean
        Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

        This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

        Specified by:
        afterPropertiesSet in interface InitializingBean
        Overrides:
        afterPropertiesSet in class AbstractCacheManager
      • getMissingCache

        protected Cache getMissingCache(java.lang.String name)
        Description copied from class: AbstractCacheManager
        Return a missing cache with the specified name or null if such cache does not exist or could not be created on the fly.

        Some caches may be created at runtime if the native provider supports it. If a lookup by name does not yield any result, a subclass gets a chance to register such a cache at runtime. The returned cache will be automatically added to this instance.

        Overrides:
        getMissingCache in class AbstractCacheManager
        Parameters:
        name - the name of the cache to retrieve
        Returns:
        the missing cache or null if no such cache exists or could be created
        See Also:
        AbstractCacheManager.getCache(String)