Skip to content

Commit 6daf33d

Browse files
committed
Document that @async is not supported in @configuration classes
1 parent a9f251d commit 6daf33d

File tree

1 file changed

+9
-7
lines changed
  • spring-context/src/main/java/org/springframework/scheduling/annotation

1 file changed

+9
-7
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,9 @@
2525
/**
2626
* Annotation that marks a method as a candidate for <i>asynchronous</i> execution.
2727
* Can also be used at the type level, in which case all of the type's methods are
28-
* considered as asynchronous.
28+
* considered as asynchronous. Note, however, that {@code @Async} is not supported
29+
* on methods declared within a
30+
* {@link org.springframework.context.annotation.Configuration @Configuration} class.
2931
*
3032
* <p>In terms of target method signatures, any parameter types are supported.
3133
* However, the return type is constrained to either {@code void} or
@@ -55,13 +57,13 @@
5557

5658
/**
5759
* A qualifier value for the specified asynchronous operation(s).
58-
* <p>May be used to determine the target executor to be used when executing this
59-
* method, matching the qualifier value (or the bean name) of a specific
60-
* {@link java.util.concurrent.Executor Executor} or
60+
* <p>May be used to determine the target executor to be used when executing
61+
* the asynchronous operation(s), matching the qualifier value (or the bean
62+
* name) of a specific {@link java.util.concurrent.Executor Executor} or
6163
* {@link org.springframework.core.task.TaskExecutor TaskExecutor}
6264
* bean definition.
63-
* <p>When specified on a class level {@code @Async} annotation, indicates that the
64-
* given executor should be used for all methods within the class. Method level use
65+
* <p>When specified on a class-level {@code @Async} annotation, indicates that the
66+
* given executor should be used for all methods within the class. Method-level use
6567
* of {@code Async#value} always overrides any value set at the class level.
6668
* @since 3.1.2
6769
*/

0 commit comments

Comments
 (0)