public class CachingConfigurationSelector extends AdviceModeImportSelector<EnableCaching>
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.
EnableCaching
,
ProxyCachingConfiguration
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CACHE_ASPECT_CONFIGURATION_CLASS_NAME |
private static java.lang.String |
JCACHE_ASPECT_CONFIGURATION_CLASS_NAME |
private static boolean |
jcacheImplPresent |
private static boolean |
jsr107Present |
private static java.lang.String |
PROXY_JCACHE_CONFIGURATION_CLASS |
DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME
Constructor and Description |
---|
CachingConfigurationSelector() |
Modifier and Type | Method and Description |
---|---|
private java.lang.String[] |
getAspectJImports()
Return the imports to use if the
AdviceMode is set to AdviceMode.ASPECTJ . |
private java.lang.String[] |
getProxyImports()
Return the imports to use if the
AdviceMode is set to AdviceMode.PROXY . |
java.lang.String[] |
selectImports(AdviceMode adviceMode)
Returns
ProxyCachingConfiguration or AspectJCachingConfiguration
for PROXY and ASPECTJ values of EnableCaching.mode() ,
respectively. |
getAdviceModeAttributeName, selectImports
private static final java.lang.String PROXY_JCACHE_CONFIGURATION_CLASS
private static final java.lang.String CACHE_ASPECT_CONFIGURATION_CLASS_NAME
private static final java.lang.String JCACHE_ASPECT_CONFIGURATION_CLASS_NAME
private static final boolean jsr107Present
private static final boolean jcacheImplPresent
public java.lang.String[] selectImports(AdviceMode adviceMode)
ProxyCachingConfiguration
or AspectJCachingConfiguration
for PROXY
and ASPECTJ
values of EnableCaching.mode()
,
respectively. Potentially includes corresponding JCache configuration as well.selectImports
in class AdviceModeImportSelector<EnableCaching>
adviceMode
- the value of the advice mode attribute for the annotation specified via generics.null
if the given AdviceMode
is unknown)private java.lang.String[] getProxyImports()
AdviceMode
is set to AdviceMode.PROXY
.
Take care of adding the necessary JSR-107 import if it is available.
private java.lang.String[] getAspectJImports()
AdviceMode
is set to AdviceMode.ASPECTJ
.
Take care of adding the necessary JSR-107 import if it is available.