Browse Source

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
pull/101/merge
Chris Beams 13 years ago
parent
commit
f6de5d4360
  1. 2
      spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java
  2. 6
      spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java
  3. 4
      spring-context/src/main/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptor.java
  4. 2
      spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java
  5. 8
      spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.1.xsd
  6. 4
      spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.2.xsd
  7. 2
      spring-context/src/test/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptorTests.java

2
spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java

@ -42,7 +42,7 @@ import org.springframework.util.StringUtils; @@ -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 {

6
spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java

@ -44,7 +44,7 @@ import org.springframework.util.ReflectionUtils; @@ -44,7 +44,7 @@ import org.springframework.util.ReflectionUtils;
* (like Spring's {@link org.springframework.scheduling.annotation.AsyncResult}
* or EJB 3.1's <code>javax.ejb.AsyncResult</code>).
*
* <p>As of Spring 3.2 the {@code AnnotationAsyncExecutionInterceptor} subclass is
* <p>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 @@ -101,12 +101,12 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
/**
* {@inheritDoc}
* <p>This implementation is a no-op for compatibility in Spring 3.2. Subclasses may
* <p>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) {

4
spring-context/src/main/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptor.java

@ -26,11 +26,11 @@ import org.springframework.core.annotation.AnnotationUtils; @@ -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
*/

2
spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java

@ -57,7 +57,7 @@ public @interface Async { @@ -57,7 +57,7 @@ public @interface Async {
* <p>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 "";

8
spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.1.xsd

@ -35,7 +35,10 @@ @@ -35,7 +35,10 @@
<xsd:documentation><![CDATA[
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
will be used by default.
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.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@ -98,6 +101,9 @@ @@ -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.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>

4
spring-context/src/main/resources/org/springframework/scheduling/config/spring-task-3.2.xsd

@ -36,7 +36,7 @@ @@ -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.
]]></xsd:documentation>
@ -101,7 +101,7 @@ @@ -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.
]]></xsd:documentation>

2
spring-context/src/test/java/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptorTests.java

@ -28,7 +28,7 @@ import static org.junit.Assert.*; @@ -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 {

Loading…
Cancel
Save