From 72754c27b271416d3c8ee7497fa7f88abff393f8 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 5 Jan 2016 17:53:42 +0000 Subject: [PATCH] Allow to override BasicBatchConfigurer Issue #4533 was supposed to make BasicBatchConfigurer public again but unfortunately only the class visibility was changed. This commit makes sure it can be overridden. Closes gh-4888 --- .../boot/autoconfigure/batch/BasicBatchConfigurer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java index 219c0d18fe..ea546541e4 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java @@ -66,7 +66,7 @@ public class BasicBatchConfigurer implements BatchConfigurer { * @param properties the batch properties * @param dataSource the underlying data source */ - BasicBatchConfigurer(BatchProperties properties, DataSource dataSource) { + protected BasicBatchConfigurer(BatchProperties properties, DataSource dataSource) { this(properties, dataSource, null); } @@ -76,7 +76,7 @@ public class BasicBatchConfigurer implements BatchConfigurer { * @param dataSource the underlying data source * @param entityManagerFactory the entity manager factory (or {@code null}) */ - BasicBatchConfigurer(BatchProperties properties, DataSource dataSource, + protected BasicBatchConfigurer(BatchProperties properties, DataSource dataSource, EntityManagerFactory entityManagerFactory) { this.properties = properties; this.entityManagerFactory = entityManagerFactory; @@ -116,7 +116,7 @@ public class BasicBatchConfigurer implements BatchConfigurer { } } - private JobExplorer createJobExplorer() throws Exception { + protected JobExplorer createJobExplorer() throws Exception { JobExplorerFactoryBean jobExplorerFactoryBean = new JobExplorerFactoryBean(); jobExplorerFactoryBean.setDataSource(this.dataSource); String tablePrefix = this.properties.getTablePrefix(); @@ -127,7 +127,7 @@ public class BasicBatchConfigurer implements BatchConfigurer { return jobExplorerFactoryBean.getObject(); } - private JobLauncher createJobLauncher() throws Exception { + protected JobLauncher createJobLauncher() throws Exception { SimpleJobLauncher jobLauncher = new SimpleJobLauncher(); jobLauncher.setJobRepository(getJobRepository()); jobLauncher.afterPropertiesSet();