Class AbstractCacheManager

    • Method Detail

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

        @Nullable
        public Cache getCache​(String name)
        Description copied from interface: CacheManager
        Get the cache associated with the given name.

        Note that the cache may be lazily created at runtime if the native provider supports it.

        Specified by:
        getCache in interface CacheManager
        Parameters:
        name - the cache identifier (must not be null)
        Returns:
        the associated cache, or null if such a cache does not exist or could be not created
      • decorateCache

        protected Cache decorateCache​(Cache cache)
        Decorate the given Cache object if necessary.
        Parameters:
        cache - the Cache object to be added to this CacheManager
        Returns:
        the decorated Cache object to be used instead, or simply the passed-in Cache object by default
      • getMissingCache

        @Nullable
        protected Cache getMissingCache​(String name)
        Return a missing cache with the specified name, or null if such a cache does not exist or could not be created on demand.

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

        Parameters:
        name - the name of the cache to retrieve
        Returns:
        the missing cache, or null if no such cache exists or could be created on demand
        Since:
        4.1
        See Also:
        getCache(String)