Skip to content

Commit 103d34f

Browse files
committed
Add getDataSource method to DefaultBatchConfigurer
1 parent 11bac7c commit 103d34f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/configuration/annotation/DefaultBatchConfigurer.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,20 @@ protected JobLauncher createJobLauncher() throws Exception {
129129

130130
protected JobRepository createJobRepository() throws Exception {
131131
JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
132-
factory.setDataSource(dataSource);
132+
factory.setDataSource(getDataSource());
133133
factory.setTransactionManager(getTransactionManager());
134134
factory.afterPropertiesSet();
135135
return factory.getObject();
136136
}
137137

138138
protected JobExplorer createJobExplorer() throws Exception {
139139
JobExplorerFactoryBean jobExplorerFactoryBean = new JobExplorerFactoryBean();
140-
jobExplorerFactoryBean.setDataSource(this.dataSource);
140+
jobExplorerFactoryBean.setDataSource(getDataSource());
141141
jobExplorerFactoryBean.afterPropertiesSet();
142142
return jobExplorerFactoryBean.getObject();
143143
}
144+
145+
protected DataSource getDataSource() {
146+
return dataSource;
147+
}
144148
}

0 commit comments

Comments
 (0)