org.springframework.cache.support

Class CompositeCacheManager

  • java.lang.Object
    • org.springframework.cache.support.CompositeCacheManager
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void afterPropertiesSet()
      Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.
      Cache getCache(java.lang.String name)
      Return the cache associated with the given name.
      java.util.Collection<java.lang.String> getCacheNames()
      Return a collection of the cache names known by this manager.
      void setCacheManagers(java.util.Collection<CacheManager> cacheManagers)
      Specify the CacheManagers to delegate to.
      void setFallbackToNoOpCache(boolean fallbackToNoOpCache)
      Indicate whether a NoOpCacheManager should be added at the end of the delegate list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompositeCacheManager

        public CompositeCacheManager()
        Construct an empty CompositeCacheManager, with delegate CacheManagers to be added via the "cacheManagers" property.
      • CompositeCacheManager

        public CompositeCacheManager(CacheManager... cacheManagers)
        Construct a CompositeCacheManager from the given delegate CacheManagers.
        Parameters:
        cacheManagers - the CacheManagers to delegate to
    • Method Detail

      • setCacheManagers

        public void setCacheManagers(java.util.Collection<CacheManager> cacheManagers)
        Specify the CacheManagers to delegate to.
      • setFallbackToNoOpCache

        public void setFallbackToNoOpCache(boolean fallbackToNoOpCache)
        Indicate whether a NoOpCacheManager should be added at the end of the delegate list. In this case, any getCache requests not handled by the configured CacheManagers will be automatically handled by the NoOpCacheManager (and hence never return null).
      • 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(java.lang.String name)
        Description copied from interface: CacheManager
        Return the cache associated with the given name.
        Specified by:
        getCache in interface CacheManager
        Parameters:
        name - the cache identifier (must not be null)
        Returns:
        the associated cache, or null if none found
      • getCacheNames

        public java.util.Collection<java.lang.String> getCacheNames()
        Description copied from interface: CacheManager
        Return a collection of the cache names known by this manager.
        Specified by:
        getCacheNames in interface CacheManager
        Returns:
        the names of all caches known by the cache manager