Browse Source

Polish EnableAsync javadoc

Issue: SPR-14793
(cherry picked from commit ab232a5)
pull/1104/merge
Stephane Nicoll 9 years ago committed by Juergen Hoeller
parent
commit
7a8bf8e9a5
  1. 23
      spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java

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

@ -32,16 +32,26 @@ import org.springframework.core.Ordered; @@ -32,16 +32,26 @@ 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,
* enabling annotation-driven async processing for an entire Spring application context:
*
* <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 +89,6 @@ import org.springframework.core.Ordered; @@ -79,11 +89,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();

Loading…
Cancel
Save