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

(cherry picked from commit 1e938e3)
This commit is contained in:
Philippe Marschall
2015-08-27 19:20:31 +02:00
committed by Mahmoud Ben Hassine
parent 8d1c1c2424
commit 202ececcd5

View File

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