Rename AsyncConfigurer#get{+Async}Executor

This commit is contained in:
Chris Beams
2011-05-07 09:32:03 +00:00
parent 358cbf4301
commit 7e398f101c
4 changed files with 7 additions and 5 deletions

View File

@@ -68,6 +68,6 @@ public abstract class AbstractAsyncConfiguration implements ImportAware {
}
AsyncConfigurer configurer = configurers.iterator().next();
this.executor = configurer.getExecutor();
this.executor = configurer.getAsyncExecutor();
}
}

View File

@@ -36,6 +36,6 @@ public interface AsyncConfigurer {
* The {@link Executor} instance to be used when processing async
* method invocations.
*/
Executor getExecutor();
Executor getAsyncExecutor();
}

View File

@@ -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();