Class AbstractJobRepositoryFactoryBean
java.lang.Object
org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<JobRepository>,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
JobRepositoryFactoryBean,MongoJobRepositoryFactoryBean
public abstract class AbstractJobRepositoryFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<JobRepository>, org.springframework.beans.factory.InitializingBean
A
FactoryBean that automates the creation of a SimpleJobRepository.
Declares abstract methods for providing DAO object implementations.- Author:
- Ben Hale, Lucas Ward, Robert Kasanicky, Mahmoud Ben Hassine
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected abstract ExecutionContextDaoprotected abstract JobExecutionDaoprotected abstract JobInstanceDaoprotected abstract StepExecutionDaoThe type of object to be returned fromgetObject().org.springframework.transaction.PlatformTransactionManagerThe transaction manager used in this factory.booleanvoidsetIsolationLevelForCreate(String isolationLevelForCreate) public setter for the isolation level to be used for the transaction when job execution entities are initially created.voidsetIsolationLevelForCreateEnum(org.springframework.transaction.annotation.Isolation isolationLevelForCreate) public setter for the isolation level to be used for the transaction when job execution entities are initially created.voidsetTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource transactionAttributeSource) Set the transaction attributes source to use in the created proxy.voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Public setter for thePlatformTransactionManager.voidsetValidateTransactionState(boolean validateTransactionState) Flag to determine whether to check for an existing transaction when a JobExecution is created.
-
Constructor Details
-
AbstractJobRepositoryFactoryBean
public AbstractJobRepositoryFactoryBean()
-
-
Method Details
-
createJobInstanceDao
- Returns:
- fully configured
JobInstanceDaoimplementation. - Throws:
Exception- thrown if error occurs creating JobInstanceDao.
-
createJobExecutionDao
- Returns:
- fully configured
JobExecutionDaoimplementation. - Throws:
Exception- thrown if error occurs creating JobExecutionDao.
-
createStepExecutionDao
- Returns:
- fully configured
StepExecutionDaoimplementation. - Throws:
Exception- thrown if error occurs creating StepExecutionDao.
-
createExecutionContextDao
- Returns:
- fully configured
ExecutionContextDaoimplementation. - Throws:
Exception- thrown if error occurs creating ExecutionContextDao.
-
getObjectType
The type of object to be returned fromgetObject().- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<JobRepository>- Returns:
- JobRepository.class
- See Also:
-
FactoryBean.getObjectType()
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<JobRepository>
-
setValidateTransactionState
public void setValidateTransactionState(boolean validateTransactionState) Flag to determine whether to check for an existing transaction when a JobExecution is created. Defaults to true because it is usually a mistake, and leads to problems with restartability and also to deadlocks in multi-threaded steps.- Parameters:
validateTransactionState- the flag to set
-
setIsolationLevelForCreate
public setter for the isolation level to be used for the transaction when job execution entities are initially created. The default is ISOLATION_SERIALIZABLE, which prevents accidental concurrent execution of the same job (ISOLATION_REPEATABLE_READ would work as well).- Parameters:
isolationLevelForCreate- the isolation level name to set- See Also:
-
setIsolationLevelForCreateEnum
public void setIsolationLevelForCreateEnum(org.springframework.transaction.annotation.Isolation isolationLevelForCreate) public setter for the isolation level to be used for the transaction when job execution entities are initially created. The default is ISOLATION_SERIALIZABLE, which prevents accidental concurrent execution of the same job (ISOLATION_REPEATABLE_READ would work as well).- Parameters:
isolationLevelForCreate- the isolation level to set- See Also:
-
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Public setter for thePlatformTransactionManager.- Parameters:
transactionManager- the transactionManager to set
-
getTransactionManager
public org.springframework.transaction.PlatformTransactionManager getTransactionManager()The transaction manager used in this factory. Useful to inject into steps and jobs, to ensure that they are using the same instance.- Returns:
- the transactionManager
-
setTransactionAttributeSource
public void setTransactionAttributeSource(org.springframework.transaction.interceptor.TransactionAttributeSource transactionAttributeSource) Set the transaction attributes source to use in the created proxy.- Parameters:
transactionAttributeSource- the transaction attributes source to use in the created proxy.- Since:
- 5.0
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<JobRepository>- Throws:
Exception
-