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
ConstructorDescriptionDefaultBatchConfigurer
(DataSource dataSource) Create a newDefaultBatchConfigurer
with the passed datasource.DefaultBatchConfigurer
(DataSource dataSource, org.springframework.transaction.PlatformTransactionManager transactionManager) Create a newDefaultBatchConfigurer
with the given datasource and transaction manager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected 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 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 newDefaultBatchConfigurer
with 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
DataSource
used by theDefaultBatchConfigurer
.
-
getJobRepository
- Specified by:
getJobRepository
in interfaceBatchConfigurer
- Returns:
- The
JobRepository
.
-
getJobLauncher
- Specified by:
getJobLauncher
in interfaceBatchConfigurer
- Returns:
- The
JobLauncher
.
-
getJobExplorer
- Specified by:
getJobExplorer
in interfaceBatchConfigurer
- Returns:
- The
JobExplorer
.
-
getTransactionManager
public org.springframework.transaction.PlatformTransactionManager getTransactionManager()- Specified by:
getTransactionManager
in interfaceBatchConfigurer
- Returns:
- The
PlatformTransactionManager
.
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
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
.
-