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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected ExecutionContextDao
Creates an execution context instance data access object (DAO).protected JobExecutionDao
Creates a job execution data access object (DAO).protected JobInstanceDao
Creates a job instance data access object (DAO).protected StepExecutionDao
Creates a step execution data access object (DAO).void
setCharset
(Charset charset) Sets theCharset
to use when deserializing the execution context.void
setConversionService
(org.springframework.core.convert.support.ConfigurableConversionService conversionService) Set the conversion service to use in the job explorer.void
setDataSource
(DataSource dataSource) Sets the data source.void
setJdbcOperations
(org.springframework.jdbc.core.JdbcOperations jdbcOperations) Public setter for theJdbcOperations
.void
setLobHandler
(org.springframework.jdbc.support.lob.LobHandler lobHandler) The lob handler to use when savingExecutionContext
instances.void
setSerializer
(ExecutionContextSerializer serializer) A custom implementation ofExecutionContextSerializer
.void
setTablePrefix
(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 theDataSource
.- 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 newJdbcTemplate
is 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.
-
setLobHandler
public void setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler) The lob handler to use when savingExecutionContext
instances. Defaults tonull
, which works for most databases.- Parameters:
lobHandler
- Large object handler for saving anExecutionContext
.
-
setCharset
Sets theCharset
to 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:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classAbstractJobExplorerFactoryBean
- Throws:
Exception
-
createExecutionContextDao
Description copied from class:AbstractJobExplorerFactoryBean
Creates an execution context instance data access object (DAO).- Specified by:
createExecutionContextDao
in classAbstractJobExplorerFactoryBean
- Returns:
- fully configured
ExecutionContextDao
implementation. - Throws:
Exception
- thrown if error occurs during ExecutionContextDao creation.
-
createJobInstanceDao
Description copied from class:AbstractJobExplorerFactoryBean
Creates a job instance data access object (DAO).- Specified by:
createJobInstanceDao
in classAbstractJobExplorerFactoryBean
- Returns:
- a fully configured
JobInstanceDao
implementation. - Throws:
Exception
- thrown if error occurs during JobInstanceDao creation.
-
createJobExecutionDao
Description copied from class:AbstractJobExplorerFactoryBean
Creates a job execution data access object (DAO).- Specified by:
createJobExecutionDao
in classAbstractJobExplorerFactoryBean
- Returns:
- a fully configured
JobExecutionDao
implementation. - Throws:
Exception
- thrown if error occurs during JobExecutionDao creation.
-
createStepExecutionDao
Description copied from class:AbstractJobExplorerFactoryBean
Creates a step execution data access object (DAO).- Specified by:
createStepExecutionDao
in classAbstractJobExplorerFactoryBean
- Returns:
- a fully configured
StepExecutionDao
implementation. - Throws:
Exception
- thrown if error occurs during StepExecutionDao creation.
-