Clarify use of @Bean with @EnableAsync executors

Update Javadoc to indicate that the getAsyncExecutor() method may be
optionally annotated with @Bean and in such circumstance the
executor.initialize() method need not be called.

Issue: SPR-9934
master
Phillip Webb 12 years ago
parent 92ca8b32fb
commit 63ca14c33e
  1. 8
      spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java

@ -96,7 +96,13 @@ import org.springframework.core.Ordered;
* the examples are equivalent save the setting of the <em>thread name prefix</em> of the
* Executor; this is because the the {@code task:} namespace {@code executor} element does
* not expose such an attribute. This demonstrates how the code-based approach allows for
* maximum configurability through direct access to actual componentry.<p>
* maximum configurability through direct access to actual componentry.
*
* <p>Note: In the above example the {@code ThreadPoolTaskExecutor} is not a fully managed
* Spring Bean. Add the {@code @Bean} annotation to the {@code getAsyncExecutor()} method
* if you want a fully managed bean. In such circumstances it is no longer necessary to
* manually call the {@code executor.initialize()} method as this will be invoked
* automatically when the bean is initialized.
*
* @author Chris Beams
* @since 3.1

Loading…
Cancel
Save