Class DefaultBatchConfigurer
java.lang.Object
org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer
- All Implemented Interfaces:
BatchConfigurer
Default implementation of the
BatchConfigurer
.-
Constructor Summary
ConstructorDescriptionDefaultBatchConfigurer
(DataSource dataSource) Create a newDefaultBatchConfigurer
with the passed datasource.DefaultBatchConfigurer
(DataSource dataSource, org.springframework.transaction.PlatformTransactionManager transactionManager) Create a newDefaultBatchConfigurer
with the passed datasource and transaction manager. -
Method Summary
Modifier and TypeMethodDescriptionprotected JobExplorer
protected JobLauncher
protected JobRepository
org.springframework.transaction.PlatformTransactionManager
void
void
setDataSource
(DataSource dataSource) Sets the dataSource.
-
Constructor Details
-
DefaultBatchConfigurer
Create a newDefaultBatchConfigurer
with the passed datasource. This constructor will configure a defaultDataSourceTransactionManager
.- Parameters:
dataSource
- to use for the job repository and job explorer
-
DefaultBatchConfigurer
public DefaultBatchConfigurer(DataSource dataSource, org.springframework.transaction.PlatformTransactionManager transactionManager) Create a newDefaultBatchConfigurer
with the passed datasource and transaction manager.- Parameters:
dataSource
- to use for the job repository and job explorertransactionManager
- 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
DataSource
used by theDefaultBatchConfigurer
.
-
getJobRepository
- Specified by:
getJobRepository
in interfaceBatchConfigurer
- Returns:
- The
JobRepository
.
-
getTransactionManager
public org.springframework.transaction.PlatformTransactionManager getTransactionManager()- Specified by:
getTransactionManager
in interfaceBatchConfigurer
- Returns:
- The
PlatformTransactionManager
.
-
getJobLauncher
- Specified by:
getJobLauncher
in interfaceBatchConfigurer
- Returns:
- The
JobLauncher
.
-
getJobExplorer
- Specified by:
getJobExplorer
in interfaceBatchConfigurer
- Returns:
- The
JobExplorer
.
-
initialize
@PostConstruct public void initialize() -
createJobLauncher
- Returns:
- An instance of
JobLauncher
. - Throws:
Exception
- TheException
that is thrown if an error occurs while creating theJobLauncher
.
-
createJobRepository
- Returns:
- An instance of
JobRepository
. - Throws:
Exception
- TheException
that is thrown if an error occurs while creating theJobRepository
.
-
createJobExplorer
- Returns:
- An instance of
JobExplorer
. - Throws:
Exception
- TheException
that is thrown if an error occurs while creating theJobExplorer
.
-