Class JobExplorerFactoryBean
java.lang.Object
org.springframework.batch.core.explore.support.AbstractJobExplorerFactoryBean
org.springframework.batch.core.explore.support.JobExplorerFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<JobExplorer>,org.springframework.beans.factory.InitializingBean
public class JobExplorerFactoryBean
extends AbstractJobExplorerFactoryBean
implements org.springframework.beans.factory.InitializingBean
A
FactoryBean that automates the creation of a SimpleJobExplorer by
using JDBC DAO implementations. Requires the user to describe what kind of database
they use.- Since:
- 2.0
- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected ExecutionContextDaoCreates an execution context instance data access object (DAO).protected JobExecutionDaoCreates a job execution data access object (DAO).protected JobInstanceDaoCreates a job instance data access object (DAO).protected StepExecutionDaoCreates a step execution data access object (DAO).voidsetCharset(Charset charset) Sets theCharsetto use when deserializing the execution context.voidsetConversionService(org.springframework.core.convert.support.ConfigurableConversionService conversionService) Set the conversion service to use in the job explorer.voidsetDataSource(DataSource dataSource) Sets the data source.voidsetJdbcOperations(org.springframework.jdbc.core.JdbcOperations jdbcOperations) Public setter for theJdbcOperations.voidsetJobKeyGenerator(JobKeyGenerator jobKeyGenerator) * Sets the generator for creating the key used in identifying unique {link JobInstance} objectsvoidsetLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler) The lob handler to use when savingExecutionContextinstances.voidsetSerializer(ExecutionContextSerializer serializer) A custom implementation ofExecutionContextSerializer.voidsetTablePrefix(String tablePrefix) Sets the table prefix for all the batch metadata tables.Methods inherited from class org.springframework.batch.core.explore.support.AbstractJobExplorerFactoryBean
getObject, getObjectType, getTransactionManager, isSingleton, setTransactionAttributeSource, setTransactionManager
-
Constructor Details
-
JobExplorerFactoryBean
public JobExplorerFactoryBean()
-
-
Method Details
-
setSerializer
A custom implementation ofExecutionContextSerializer. The default, if not injected, is theDefaultExecutionContextSerializer.- Parameters:
serializer- The serializer used to serialize or deserialize anExecutionContext.- See Also:
-
setDataSource
Sets the data source.Public setter for the
DataSource.- Parameters:
dataSource- ADataSource.
-
setJdbcOperations
public void setJdbcOperations(org.springframework.jdbc.core.JdbcOperations jdbcOperations) Public setter for theJdbcOperations. If this property is not explicitly set, a newJdbcTemplateis created, by default, for the configuredDataSource.- Parameters:
jdbcOperations- aJdbcOperations
-
setTablePrefix
Sets the table prefix for all the batch metadata tables.- Parameters:
tablePrefix- The table prefix for the batch metadata tables.
-
setJobKeyGenerator
* Sets the generator for creating the key used in identifying unique {link JobInstance} objects- Parameters:
jobKeyGenerator- aJobKeyGenerator- Since:
- 5.1
-
setLobHandler
public void setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler) The lob handler to use when savingExecutionContextinstances. Defaults tonull, which works for most databases.- Parameters:
lobHandler- Large object handler for saving anExecutionContext.
-
setCharset
Sets theCharsetto use when deserializing the execution context. Defaults to "UTF-8". Must not benull.- Parameters:
charset- The character set to use when deserializing the execution context.- Since:
- 5.0
- See Also:
-
setConversionService
public void setConversionService(@NonNull org.springframework.core.convert.support.ConfigurableConversionService conversionService) Set the conversion service to use in the job explorer. This service is used to convert job parameters from String literal to typed values and vice versa.- Parameters:
conversionService- the conversion service to use- Since:
- 5.0
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classAbstractJobExplorerFactoryBean- Throws:
Exception
-
createExecutionContextDao
Description copied from class:AbstractJobExplorerFactoryBeanCreates an execution context instance data access object (DAO).- Specified by:
createExecutionContextDaoin classAbstractJobExplorerFactoryBean- Returns:
- fully configured
ExecutionContextDaoimplementation. - Throws:
Exception- thrown if error occurs during ExecutionContextDao creation.
-
createJobInstanceDao
Description copied from class:AbstractJobExplorerFactoryBeanCreates a job instance data access object (DAO).- Specified by:
createJobInstanceDaoin classAbstractJobExplorerFactoryBean- Returns:
- a fully configured
JobInstanceDaoimplementation. - Throws:
Exception- thrown if error occurs during JobInstanceDao creation.
-
createJobExecutionDao
Description copied from class:AbstractJobExplorerFactoryBeanCreates a job execution data access object (DAO).- Specified by:
createJobExecutionDaoin classAbstractJobExplorerFactoryBean- Returns:
- a fully configured
JobExecutionDaoimplementation. - Throws:
Exception- thrown if error occurs during JobExecutionDao creation.
-
createStepExecutionDao
Description copied from class:AbstractJobExplorerFactoryBeanCreates a step execution data access object (DAO).- Specified by:
createStepExecutionDaoin classAbstractJobExplorerFactoryBean- Returns:
- a fully configured
StepExecutionDaoimplementation. - Throws:
Exception- thrown if error occurs during StepExecutionDao creation.
-