@Configuration public abstract class AbstractCachingConfiguration extends Object implements ImportAware
@Configuration
class providing common structure for enabling
Spring's annotation-driven cache management capability.EnableCaching
Modifier and Type | Field and Description |
---|---|
protected CacheManager |
cacheManager |
protected AnnotationAttributes |
enableCaching |
protected KeyGenerator |
keyGenerator |
Constructor and Description |
---|
AbstractCachingConfiguration() |
Modifier and Type | Method and Description |
---|---|
protected void |
reconcileCacheManager()
Determine which
CacheManager bean to use. |
void |
setImportMetadata(AnnotationMetadata importMetadata)
Set the annotation metadata of the importing @
Configuration class. |
protected AnnotationAttributes enableCaching
protected CacheManager cacheManager
protected KeyGenerator keyGenerator
public void setImportMetadata(AnnotationMetadata importMetadata)
ImportAware
Configuration
class.setImportMetadata
in interface ImportAware
@PostConstruct protected void reconcileCacheManager()
CacheManager
bean to use. Prefer the result of
CachingConfigurer.cacheManager()
over any by-type matching. If none, fall
back to by-type matching on CacheManager
.IllegalArgumentException
- if no CacheManager can be found; if more than one
CachingConfigurer implementation exists; if multiple CacheManager beans and no
CachingConfigurer exists to disambiguate.