Polish EnableAsync javadoc
Issue: SPR-14793
(cherry picked from commit ab232a5)
This commit is contained in:
committed by
Juergen Hoeller
parent
f5ecdda400
commit
7a8bf8e9a5
@@ -32,16 +32,26 @@ import org.springframework.core.Ordered;
|
|||||||
* Enables Spring's asynchronous method execution capability, similar to functionality
|
* Enables Spring's asynchronous method execution capability, similar to functionality
|
||||||
* found in Spring's {@code <task:*>} XML namespace.
|
* found in Spring's {@code <task:*>} XML namespace.
|
||||||
*
|
*
|
||||||
* <p>To be used on @{@link Configuration} classes as follows, where {@code MyAsyncBean}
|
* <p>To be used together with @{@link Configuration Configuration} classes as follows,
|
||||||
* is a user-defined type with one or more methods annotated with either Spring's
|
* enabling annotation-driven async processing for an entire Spring application context:
|
||||||
* {@code @Async} annotation, the EJB 3.1 {@code @javax.ejb.Asynchronous} annotation,
|
|
||||||
* or any custom annotation specified via the {@link #annotation} attribute.
|
|
||||||
*
|
*
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* @Configuration
|
* @Configuration
|
||||||
* @EnableAsync
|
* @EnableAsync
|
||||||
* public class AppConfig {
|
* public class AppConfig {
|
||||||
*
|
*
|
||||||
|
* }</pre>
|
||||||
|
*
|
||||||
|
* {@code MyAsyncBean} is a user-defined type with one or more methods annotated with
|
||||||
|
* either Spring's {@code @Async} annotation, the EJB 3.1 {@code @javax.ejb.Asynchronous}
|
||||||
|
* annotation, or any custom annotation specified via the {@link #annotation} attribute.
|
||||||
|
* The aspect is added transparently for any registered bean, for instance via this
|
||||||
|
* configuration:
|
||||||
|
*
|
||||||
|
* <pre class="code">
|
||||||
|
* @Configuration
|
||||||
|
* public class AnotherAppConfig {
|
||||||
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* public MyAsyncBean asyncBean() {
|
* public MyAsyncBean asyncBean() {
|
||||||
* return new MyAsyncBean();
|
* return new MyAsyncBean();
|
||||||
@@ -79,11 +89,6 @@ import org.springframework.core.Ordered;
|
|||||||
* @EnableAsync
|
* @EnableAsync
|
||||||
* public class AppConfig implements AsyncConfigurer {
|
* public class AppConfig implements AsyncConfigurer {
|
||||||
*
|
*
|
||||||
* @Bean
|
|
||||||
* public MyAsyncBean asyncBean() {
|
|
||||||
* return new MyAsyncBean();
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* @Override
|
* @Override
|
||||||
* public Executor getAsyncExecutor() {
|
* public Executor getAsyncExecutor() {
|
||||||
* ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
* ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
|||||||
Reference in New Issue
Block a user