org.springframework.cache.annotation
Class AbstractCachingConfiguration
java.lang.Object
org.springframework.cache.annotation.AbstractCachingConfiguration
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, ImportAware
- Direct Known Subclasses:
- ProxyCachingConfiguration
@Configuration
public abstract class AbstractCachingConfiguration
- extends java.lang.Object
- implements ImportAware
Abstract base @Configuration
class providing common structure for enabling
Spring's annotation-driven cache management capability.
- Since:
- 3.1
- Author:
- Chris Beams
- See Also:
EnableCaching
Method Summary |
protected void |
reconcileCacheManager()
Determine which CacheManager bean to use. |
void |
setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata)
Set the annotation metadata of the importing @Configuration class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
enableCaching
protected org.springframework.core.annotation.AnnotationAttributes enableCaching
cacheManager
protected CacheManager cacheManager
keyGenerator
protected KeyGenerator keyGenerator
AbstractCachingConfiguration
public AbstractCachingConfiguration()
setImportMetadata
public void setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata)
- Description copied from interface:
ImportAware
- Set the annotation metadata of the importing @
Configuration
class.
- Specified by:
setImportMetadata
in interface ImportAware
reconcileCacheManager
@PostConstruct
protected void reconcileCacheManager()
- Determine which
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
.
- Throws:
java.lang.IllegalArgumentException
- if no CacheManager can be found; if more than one
CachingConfigurer implementation exists; if multiple CacheManager beans and no
CachingConfigurer exists to disambiguate.