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)
Determine which classes should be imported based on the given
AdviceMode. |
getAdviceModeAttributeName, selectImportsprivate 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)
AdviceMode.
Returning null from this method indicates that the AdviceMode could
not be handled or was unknown and that an IllegalArgumentException should
be thrown.
selectImports in class AdviceModeImportSelector<EnableCaching>adviceMode - the value of the advice mode attribute for the annotation specified via generics.ProxyCachingConfiguration or AspectJCacheConfiguration for
PROXY and ASPECTJ values of EnableCaching.mode(), respectivelyprivate 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.