Class AbstractBatchConfiguration
java.lang.Object
org.springframework.batch.core.configuration.annotation.AbstractBatchConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
SimpleBatchConfiguration
@Configuration(proxyBeanMethods=false)
@Import(ScopeConfiguration.class)
public abstract class AbstractBatchConfiguration
extends Object
implements org.springframework.beans.factory.InitializingBean
Base
Configuration
class that provides a 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected BatchConfigurer
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.Establish theStepBuilderFactory
for the batch execution.abstract org.springframework.transaction.PlatformTransactionManager
Establish thePlatformTransactionManager
for the batch execution.
-
Field Details
-
context
@Autowired protected org.springframework.context.ApplicationContext context
-
-
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 an error occurs.
-
stepBuilders
Establish theStepBuilderFactory
for the batch execution.- Returns:
- The instance of the
StepBuilderFactory
. - Throws:
Exception
- TheException
thrown if an error occurs.
-
jobRepository
Establish theJobRepository
for the batch execution.- Returns:
- The instance of the
JobRepository
. - Throws:
Exception
- TheException
thrown if an error occurs.
-
jobLauncher
Establish theJobLauncher
for the batch execution.- Returns:
- The instance of the
JobLauncher
. - Throws:
Exception
- TheException
thrown if an error occurs.
-
jobExplorer
Establish theJobExplorer
for the batch execution.- Returns:
- The instance of the
JobExplorer
. - Throws:
Exception
- TheException
thrown if an error occurs.
-
jobRegistry
Establish theJobRegistry
for the batch execution.- Returns:
- The instance of the
JobRegistry
. - Throws:
Exception
- TheException
thrown if an error occurs.
-
transactionManager
public abstract org.springframework.transaction.PlatformTransactionManager transactionManager() throws ExceptionEstablish thePlatformTransactionManager
for the batch execution. -
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
getOrCreateConfigurer
If aBatchConfigurer
exists, return it. Otherwise, create aDefaultBatchConfigurer
. If more than one configurer is present, anIllegalStateException
is thrown.- Returns:
- The
BatchConfigurer
that was in the configurers collection or the default one created.
-