Class BatchAutoConfiguration
java.lang.Object
org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration
@AutoConfiguration(after=HibernateJpaAutoConfiguration.class)
@ConditionalOnClass({org.springframework.batch.core.launch.JobLauncher.class,javax.sql.DataSource.class})
@ConditionalOnBean({javax.sql.DataSource.class,org.springframework.batch.core.launch.JobLauncher.class})
@EnableConfigurationProperties(BatchProperties.class)
@Import({org.springframework.boot.autoconfigure.batch.BatchConfigurerConfiguration.class,DatabaseInitializationDependencyConfigurer.class})
public class BatchAutoConfiguration
extends Object
Auto-configuration
for Spring Batch. By default a
Runner will be created and all jobs in the context will be executed on startup.
Disable this behavior with spring.batch.job.enabled=false).
Alternatively, discrete Job names to execute on startup can be supplied by the User with a comma-delimited list: spring.batch.job.names=job1,job2. In this case the Runner will first find jobs registered as Beans, then those in the existing JobRegistry.
- Since:
- 1.0.0
- Author:
- Dave Syer, EddĂș MelĂ©ndez, Kazuki Shimizu, Mahmoud Ben Hassine
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjobLauncherApplicationRunner
(org.springframework.batch.core.launch.JobLauncher jobLauncher, org.springframework.batch.core.explore.JobExplorer jobExplorer, org.springframework.batch.core.repository.JobRepository jobRepository, BatchProperties properties) org.springframework.batch.core.launch.support.SimpleJobOperator
jobOperator
(ObjectProvider<org.springframework.batch.core.converter.JobParametersConverter> jobParametersConverter, org.springframework.batch.core.explore.JobExplorer jobExplorer, org.springframework.batch.core.launch.JobLauncher jobLauncher, org.springframework.batch.core.configuration.ListableJobLocator jobRegistry, org.springframework.batch.core.repository.JobRepository jobRepository)
-
Constructor Details
-
BatchAutoConfiguration
public BatchAutoConfiguration()
-
-
Method Details
-
jobLauncherApplicationRunner
@Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix="spring.batch.job", name="enabled", havingValue="true", matchIfMissing=true) public JobLauncherApplicationRunner jobLauncherApplicationRunner(org.springframework.batch.core.launch.JobLauncher jobLauncher, org.springframework.batch.core.explore.JobExplorer jobExplorer, org.springframework.batch.core.repository.JobRepository jobRepository, BatchProperties properties) -
jobExecutionExitCodeGenerator
@Bean @ConditionalOnMissingBean(ExitCodeGenerator.class) public JobExecutionExitCodeGenerator jobExecutionExitCodeGenerator() -
jobOperator
@Bean @ConditionalOnMissingBean(org.springframework.batch.core.launch.JobOperator.class) public org.springframework.batch.core.launch.support.SimpleJobOperator jobOperator(ObjectProvider<org.springframework.batch.core.converter.JobParametersConverter> jobParametersConverter, org.springframework.batch.core.explore.JobExplorer jobExplorer, org.springframework.batch.core.launch.JobLauncher jobLauncher, org.springframework.batch.core.configuration.ListableJobLocator jobRegistry, org.springframework.batch.core.repository.JobRepository jobRepository) throws Exception - Throws:
Exception
-