Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,11 +37,11 @@ import org.springframework.context.annotation.Role;
|
||||
@Configuration
|
||||
public class ProxyCachingConfiguration extends AbstractCachingConfiguration {
|
||||
|
||||
@Bean(name=AnnotationConfigUtils.CACHE_ADVISOR_BEAN_NAME)
|
||||
@Bean(name = AnnotationConfigUtils.CACHE_ADVISOR_BEAN_NAME)
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public BeanFactoryCacheOperationSourceAdvisor cacheAdvisor() {
|
||||
BeanFactoryCacheOperationSourceAdvisor advisor =
|
||||
new BeanFactoryCacheOperationSourceAdvisor();
|
||||
new BeanFactoryCacheOperationSourceAdvisor();
|
||||
advisor.setCacheOperationSource(cacheOperationSource());
|
||||
advisor.setAdvice(cacheInterceptor());
|
||||
advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.cache.config;
|
||||
|
||||
import static org.springframework.context.annotation.AnnotationConfigUtils.*;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import org.springframework.aop.config.AopNamespaceUtils;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
@@ -26,10 +26,9 @@ import org.springframework.beans.factory.parsing.CompositeComponentDefinition;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.beans.factory.xml.BeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.cache.annotation.AnnotationCacheOperationSource;
|
||||
import org.springframework.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor;
|
||||
import org.springframework.cache.interceptor.CacheInterceptor;
|
||||
import org.w3c.dom.Element;
|
||||
import org.springframework.context.annotation.AnnotationConfigUtils;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.beans.factory.xml.BeanDefinitionParser}
|
||||
@@ -83,13 +82,13 @@ class AnnotationDrivenCacheBeanDefinitionParser implements BeanDefinitionParser
|
||||
* </pre>
|
||||
*/
|
||||
private void registerCacheAspect(Element element, ParserContext parserContext) {
|
||||
if (!parserContext.getRegistry().containsBeanDefinition(CACHE_ASPECT_BEAN_NAME)) {
|
||||
if (!parserContext.getRegistry().containsBeanDefinition(AnnotationConfigUtils.CACHE_ASPECT_BEAN_NAME)) {
|
||||
RootBeanDefinition def = new RootBeanDefinition();
|
||||
def.setBeanClassName(CACHE_ASPECT_CLASS_NAME);
|
||||
def.setBeanClassName(AnnotationConfigUtils.CACHE_ASPECT_CLASS_NAME);
|
||||
def.setFactoryMethodName("aspectOf");
|
||||
parseCacheManagerProperty(element, def);
|
||||
CacheNamespaceHandler.parseKeyGenerator(element, def);
|
||||
parserContext.registerBeanComponent(new BeanComponentDefinition(def, CACHE_ASPECT_BEAN_NAME));
|
||||
parserContext.registerBeanComponent(new BeanComponentDefinition(def, AnnotationConfigUtils.CACHE_ASPECT_BEAN_NAME));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,11 +101,11 @@ class AnnotationDrivenCacheBeanDefinitionParser implements BeanDefinitionParser
|
||||
public static void configureAutoProxyCreator(Element element, ParserContext parserContext) {
|
||||
AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(parserContext, element);
|
||||
|
||||
if (!parserContext.getRegistry().containsBeanDefinition(CACHE_ADVISOR_BEAN_NAME)) {
|
||||
if (!parserContext.getRegistry().containsBeanDefinition(AnnotationConfigUtils.CACHE_ADVISOR_BEAN_NAME)) {
|
||||
Object eleSource = parserContext.extractSource(element);
|
||||
|
||||
// Create the CacheOperationSource definition.
|
||||
RootBeanDefinition sourceDef = new RootBeanDefinition(AnnotationCacheOperationSource.class);
|
||||
RootBeanDefinition sourceDef = new RootBeanDefinition("org.springframework.cache.annotation.AnnotationCacheOperationSource");
|
||||
sourceDef.setSource(eleSource);
|
||||
sourceDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
|
||||
String sourceName = parserContext.getReaderContext().registerWithGeneratedName(sourceDef);
|
||||
@@ -129,15 +128,16 @@ class AnnotationDrivenCacheBeanDefinitionParser implements BeanDefinitionParser
|
||||
if (element.hasAttribute("order")) {
|
||||
advisorDef.getPropertyValues().add("order", element.getAttribute("order"));
|
||||
}
|
||||
parserContext.getRegistry().registerBeanDefinition(CACHE_ADVISOR_BEAN_NAME, advisorDef);
|
||||
parserContext.getRegistry().registerBeanDefinition(AnnotationConfigUtils.CACHE_ADVISOR_BEAN_NAME, advisorDef);
|
||||
|
||||
CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(),
|
||||
eleSource);
|
||||
compositeDef.addNestedComponent(new BeanComponentDefinition(sourceDef, sourceName));
|
||||
compositeDef.addNestedComponent(new BeanComponentDefinition(interceptorDef, interceptorName));
|
||||
compositeDef.addNestedComponent(new BeanComponentDefinition(advisorDef, CACHE_ADVISOR_BEAN_NAME));
|
||||
compositeDef.addNestedComponent(new BeanComponentDefinition(advisorDef, AnnotationConfigUtils.CACHE_ADVISOR_BEAN_NAME));
|
||||
parserContext.registerComponent(compositeDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,7 +30,6 @@ import org.springframework.beans.factory.support.ManagedMap;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.cache.annotation.AnnotationCacheOperationSource;
|
||||
import org.springframework.cache.interceptor.CacheEvictOperation;
|
||||
import org.springframework.cache.interceptor.CacheInterceptor;
|
||||
import org.springframework.cache.interceptor.CacheOperation;
|
||||
@@ -78,8 +77,8 @@ class CacheAdviceParser extends AbstractSingleBeanDefinitionParser {
|
||||
}
|
||||
else {
|
||||
// Assume annotations source.
|
||||
builder.addPropertyValue("cacheOperationSources", new RootBeanDefinition(
|
||||
AnnotationCacheOperationSource.class));
|
||||
builder.addPropertyValue("cacheOperationSources",
|
||||
new RootBeanDefinition("org.springframework.cache.annotation.AnnotationCacheOperationSource"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +169,7 @@ class CacheAdviceParser extends AbstractSingleBeanDefinitionParser {
|
||||
|
||||
private static String getAttributeValue(Element element, String attributeName, String defaultValue) {
|
||||
String attribute = element.getAttribute(attributeName);
|
||||
if(StringUtils.hasText(attribute)) {
|
||||
if (StringUtils.hasText(attribute)) {
|
||||
return attribute.trim();
|
||||
}
|
||||
return defaultValue;
|
||||
|
||||
@@ -93,60 +93,6 @@ public class AnnotationConfigUtils {
|
||||
public static final String COMMON_ANNOTATION_PROCESSOR_BEAN_NAME =
|
||||
"org.springframework.context.annotation.internalCommonAnnotationProcessor";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed Scheduled annotation processor.
|
||||
*/
|
||||
public static final String SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME =
|
||||
"org.springframework.context.annotation.internalScheduledAnnotationProcessor";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed Async annotation processor.
|
||||
*/
|
||||
public static final String ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME =
|
||||
"org.springframework.context.annotation.internalAsyncAnnotationProcessor";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed AspectJ async execution aspect.
|
||||
*/
|
||||
public static final String ASYNC_EXECUTION_ASPECT_BEAN_NAME =
|
||||
"org.springframework.scheduling.config.internalAsyncExecutionAspect";
|
||||
|
||||
/**
|
||||
* The class name of the AspectJ async execution aspect.
|
||||
*/
|
||||
public static final String ASYNC_EXECUTION_ASPECT_CLASS_NAME =
|
||||
"org.springframework.scheduling.aspectj.AnnotationAsyncExecutionAspect";
|
||||
|
||||
/**
|
||||
* The name of the AspectJ async execution aspect @{@code Configuration} class.
|
||||
*/
|
||||
public static final String ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME =
|
||||
"org.springframework.scheduling.aspectj.AspectJAsyncConfiguration";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed cache advisor.
|
||||
*/
|
||||
public static final String CACHE_ADVISOR_BEAN_NAME =
|
||||
"org.springframework.cache.config.internalCacheAdvisor";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed cache aspect.
|
||||
*/
|
||||
public static final String CACHE_ASPECT_BEAN_NAME =
|
||||
"org.springframework.cache.config.internalCacheAspect";
|
||||
|
||||
/**
|
||||
* The class name of the AspectJ caching aspect.
|
||||
*/
|
||||
public static final String CACHE_ASPECT_CLASS_NAME =
|
||||
"org.springframework.cache.aspectj.AnnotationCacheAspect";
|
||||
|
||||
/**
|
||||
* The name of the AspectJ caching aspect @{@code Configuration} class.
|
||||
*/
|
||||
public static final String CACHE_ASPECT_CONFIGURATION_CLASS_NAME =
|
||||
"org.springframework.cache.aspectj.AspectJCachingConfiguration";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed JPA annotation processor.
|
||||
*/
|
||||
@@ -158,6 +104,79 @@ public class AnnotationConfigUtils {
|
||||
"org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor";
|
||||
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed Scheduled annotation processor.
|
||||
* <p>ATTENTION:</p> This constant is meant for internal use only. The value is stable
|
||||
* but don't rely on the presence of this constant declaration; rather copy the value.
|
||||
*/
|
||||
public static final String SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME =
|
||||
"org.springframework.context.annotation.internalScheduledAnnotationProcessor";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed Async annotation processor.
|
||||
* <p>ATTENTION:</p> This constant is meant for internal use only. The value is stable
|
||||
* but don't rely on the presence of this constant declaration; rather copy the value.
|
||||
*/
|
||||
public static final String ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME =
|
||||
"org.springframework.context.annotation.internalAsyncAnnotationProcessor";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed AspectJ async execution aspect.
|
||||
* <p>ATTENTION:</p> This constant is meant for internal use only. The value is stable
|
||||
* but don't rely on the presence of this constant declaration; rather copy the value.
|
||||
*/
|
||||
public static final String ASYNC_EXECUTION_ASPECT_BEAN_NAME =
|
||||
"org.springframework.scheduling.config.internalAsyncExecutionAspect";
|
||||
|
||||
/**
|
||||
* The class name of the AspectJ async execution aspect.
|
||||
* <p>ATTENTION:</p> This constant is meant for internal use only. The value is stable
|
||||
* but don't rely on the presence of this constant declaration; rather copy the value.
|
||||
*/
|
||||
public static final String ASYNC_EXECUTION_ASPECT_CLASS_NAME =
|
||||
"org.springframework.scheduling.aspectj.AnnotationAsyncExecutionAspect";
|
||||
|
||||
/**
|
||||
* The name of the AspectJ async execution aspect @{@code Configuration} class.
|
||||
* <p>ATTENTION:</p> This constant is meant for internal use only. The value is stable
|
||||
* but don't rely on the presence of this constant declaration; rather copy the value.
|
||||
*/
|
||||
public static final String ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME =
|
||||
"org.springframework.scheduling.aspectj.AspectJAsyncConfiguration";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed cache advisor.
|
||||
* <p>ATTENTION:</p> This constant is meant for internal use only. The value is stable
|
||||
* but don't rely on the presence of this constant declaration; rather copy the value.
|
||||
*/
|
||||
public static final String CACHE_ADVISOR_BEAN_NAME =
|
||||
"org.springframework.cache.config.internalCacheAdvisor";
|
||||
|
||||
/**
|
||||
* The bean name of the internally managed cache aspect.
|
||||
* <p>ATTENTION:</p> This constant is meant for internal use only. The value is stable
|
||||
* but don't rely on the presence of this constant declaration; rather copy the value.
|
||||
*/
|
||||
public static final String CACHE_ASPECT_BEAN_NAME =
|
||||
"org.springframework.cache.config.internalCacheAspect";
|
||||
|
||||
/**
|
||||
* The class name of the AspectJ caching aspect.
|
||||
* <p>ATTENTION:</p> This constant is meant for internal use only. The value is stable
|
||||
* but don't rely on the presence of this constant declaration; rather copy the value.
|
||||
*/
|
||||
public static final String CACHE_ASPECT_CLASS_NAME =
|
||||
"org.springframework.cache.aspectj.AnnotationCacheAspect";
|
||||
|
||||
/**
|
||||
* The name of the AspectJ caching aspect @{@code Configuration} class.
|
||||
* <p>ATTENTION:</p> This constant is meant for internal use only. The value is stable
|
||||
* but don't rely on the presence of this constant declaration; rather copy the value.
|
||||
*/
|
||||
public static final String CACHE_ASPECT_CONFIGURATION_CLASS_NAME =
|
||||
"org.springframework.cache.aspectj.AspectJCachingConfiguration";
|
||||
|
||||
|
||||
private static final boolean jsr250Present =
|
||||
ClassUtils.isPresent("javax.annotation.Resource", AnnotationConfigUtils.class.getClassLoader());
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,7 +28,6 @@ import org.springframework.context.annotation.AnnotationConfigUtils;
|
||||
* @since 3.1
|
||||
* @see EnableAsync
|
||||
* @see ProxyAsyncConfiguration
|
||||
* @see AnnotationConfigUtils#ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME
|
||||
*/
|
||||
public class AsyncConfigurationSelector extends AdviceModeImportSelector<EnableAsync> {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.Assert;
|
||||
@Configuration
|
||||
public class ProxyAsyncConfiguration extends AbstractAsyncConfiguration {
|
||||
|
||||
@Bean(name=AnnotationConfigUtils.ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME)
|
||||
@Bean(name = AnnotationConfigUtils.ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME)
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public AsyncAnnotationBeanPostProcessor asyncAdvisor() {
|
||||
Assert.notNull(this.enableAsync, "@EnableAsync annotation metadata was not injected");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -57,7 +57,7 @@ import org.springframework.util.StringValueResolver;
|
||||
* <p>Auto-detects any {@link SchedulingConfigurer} instances in the container,
|
||||
* allowing for customization of the scheduler to be used or for fine-grained control
|
||||
* over task registration (e.g. registration of {@link Trigger} tasks.
|
||||
* See @{@link EnableScheduling} Javadoc for complete usage details.
|
||||
* See the @{@link EnableScheduling} javadocs for complete usage details.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Juergen Hoeller
|
||||
@@ -82,6 +82,11 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
private final ScheduledTaskRegistrar registrar = new ScheduledTaskRegistrar();
|
||||
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return LOWEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the {@link org.springframework.scheduling.TaskScheduler} that will invoke
|
||||
* the scheduled methods, or a {@link java.util.concurrent.ScheduledExecutorService}
|
||||
@@ -101,11 +106,47 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return LOWEST_PRECEDENCE;
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
if (event.getApplicationContext() != this.applicationContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.scheduler != null) {
|
||||
this.registrar.setScheduler(this.scheduler);
|
||||
}
|
||||
|
||||
Map<String, SchedulingConfigurer> configurers =
|
||||
this.applicationContext.getBeansOfType(SchedulingConfigurer.class);
|
||||
for (SchedulingConfigurer configurer : configurers.values()) {
|
||||
configurer.configureTasks(this.registrar);
|
||||
}
|
||||
|
||||
if (this.registrar.hasTasks() && this.registrar.getScheduler() == null) {
|
||||
Map<String, ? super Object> schedulers = new HashMap<String, Object>();
|
||||
schedulers.putAll(this.applicationContext.getBeansOfType(TaskScheduler.class));
|
||||
schedulers.putAll(this.applicationContext.getBeansOfType(ScheduledExecutorService.class));
|
||||
if (schedulers.size() == 0) {
|
||||
// do nothing -> fall back to default scheduler
|
||||
}
|
||||
else if (schedulers.size() == 1) {
|
||||
this.registrar.setScheduler(schedulers.values().iterator().next());
|
||||
}
|
||||
else if (schedulers.size() >= 2){
|
||||
throw new IllegalStateException(
|
||||
"More than one TaskScheduler and/or ScheduledExecutorService " +
|
||||
"exist within the context. Remove all but one of the beans; or " +
|
||||
"implement the SchedulingConfigurer interface and call " +
|
||||
"ScheduledTaskRegistrar#setScheduler explicitly within the " +
|
||||
"configureTasks() callback. Found the following beans: " + schedulers.keySet());
|
||||
}
|
||||
}
|
||||
|
||||
this.registrar.afterPropertiesSet();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) {
|
||||
return bean;
|
||||
@@ -254,44 +295,6 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
if (event.getApplicationContext() != this.applicationContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.scheduler != null) {
|
||||
this.registrar.setScheduler(this.scheduler);
|
||||
}
|
||||
|
||||
Map<String, SchedulingConfigurer> configurers =
|
||||
this.applicationContext.getBeansOfType(SchedulingConfigurer.class);
|
||||
for (SchedulingConfigurer configurer : configurers.values()) {
|
||||
configurer.configureTasks(this.registrar);
|
||||
}
|
||||
|
||||
if (this.registrar.hasTasks() && this.registrar.getScheduler() == null) {
|
||||
Map<String, ? super Object> schedulers = new HashMap<String, Object>();
|
||||
schedulers.putAll(this.applicationContext.getBeansOfType(TaskScheduler.class));
|
||||
schedulers.putAll(this.applicationContext.getBeansOfType(ScheduledExecutorService.class));
|
||||
if (schedulers.size() == 0) {
|
||||
// do nothing -> fall back to default scheduler
|
||||
}
|
||||
else if (schedulers.size() == 1) {
|
||||
this.registrar.setScheduler(schedulers.values().iterator().next());
|
||||
}
|
||||
else if (schedulers.size() >= 2){
|
||||
throw new IllegalStateException(
|
||||
"More than one TaskScheduler and/or ScheduledExecutorService " +
|
||||
"exist within the context. Remove all but one of the beans; or " +
|
||||
"implement the SchedulingConfigurer interface and call " +
|
||||
"ScheduledTaskRegistrar#setScheduler explicitly within the " +
|
||||
"configureTasks() callback. Found the following beans: " + schedulers.keySet());
|
||||
}
|
||||
}
|
||||
|
||||
this.registrar.afterPropertiesSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,7 +39,7 @@ import org.springframework.context.annotation.Role;
|
||||
@Configuration
|
||||
public class SchedulingConfiguration {
|
||||
|
||||
@Bean(name=AnnotationConfigUtils.SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME)
|
||||
@Bean(name = AnnotationConfigUtils.SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME)
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public ScheduledAnnotationBeanPostProcessor scheduledAnnotationProcessor() {
|
||||
return new ScheduledAnnotationBeanPostProcessor();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -136,9 +136,8 @@ public class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParse
|
||||
if (StringUtils.hasText(executor)) {
|
||||
builder.addPropertyReference("executor", executor);
|
||||
}
|
||||
parserContext.registerBeanComponent(
|
||||
new BeanComponentDefinition(builder.getBeanDefinition(),
|
||||
AnnotationConfigUtils.ASYNC_EXECUTION_ASPECT_BEAN_NAME));
|
||||
parserContext.registerBeanComponent(new BeanComponentDefinition(builder.getBeanDefinition(),
|
||||
AnnotationConfigUtils.ASYNC_EXECUTION_ASPECT_BEAN_NAME));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user