Class MongoJobRepositoryFactoryBean
java.lang.Object
org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean
org.springframework.batch.core.repository.support.MongoJobRepositoryFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<JobRepository>
,org.springframework.beans.factory.InitializingBean
public class MongoJobRepositoryFactoryBean
extends AbstractJobRepositoryFactoryBean
implements org.springframework.beans.factory.InitializingBean
This factory bean creates a job repository backed by MongoDB. It requires a mongo
template and a mongo transaction manager. The mongo template must be configured
with a
MappingMongoConverter
having a MapKeyDotReplacement
set to a non
null value. See MongoDBJobRepositoryIntegrationTests
for an example. This is
required to support execution context keys containing dots (like "step.type" or
"batch.version")- Since:
- 5.2.0
- Author:
- Mahmoud Ben Hassine
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected ExecutionContextDao
protected JobExecutionDao
protected JobInstanceDao
protected StepExecutionDao
void
setMongoOperations
(org.springframework.data.mongodb.core.MongoOperations mongoOperations) Methods inherited from class org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean
getObject, getObjectType, getTransactionManager, isSingleton, setIsolationLevelForCreate, setIsolationLevelForCreateEnum, setTransactionAttributeSource, setTransactionManager, setValidateTransactionState
-
Constructor Details
-
MongoJobRepositoryFactoryBean
public MongoJobRepositoryFactoryBean()
-
-
Method Details
-
setMongoOperations
public void setMongoOperations(org.springframework.data.mongodb.core.MongoOperations mongoOperations) -
createJobInstanceDao
- Specified by:
createJobInstanceDao
in classAbstractJobRepositoryFactoryBean
- Returns:
- fully configured
JobInstanceDao
implementation.
-
createJobExecutionDao
- Specified by:
createJobExecutionDao
in classAbstractJobRepositoryFactoryBean
- Returns:
- fully configured
JobExecutionDao
implementation.
-
createStepExecutionDao
- Specified by:
createStepExecutionDao
in classAbstractJobRepositoryFactoryBean
- Returns:
- fully configured
StepExecutionDao
implementation.
-
createExecutionContextDao
- Specified by:
createExecutionContextDao
in classAbstractJobRepositoryFactoryBean
- Returns:
- fully configured
ExecutionContextDao
implementation.
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classAbstractJobRepositoryFactoryBean
- Throws:
Exception
-