File tree 1 file changed +12
-10
lines changed
spring-context/src/main/java/org/springframework/scheduling/annotation
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 32
32
* Enables Spring's asynchronous method execution capability, similar to functionality
33
33
* found in Spring's {@code <task:*>} XML namespace.
34
34
*
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.
39
- *
35
+ * <p>To be used together with @{@link Configuration Configuration} classes as follows:
40
36
* <pre class="code">
41
37
* @Configuration
42
38
* @EnableAsync
43
39
* public class AppConfig {
44
40
*
41
+ * }</pre>
42
+ *
43
+ * {@code MyAsyncBean} is a user-defined type with one or more methods annotated with
44
+ * either Spring's {@code @Async} annotation, the EJB 3.1 {@code @javax.ejb.Asynchronous}
45
+ * annotation, or any custom annotation specified via the {@link #annotation} attribute.
46
+ * The aspect is added transparently for any registered bean, for instance via this
47
+ * configuration:
48
+ * <pre class="code">
49
+ * @Configuration
50
+ * public class AnotherAppConfig {
51
+ *
45
52
* @Bean
46
53
* public MyAsyncBean asyncBean() {
47
54
* return new MyAsyncBean();
79
86
* @EnableAsync
80
87
* public class AppConfig implements AsyncConfigurer {
81
88
*
82
- * @Bean
83
- * public MyAsyncBean asyncBean() {
84
- * return new MyAsyncBean();
85
- * }
86
- *
87
89
* @Override
88
90
* public Executor getAsyncExecutor() {
89
91
* ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
You can’t perform that action at this time.
0 commit comments