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 TypeMethodDescriptionvoidprotected BatchConfigurerIf aBatchConfigurerexists, return it.Establish theJobBuilderFactoryfor the batch execution.abstract JobExplorerEstablish theJobExplorerfor the batch execution.abstract JobLauncherEstablish theJobLauncherfor the batch execution.Establish theJobRegistryfor the batch execution.abstract JobRepositoryEstablish theJobRepositoryfor the batch execution.Establish theStepBuilderFactoryfor the batch execution.abstract org.springframework.transaction.PlatformTransactionManagerEstablish thePlatformTransactionManagerfor the batch execution.
-
Field Details
-
context
@Autowired protected org.springframework.context.ApplicationContext context
-
-
Constructor Details
-
AbstractBatchConfiguration
public AbstractBatchConfiguration()
-
-
Method Details
-
jobBuilders
Establish theJobBuilderFactoryfor the batch execution.- Returns:
- The instance of the
JobBuilderFactory. - Throws:
Exception- TheExceptionthrown if an error occurs.
-
stepBuilders
Establish theStepBuilderFactoryfor the batch execution.- Returns:
- The instance of the
StepBuilderFactory. - Throws:
Exception- TheExceptionthrown if an error occurs.
-
jobRepository
Establish theJobRepositoryfor the batch execution.- Returns:
- The instance of the
JobRepository. - Throws:
Exception- TheExceptionthrown if an error occurs.
-
jobLauncher
Establish theJobLauncherfor the batch execution.- Returns:
- The instance of the
JobLauncher. - Throws:
Exception- TheExceptionthrown if an error occurs.
-
jobExplorer
Establish theJobExplorerfor the batch execution.- Returns:
- The instance of the
JobExplorer. - Throws:
Exception- TheExceptionthrown if an error occurs.
-
jobRegistry
Establish theJobRegistryfor the batch execution.- Returns:
- The instance of the
JobRegistry. - Throws:
Exception- TheExceptionthrown if an error occurs.
-
transactionManager
public abstract org.springframework.transaction.PlatformTransactionManager transactionManager() throws ExceptionEstablish thePlatformTransactionManagerfor the batch execution. -
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getOrCreateConfigurer
If aBatchConfigurerexists, return it. Otherwise, create aDefaultBatchConfigurer. If more than one configurer is present, anIllegalStateExceptionis thrown.- Returns:
- The
BatchConfigurerthat was in the configurers collection or the default one created.
-