Polish EnableAsync javadoc

Issue: SPR-14793
This commit is contained in:
Stephane Nicoll 2016-10-11 08:21:52 +02:00
parent 1f6f0dc101
commit ab232a5386
1 changed files with 12 additions and 10 deletions

View File

@ -32,16 +32,23 @@ import org.springframework.core.Ordered;
* Enables Spring's asynchronous method execution capability, similar to functionality
* found in Spring's {@code <task:*>} XML namespace.
*
* <p>To be used on @{@link Configuration} classes as follows, where {@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.
*
* <p>To be used together with @{@link Configuration Configuration} classes as follows:
* <pre class="code">
* &#064;Configuration
* &#064;EnableAsync
* 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">
* &#064;Configuration
* public class AnotherAppConfig {
*
* &#064;Bean
* public MyAsyncBean asyncBean() {
* return new MyAsyncBean();
@ -79,11 +86,6 @@ import org.springframework.core.Ordered;
* &#064;EnableAsync
* public class AppConfig implements AsyncConfigurer {
*
* &#064;Bean
* public MyAsyncBean asyncBean() {
* return new MyAsyncBean();
* }
*
* &#064;Override
* public Executor getAsyncExecutor() {
* ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();