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
This commit is contained in:
parent
7dff02b2c1
commit
f6de5d4360
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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
|
|||
|
||||
/**
|
||||
* {@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) {
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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 "";
|
||||
|
||||
|
|
|
@ -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 @@
|
|||
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>
|
||||
|
|
|
@ -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 @@
|
|||
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>
|
||||
|
|
|
@ -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…
Reference in New Issue