Skip to content

Commit 7a8bf8e

Browse files
snicolljhoeller
authored andcommitted
Polish EnableAsync javadoc
Issue: SPR-14793 (cherry picked from commit ab232a5)
1 parent f5ecdda commit 7a8bf8e

File tree

1 file changed

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

1 file changed

+14
-9
lines changed

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

+14-9
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,26 @@
3232
* Enables Spring's asynchronous method execution capability, similar to functionality
3333
* found in Spring's {@code <task:*>} XML namespace.
3434
*
35-
* <p>To be used on @{@link Configuration} classes as follows, where {@code MyAsyncBean}
36-
* is a user-defined type with one or more methods annotated with either Spring's
37-
* {@code @Async} annotation, the EJB 3.1 {@code @javax.ejb.Asynchronous} annotation,
38-
* or any custom annotation specified via the {@link #annotation} attribute.
35+
* <p>To be used together with @{@link Configuration Configuration} classes as follows,
36+
* enabling annotation-driven async processing for an entire Spring application context:
3937
*
4038
* <pre class="code">
4139
* &#064;Configuration
4240
* &#064;EnableAsync
4341
* public class AppConfig {
4442
*
43+
* }</pre>
44+
*
45+
* {@code MyAsyncBean} is a user-defined type with one or more methods annotated with
46+
* either Spring's {@code @Async} annotation, the EJB 3.1 {@code @javax.ejb.Asynchronous}
47+
* annotation, or any custom annotation specified via the {@link #annotation} attribute.
48+
* The aspect is added transparently for any registered bean, for instance via this
49+
* configuration:
50+
*
51+
* <pre class="code">
52+
* &#064;Configuration
53+
* public class AnotherAppConfig {
54+
*
4555
* &#064;Bean
4656
* public MyAsyncBean asyncBean() {
4757
* return new MyAsyncBean();
@@ -79,11 +89,6 @@
7989
* &#064;EnableAsync
8090
* public class AppConfig implements AsyncConfigurer {
8191
*
82-
* &#064;Bean
83-
* public MyAsyncBean asyncBean() {
84-
* return new MyAsyncBean();
85-
* }
86-
*
8792
* &#064;Override
8893
* public Executor getAsyncExecutor() {
8994
* ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();

0 commit comments

Comments
 (0)