SPR-6644 The 'id' value from an 'executor' element in the task namespace is now used as the thread name prefix for the resulting ThreadPoolTaskExecutor instance.

This commit is contained in:
Mark Fisher
2010-01-05 22:27:47 +00:00
parent 265084cb6c
commit 4ab4fa7042
2 changed files with 10 additions and 1 deletions

View File

@@ -108,6 +108,9 @@ public class TaskExecutorFactoryBean implements FactoryBean<TaskExecutor>, BeanN
this.setValueIfNotNull("corePoolSize", range[0]);
this.setValueIfNotNull("maxPoolSize", range[1]);
}
if (this.beanName != null) {
this.beanWrapper.setPropertyValue("threadNamePrefix", this.beanName + "-");
}
this.target = (TaskExecutor) this.beanWrapper.getWrappedInstance();
if (this.target instanceof InitializingBean) {
((InitializingBean)this.target).afterPropertiesSet();