Rename AsyncConfigurer#get{+Async}Executor
This commit is contained in:
parent
358cbf4301
commit
7e398f101c
|
|
@ -68,6 +68,6 @@ public abstract class AbstractAsyncConfiguration implements ImportAware {
|
|||
}
|
||||
|
||||
AsyncConfigurer configurer = configurers.iterator().next();
|
||||
this.executor = configurer.getExecutor();
|
||||
this.executor = configurer.getAsyncExecutor();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ public interface AsyncConfigurer {
|
|||
* The {@link Executor} instance to be used when processing async
|
||||
* method invocations.
|
||||
*/
|
||||
Executor getExecutor();
|
||||
Executor getAsyncExecutor();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.lang.annotation.Retention;
|
|||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.context.config.AdviceMode;
|
||||
import org.springframework.core.Ordered;
|
||||
|
|
@ -52,7 +53,7 @@ import org.springframework.core.Ordered;
|
|||
* SimpleAsyncTaskExecutor} will be used to process async method invocations. To
|
||||
* customize this behavior, implement {@link AsyncConfigurer} and
|
||||
* provide your own {@link java.util.concurrent.Executor Executor} through the
|
||||
* {@link AsyncConfigurer#getExecutor() getExecutor()} method.
|
||||
* {@link AsyncConfigurer#getAsyncExecutor() getExecutor()} method.
|
||||
*
|
||||
* <pre class="code">
|
||||
* @Configuration
|
||||
|
|
@ -64,7 +65,8 @@ import org.springframework.core.Ordered;
|
|||
* return new MyAsyncBean();
|
||||
* }
|
||||
*
|
||||
* public Executor getExecutor() {
|
||||
* @Override
|
||||
* public Executor getAsyncExecutor() {
|
||||
* ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
* executor.setThreadNamePrefix("Custom-");
|
||||
* executor.initialize();
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ public class EnableAsyncTests {
|
|||
return new AsyncBean();
|
||||
}
|
||||
|
||||
public Executor getExecutor() {
|
||||
public Executor getAsyncExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setThreadNamePrefix("Custom-");
|
||||
executor.initialize();
|
||||
|
|
|
|||
Loading…
Reference in New Issue