Class DefaultBatchConfigurer
java.lang.Object
org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer
- All Implemented Interfaces:
BatchConfigurer,org.springframework.beans.factory.InitializingBean
@Component
public class DefaultBatchConfigurer
extends Object
implements BatchConfigurer, org.springframework.beans.factory.InitializingBean
Default implementation of the
BatchConfigurer.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultBatchConfigurer(DataSource dataSource) Create a newDefaultBatchConfigurerwith the passed datasource.DefaultBatchConfigurer(DataSource dataSource, org.springframework.transaction.PlatformTransactionManager transactionManager) Create a newDefaultBatchConfigurerwith the given datasource and transaction manager. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected JobExplorerprotected JobLauncherprotected JobRepositoryorg.springframework.transaction.PlatformTransactionManagervoidvoidsetDataSource(DataSource dataSource) Sets the dataSource.
-
Constructor Details
-
DefaultBatchConfigurer
Create a newDefaultBatchConfigurerwith the passed datasource. This constructor configures a defaultJdbcTransactionManager.- Parameters:
dataSource- to use for the job repository and job explorer
-
DefaultBatchConfigurer
public DefaultBatchConfigurer(DataSource dataSource, org.springframework.transaction.PlatformTransactionManager transactionManager) Create a newDefaultBatchConfigurerwith the given datasource and transaction manager.- Parameters:
dataSource- The data source to use for the job repository and job explorer.transactionManager- The transaction manager to use for the job repository.
-
-
Method Details
-
setDataSource
Sets the dataSource.- Parameters:
dataSource- The data source to use. Must not benull.
-
getDataSource
- Returns:
- The
DataSourceused by theDefaultBatchConfigurer.
-
getJobRepository
- Specified by:
getJobRepositoryin interfaceBatchConfigurer- Returns:
- The
JobRepository.
-
getJobLauncher
- Specified by:
getJobLauncherin interfaceBatchConfigurer- Returns:
- The
JobLauncher.
-
getJobExplorer
- Specified by:
getJobExplorerin interfaceBatchConfigurer- Returns:
- The
JobExplorer.
-
getTransactionManager
public org.springframework.transaction.PlatformTransactionManager getTransactionManager()- Specified by:
getTransactionManagerin interfaceBatchConfigurer- Returns:
- The
PlatformTransactionManager.
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
initialize
@PostConstruct public void initialize() -
createJobLauncher
- Returns:
- An instance of
JobLauncher. - Throws:
Exception- TheExceptionthat is thrown if an error occurs while creating theJobLauncher.
-
createJobRepository
- Returns:
- An instance of
JobRepository. - Throws:
Exception- TheExceptionthat is thrown if an error occurs while creating theJobRepository.
-
createJobExplorer
- Returns:
- An instance of
JobExplorer. - Throws:
Exception- TheExceptionthat is thrown if an error occurs while creating theJobExplorer.
-