spring-framework / org.springframework.cache.annotation / CachingConfigurationSelector

CachingConfigurationSelector

open class CachingConfigurationSelector : AdviceModeImportSelector<EnableCaching>

Selects which implementation of AbstractCachingConfiguration should be used based on the value of EnableCaching#mode on the importing @Configuration class.

Detects the presence of JSR-107 and enables JCache support accordingly.

Author
Chris Beams

Author
Stephane Nicoll

Since
3.1

See Also
EnableCachingProxyCachingConfiguration

Constructors

<init>

CachingConfigurationSelector()

Selects which implementation of AbstractCachingConfiguration should be used based on the value of EnableCaching#mode on the importing @Configuration class.

Detects the presence of JSR-107 and enables JCache support accordingly.

Inherited Properties

DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME

static val DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME: String

Functions

selectImports

open fun selectImports(adviceMode: AdviceMode): Array<String>

{@inheritDoc}

Inherited Functions

selectImports

fun selectImports(importingClassMetadata: AnnotationMetadata): Array<String>

This implementation resolves the type of annotation from generic metadata and validates that (a) the annotation is in fact present on the importing @Configuration class and (b) that the given annotation has an advice mode attribute of type AdviceMode.

The #selectImports(AdviceMode) method is then invoked, allowing the concrete implementation to choose imports in a safe and convenient fashion.