diff --git a/spring-aspects/src/main/java/org/springframework/scheduling/aspectj/AspectJAsyncConfiguration.java b/spring-aspects/src/main/java/org/springframework/scheduling/aspectj/AspectJAsyncConfiguration.java index c2df8e984d..a40a01ddb3 100644 --- a/spring-aspects/src/main/java/org/springframework/scheduling/aspectj/AspectJAsyncConfiguration.java +++ b/spring-aspects/src/main/java/org/springframework/scheduling/aspectj/AspectJAsyncConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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. @@ -32,11 +32,11 @@ import org.springframework.scheduling.annotation.EnableAsync; * @since 3.1 * @see EnableAsync * @see org.springframework.scheduling.annotation.AsyncConfigurationSelector + * @see org.springframework.scheduling.annotation.ProxyAsyncConfiguration */ @Configuration public class AspectJAsyncConfiguration extends AbstractAsyncConfiguration { - @Override @Bean(name=AnnotationConfigUtils.ASYNC_EXECUTION_ASPECT_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public AnnotationAsyncExecutionAspect asyncAdvisor() { diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java index 7b306e8d9a..dce87b245c 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java @@ -53,7 +53,7 @@ public abstract class AbstractAsyncConfiguration implements ImportAware { /** * Collect any {@link AsyncConfigurer} beans through autowiring. */ - @Autowired(required = false) + @Autowired(required=false) void setConfigurers(Collection configurers) { if (CollectionUtils.isEmpty(configurers)) { return; @@ -65,12 +65,4 @@ public abstract class AbstractAsyncConfiguration implements ImportAware { this.executor = configurer.getAsyncExecutor(); } - - /** - * The component that will apply async execution advice to beans annotated with - * the async annotation. Subclasses will provide either a BeanPostProcessor in - * the case of proxy-based advice, or an AspectJ aspect if weaving is preferred. - */ - public abstract Object asyncAdvisor(); - } diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java index 8ec439db2e..19595dfb48 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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,26 +38,20 @@ import org.springframework.util.Assert; @Configuration public class ProxyAsyncConfiguration extends AbstractAsyncConfiguration { - @Override @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"); - AsyncAnnotationBeanPostProcessor bpp = new AsyncAnnotationBeanPostProcessor(); - Class customAsyncAnnotation = enableAsync.getClass("annotation"); if (customAsyncAnnotation != AnnotationUtils.getDefaultValue(EnableAsync.class, "annotation")) { bpp.setAsyncAnnotationType(customAsyncAnnotation); } - if (this.executor != null) { bpp.setExecutor(this.executor); } - bpp.setProxyTargetClass(this.enableAsync.getBoolean("proxyTargetClass")); bpp.setOrder(this.enableAsync.getNumber("order")); - return bpp; }