Class CxboxCacheAutoConfiguration

java.lang.Object
org.cxbox.core.autoconfigure.cache.CxboxCacheAutoConfiguration

@AutoConfiguration @ConditionalOnClass(org.springframework.cache.CacheManager.class) @ConditionalOnMissingBean(name="cxboxCacheResolver") @ConditionalOnBean(org.springframework.cache.interceptor.CacheAspectSupport.class) @AutoConfigureAfter(org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration.class) public class CxboxCacheAutoConfiguration extends Object

Auto-configuration class which declares "cxboxCacheResolver" bean of type CacheResolver.

As it says in the Spring documentation:

Auto-configuration is non-invasive. At any point, you can start to define your own configuration to replace specific parts of the auto-configuration.

It follows that if you declare a bean with name "cxboxCacheResolver" and type CacheResolver in a project, which defines dependency on Cxbox, this autoconfiguration will be ignored, otherwise it will create the "cxboxCacheResolver" bean defined below. A bean named "cxboxCacheResolver" is used by Cxbox in all annotations which are related to Spring cache abstraction.

@AutoConfiguration is nothing but alias for @Configuration, it is used to exclude a class from component scanning (see @BeanScan).

See Also:
  • Constructor Details

    • CxboxCacheAutoConfiguration

      public CxboxCacheAutoConfiguration()
  • Method Details

    • cxboxCacheResolver

      @Bean @Lazy(false) public org.springframework.cache.interceptor.CacheResolver cxboxCacheResolver(Optional<MetaHotReloadService> metaHotReloadService)
    • requestCache

      @Bean @RequestScope public CxboxRequestAwareCacheHolder requestCache()
    • buildCacheManagers

      protected List<org.springframework.cache.CacheManager> buildCacheManagers()
    • buildUnExpirableCacheManager

      protected org.springframework.cache.CacheManager buildUnExpirableCacheManager(String... names)
    • buildRequestAwareCacheManager

      protected org.springframework.cache.CacheManager buildRequestAwareCacheManager(String cacheName)