提交 7e398f10 编写于 作者: C Chris Beams

Rename AsyncConfigurer#get{+Async}Executor

上级 358cbf43
......@@ -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">
* &#064;Configuration
......@@ -64,7 +65,8 @@ import org.springframework.core.Ordered;
* return new MyAsyncBean();
* }
*
* public Executor getExecutor() {
* &#064;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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册