Class SimpleBatchConfiguration
- java.lang.Object
- org.springframework.batch.core.configuration.annotation.AbstractBatchConfiguration
- org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.annotation.ImportAware
@Configuration public class SimpleBatchConfiguration extends AbstractBatchConfiguration
BaseConfiguration
class providing common structure for enabling and using Spring Batch. Customization is available by implementing theBatchConfigurer
interface. The main components are created as lazy proxies that only initialize when a method is called. This is to prevent (as much as possible) configuration cycles from developing when these components are needed in a configuration resource that itself provides aBatchConfigurer
.- Since:
- 2.2
- Author:
- Dave Syer
- See Also:
EnableBatchProcessing
Constructor Summary
Constructors Constructor Description SimpleBatchConfiguration()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
initialize()
Sets up the basic components by extracting them from theconfigurer
, defaulting to some sensible values as long as a unique DataSource is available.JobExplorer
jobExplorer()
JobLauncher
jobLauncher()
JobRegistry
jobRegistry()
JobRepository
jobRepository()
org.springframework.transaction.PlatformTransactionManager
transactionManager()
Methods inherited from class org.springframework.batch.core.configuration.annotation.AbstractBatchConfiguration
getConfigurer, jobBuilders, setImportMetadata, stepBuilders
Method Detail
jobRepository
@Bean public JobRepository jobRepository() throws java.lang.Exception
- Specified by:
jobRepository
in classAbstractBatchConfiguration
- Throws:
java.lang.Exception
jobLauncher
@Bean public JobLauncher jobLauncher() throws java.lang.Exception
- Specified by:
jobLauncher
in classAbstractBatchConfiguration
- Throws:
java.lang.Exception
jobRegistry
@Bean public JobRegistry jobRegistry() throws java.lang.Exception
- Overrides:
jobRegistry
in classAbstractBatchConfiguration
- Throws:
java.lang.Exception
jobExplorer
@Bean public JobExplorer jobExplorer()
- Specified by:
jobExplorer
in classAbstractBatchConfiguration
transactionManager
@Bean public org.springframework.transaction.PlatformTransactionManager transactionManager() throws java.lang.Exception
- Specified by:
transactionManager
in classAbstractBatchConfiguration
- Throws:
java.lang.Exception
initialize
protected void initialize() throws java.lang.Exception
Sets up the basic components by extracting them from theconfigurer
, defaulting to some sensible values as long as a unique DataSource is available.- Throws:
java.lang.Exception
- if there is a problem in the configurer