我在 Spring 4 中有以下 annotationconfig
@Bean(name = "replicationThreadExecutor")
public Executor replicationThreadExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(threadPoolCoreSize);
executor.setMaxPoolSize(threadPoolCoreSize);
executor.initialize();
return executor;
}
我关心的是Executor
. Spring会认识到动态类型Executor
是的一个实例DisposableBean
并销毁它,还是我需要将返回类型更改ThreadPoolTaskExecutor
为它才能工作?