|
11 | 11 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
12 | 12 | import org.springframework.boot.context.properties.ConfigurationProperties; |
13 | 13 | import org.springframework.cache.annotation.AbstractCachingConfiguration; |
14 | | -import org.springframework.cache.annotation.EnableCaching; |
15 | 14 | import org.springframework.cache.annotation.ProxyCachingConfiguration; |
16 | | -import org.springframework.context.annotation.AdviceMode; |
17 | 15 | import org.springframework.context.annotation.Bean; |
18 | 16 | import org.springframework.context.annotation.Configuration; |
19 | | -import org.springframework.context.annotation.ImportAware; |
20 | 17 | import org.springframework.context.annotation.Role; |
21 | | -import org.springframework.core.annotation.AnnotationAttributes; |
22 | | -import org.springframework.core.type.AnnotationMetadata; |
23 | 18 |
|
24 | 19 | import java.util.Collection; |
25 | 20 |
|
|
28 | 23 | */ |
29 | 24 | @Configuration(proxyBeanMethods = false) |
30 | 25 | @ConditionalOnBean(ProxyCachingConfiguration.class) |
31 | | -public class EnhancedCacheAutoConfiguration extends AbstractCachingConfiguration implements ImportAware { |
32 | | - |
33 | | - @Override |
34 | | - public void setImportMetadata(AnnotationMetadata importMetadata) { |
35 | | - AnnotationAttributes attributes = AnnotationAttributes.fromMap( |
36 | | - importMetadata.getAnnotationAttributes(EnableCaching.class.getName())); |
37 | | - if (attributes == null) { |
38 | | - throw new IllegalArgumentException(String.format( |
39 | | - "@%s is not present on importing class '%s' as expected", |
40 | | - EnableCaching.class.getSimpleName(), importMetadata.getClassName())); |
41 | | - } |
42 | | - |
43 | | - AdviceMode adviceMode = attributes.getEnum("mode"); |
44 | | - |
45 | | - if (adviceMode == AdviceMode.ASPECTJ) { |
46 | | - throw new IllegalArgumentException( |
47 | | - "Mode AspectJ is not supported in cache-as-multi"); |
48 | | - } |
49 | | - } |
| 26 | +public class EnhancedCacheAutoConfiguration extends AbstractCachingConfiguration { |
50 | 27 |
|
51 | 28 | @Bean |
52 | 29 | @ConditionalOnMissingBean |
|
0 commit comments