Class AbstractBatchConfiguration
java.lang.Object
org.springframework.batch.core.configuration.annotation.AbstractBatchConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.annotation.ImportAware
- Direct Known Subclasses:
SimpleBatchConfiguration
@Configuration(proxyBeanMethods=false)
@Import(ScopeConfiguration.class)
public abstract class AbstractBatchConfiguration
extends Object
implements org.springframework.context.annotation.ImportAware, org.springframework.beans.factory.InitializingBean
Base
Configuration
class providing common structure for enabling and using Spring Batch.
Customization is available by implementing the BatchConfigurer
interface.- Since:
- 2.2
- Author:
- Dave Syer, Michael Minella, Mahmoud Ben Hassine
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected BatchConfigurer
getConfigurer
(Collection<BatchConfigurer> configurers) If aBatchConfigurer
exists, return it.Establish theJobBuilderFactory
for the batch execution.abstract JobExplorer
Establish theJobExplorer
for the batch execution.abstract JobLauncher
Establish theJobLauncher
for the batch execution.Establish theJobRegistry
for the batch execution.abstract JobRepository
Establish theJobRepository
for the batch execution.void
setImportMetadata
(org.springframework.core.type.AnnotationMetadata importMetadata) Establish theStepBuilderFactory
for the batch execution.abstract org.springframework.transaction.PlatformTransactionManager
Establish thePlatformTransactionManager
for the batch execution.
-
Constructor Details
-
AbstractBatchConfiguration
public AbstractBatchConfiguration()
-
-
Method Details
-
jobBuilders
Establish theJobBuilderFactory
for the batch execution.- Returns:
- The instance of the
JobBuilderFactory
. - Throws:
Exception
- TheException
thrown if error occurs.
-
stepBuilders
Establish theStepBuilderFactory
for the batch execution.- Returns:
- The instance of the
StepBuilderFactory
. - Throws:
Exception
- TheException
thrown if error occurs.
-
jobRepository
Establish theJobRepository
for the batch execution.- Returns:
- The instance of the
JobRepository
. - Throws:
Exception
- TheException
thrown if error occurs.
-
jobLauncher
Establish theJobLauncher
for the batch execution.- Returns:
- The instance of the
JobLauncher
. - Throws:
Exception
- TheException
thrown if error occurs.
-
jobExplorer
Establish theJobExplorer
for the batch execution.- Returns:
- The instance of the
JobExplorer
. - Throws:
Exception
- TheException
thrown if error occurs.
-
jobRegistry
Establish theJobRegistry
for the batch execution.- Returns:
- The instance of the
JobRegistry
. - Throws:
Exception
- TheException
thrown if error occurs.
-
transactionManager
public abstract org.springframework.transaction.PlatformTransactionManager transactionManager() throws ExceptionEstablish thePlatformTransactionManager
for the batch execution. -
setImportMetadata
public void setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata) - Specified by:
setImportMetadata
in interfaceorg.springframework.context.annotation.ImportAware
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
getConfigurer
If aBatchConfigurer
exists, return it. If the configurers list is empty, create aDefaultBatchConfigurer
. If more than one configurer is present in the list, anIllegalStateException
is thrown.- Parameters:
configurers
- TheCollection
of configurers to review.- Returns:
- The
BatchConfigurer
that was in the configurers collection or the one created.
-