BATCH-2161 ScopeConfiguration methods should be static

The scope bean factory methods in ScopeConfiguration are
BeanFactoryPostProcessors and should therefore be static.

 - Declare the scope beans in ScopeConfiguration as static

Issue: BATCH-2161
This commit is contained in:
Philippe Marschall
2015-08-27 19:20:31 +02:00
committed by Mahmoud Ben Hassine
parent b49eea78de
commit 1e938e3e2b

View File

@@ -129,19 +129,18 @@ public abstract class AbstractBatchConfiguration implements ImportAware {
@Configuration @Configuration
class ScopeConfiguration { class ScopeConfiguration {
private StepScope stepScope = new StepScope();
private JobScope jobScope = new JobScope();
@Bean @Bean
public StepScope stepScope() { public static StepScope stepScope() {
StepScope stepScope = new StepScope();
stepScope.setAutoProxy(false); stepScope.setAutoProxy(false);
return stepScope; return stepScope;
} }
@Bean @Bean
public JobScope jobScope() { public static JobScope jobScope() {
JobScope jobScope = new JobScope();
jobScope.setAutoProxy(false); jobScope.setAutoProxy(false);
return jobScope; return jobScope;
} }
} }