From f6de5d4360a55c1b6a50051e411c3040e4767bb8 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Wed, 27 Jun 2012 21:09:17 +0200 Subject: [PATCH] Reflect @Async executor qual. 3.2=>3.1.2 backport @Async executor qualification has been backported to 3.1.2. This commit updates all @since tags appropriately, as well as carrying over the changes backported to the spring-task-3.1 schema. Issue: SPR-6847, SPR-9443 --- .../aop/interceptor/AsyncExecutionAspectSupport.java | 2 +- .../aop/interceptor/AsyncExecutionInterceptor.java | 6 +++--- .../annotation/AnnotationAsyncExecutionInterceptor.java | 4 ++-- .../org/springframework/scheduling/annotation/Async.java | 2 +- .../springframework/scheduling/config/spring-task-3.1.xsd | 8 +++++++- .../springframework/scheduling/config/spring-task-3.2.xsd | 4 ++-- .../AnnotationAsyncExecutionInterceptorTests.java | 2 +- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java index 4ff0e9244b..0c81f4fa31 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java @@ -42,7 +42,7 @@ import org.springframework.util.StringUtils; * bean to be used when executing it, e.g. through an annotation attribute. * * @author Chris Beams - * @since 3.2 + * @since 3.1.2 */ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware { diff --git a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java index 20ed49adfb..8b2c788ef3 100644 --- a/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java +++ b/spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java @@ -44,7 +44,7 @@ import org.springframework.util.ReflectionUtils; * (like Spring's {@link org.springframework.scheduling.annotation.AsyncResult} * or EJB 3.1's javax.ejb.AsyncResult). * - *

As of Spring 3.2 the {@code AnnotationAsyncExecutionInterceptor} subclass is + *

As of Spring 3.1.2 the {@code AnnotationAsyncExecutionInterceptor} subclass is * preferred for use due to its support for executor qualification in conjunction with * Spring's {@code @Async} annotation. * @@ -101,12 +101,12 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport /** * {@inheritDoc} - *

This implementation is a no-op for compatibility in Spring 3.2. Subclasses may + *

This implementation is a no-op for compatibility in Spring 3.1.2. Subclasses may * override to provide support for extracting qualifier information, e.g. via an * annotation on the given method. * @return always {@code null} * @see #determineAsyncExecutor(Method) - * @since 3.2 + * @since 3.1.2 */ @Override protected String getExecutorQualifier(Method method) { diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptor.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptor.java index 6ae62fe6e3..a9abadab85 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptor.java @@ -26,11 +26,11 @@ import org.springframework.core.annotation.AnnotationUtils; * Specialization of {@link AsyncExecutionInterceptor} that delegates method execution to * an {@code Executor} based on the {@link Async} annotation. Specifically designed to * support use of {@link Async#value()} executor qualification mechanism introduced in - * Spring 3.2. Supports detecting qualifier metadata via {@code @Async} at the method or + * Spring 3.1.2. Supports detecting qualifier metadata via {@code @Async} at the method or * declaring class level. See {@link #getExecutorQualifier(Method)} for details. * * @author Chris Beams - * @since 3.2 + * @since 3.1.2 * @see org.springframework.scheduling.annotation.Async * @see org.springframework.scheduling.annotation.AsyncAnnotationAdvisor */ diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java index be600d325c..33c669ee53 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java @@ -57,7 +57,7 @@ public @interface Async { *

When specified on a class level {@code @Async} annotation, indicates that the * given executor should be used for all methods within the class. Method level use * of {@link Async#value} always overrides any value set at the class level. - * @since 3.2 + * @since 3.1.2 */ String value() default ""; diff --git a/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.1.xsd b/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.1.xsd index 402d255594..91b49de327 100644 --- a/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.1.xsd +++ b/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.1.xsd @@ -35,7 +35,10 @@ @@ -98,6 +101,9 @@ required even when defining the executor as an inner bean: The executor won't be directly accessible then but will nevertheless use the specified id as the thread name prefix of the threads that it manages. + In the case of multiple task:executors, as of Spring 3.1.2 this value may be used to + qualify which executor should handle a given @Async method, e.g. @Async("executorId"). + See the Javadoc for the #value attribute of Spring's @Async annotation for details. ]]> diff --git a/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.2.xsd b/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.2.xsd index cb05f8fcd3..ff035ece27 100644 --- a/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.2.xsd +++ b/spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.2.xsd @@ -36,7 +36,7 @@ Specifies the java.util.Executor instance to use when invoking asynchronous methods. If not provided, an instance of org.springframework.core.task.SimpleAsyncTaskExecutor will be used by default. - Note that as of Spring 3.2, individual @Async methods may qualify which executor to + Note that as of Spring 3.1.2, individual @Async methods may qualify which executor to use, meaning that the executor specified here acts as a default for all non-qualified @Async methods. ]]> @@ -101,7 +101,7 @@ required even when defining the executor as an inner bean: The executor won't be directly accessible then but will nevertheless use the specified id as the thread name prefix of the threads that it manages. - In the case of multiple task:executors, as of Spring 3.2 this value may be used to + In the case of multiple task:executors, as of Spring 3.1.2 this value may be used to qualify which executor should handle a given @Async method, e.g. @Async("executorId"). See the Javadoc for the #value attribute of Spring's @Async annotation for details. ]]> diff --git a/spring-context/src/test/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptorTests.java b/spring-context/src/test/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptorTests.java index b698b4fbe1..32c915c002 100644 --- a/spring-context/src/test/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptorTests.java +++ b/spring-context/src/test/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptorTests.java @@ -28,7 +28,7 @@ import static org.junit.Assert.*; * Unit tests for {@link AnnotationAsyncExecutionInterceptor}. * * @author Chris Beams - * @since 3.2 + * @since 3.1.2 */ public class AnnotationAsyncExecutionInterceptorTests {