Top Description Fields Constructors Methods
org.springframework.cache.annotation

public Class CachingConfigurationSelector

extends AdviceModeImportSelector<EnableCaching>
Class Inheritance
Imports
java.util.ArrayList, .List, org.springframework.context.annotation.AdviceMode, .AdviceModeImportSelector, .AutoProxyRegistrar, org.springframework.util.ClassUtils, .StringUtils

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.

Authors
Chris Beams, Stephane Nicoll
Since
3.1
See Also
EnableCaching, ProxyCachingConfiguration

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final boolean
private static final boolean
private static final String
Inherited from org.springframework.context.annotation.AdviceModeImportSelector:
DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String[]
getAspectJImports()

Return the imports to use if the AdviceMode is set to AdviceMode#ASPECTJ.

private String[]
getProxyImports()

Return the imports to use if the AdviceMode is set to AdviceMode#PROXY.

public String[]
selectImports(AdviceMode
the value of the advice mode attribute for the annotation specified via generics.
adviceMode
)

Implements abstract org.springframework.context.annotation.AdviceModeImportSelector.selectImports.

Returns ProxyCachingConfiguration or AspectJCachingConfiguration for PROXY and ASPECTJ values of EnableCaching#mode(), respectively.

Inherited from org.springframework.context.annotation.AdviceModeImportSelector:
getAdviceModeAttributeNameselectImports

Field Detail

CACHE_ASPECT_CONFIGURATION_CLASS_NAMEback to summary
private static final String CACHE_ASPECT_CONFIGURATION_CLASS_NAME
JCACHE_ASPECT_CONFIGURATION_CLASS_NAMEback to summary
private static final String JCACHE_ASPECT_CONFIGURATION_CLASS_NAME
jcacheImplPresentback to summary
private static final boolean jcacheImplPresent
jsr107Presentback to summary
private static final boolean jsr107Present
PROXY_JCACHE_CONFIGURATION_CLASSback to summary
private static final String PROXY_JCACHE_CONFIGURATION_CLASS

Constructor Detail

CachingConfigurationSelectorback to summary
public CachingConfigurationSelector()

Method Detail

getAspectJImportsback to summary
private String[] getAspectJImports()

Return the imports to use if the AdviceMode is set to AdviceMode#ASPECTJ.

Take care of adding the necessary JSR-107 import if it is available.

getProxyImportsback to summary
private String[] getProxyImports()

Return the imports to use if the AdviceMode is set to AdviceMode#PROXY.

Take care of adding the necessary JSR-107 import if it is available.

selectImportsback to summary
public String[] selectImports(AdviceMode adviceMode)

Implements abstract org.springframework.context.annotation.AdviceModeImportSelector.selectImports.

Returns ProxyCachingConfiguration or AspectJCachingConfiguration for PROXY and ASPECTJ values of EnableCaching#mode(), respectively. Potentially includes corresponding JCache configuration as well.

Parameters
adviceMode:AdviceMode

Doc from org.springframework.context.annotation.AdviceModeImportSelector.selectImports.

the value of the advice mode attribute for the annotation specified via generics.

Returns:String[]

Doc from org.springframework.context.annotation.AdviceModeImportSelector.selectImports.

array containing classes to import (empty array if none; null if the given AdviceMode is unknown)

Annotations
@Override