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
AFactoryBean
that automates the creation of aSimpleJobExplorer
using JDBC DAO implementations. Requires the user to describe what kind of database they are using.- Since:
- 2.0
- Author:
- Dave Syer
Constructor Summary
Constructors Constructor Description JobExplorerFactoryBean()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
protected ExecutionContextDao
createExecutionContextDao()
protected JobExecutionDao
createJobExecutionDao()
protected JobInstanceDao
createJobInstanceDao()
protected StepExecutionDao
createStepExecutionDao()
JobExplorer
getObject()
void
setDataSource(javax.sql.DataSource dataSource)
Public setter for theDataSource
.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 of theExecutionContextSerializer
.void
setTablePrefix(java.lang.String tablePrefix)
Sets the table prefix for all the batch meta-data tables.Methods inherited from class org.springframework.batch.core.explore.support.AbstractJobExplorerFactoryBean
getObjectType, isSingleton
Method Detail
setSerializer
public void setSerializer(ExecutionContextSerializer serializer)
A custom implementation of theExecutionContextSerializer
. The default, if not injected, is theXStreamExecutionContextStringSerializer
.- Parameters:
serializer
- used to serialize/deserialize anExecutionContext
- See Also:
ExecutionContextSerializer
setDataSource
public void setDataSource(javax.sql.DataSource dataSource)
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 set explicitly, a newJdbcTemplate
will be created for the configured DataSource by default.- Parameters:
jdbcOperations
- aJdbcOperations
setTablePrefix
public void setTablePrefix(java.lang.String tablePrefix)
Sets the table prefix for all the batch meta-data tables.- Parameters:
tablePrefix
- prefix for the batch meta-data tables
setLobHandler
public void setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler)
The lob handler to use when savingExecutionContext
instances. Defaults to null which works for most databases.- Parameters:
lobHandler
- Large object handler for savingExecutionContext
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
createExecutionContextDao
protected ExecutionContextDao createExecutionContextDao() throws java.lang.Exception
- Specified by:
createExecutionContextDao
in classAbstractJobExplorerFactoryBean
- Returns:
- fully configured
ExecutionContextDao
implementation. - Throws:
java.lang.Exception
- thrown if error occurs during ExecutionContextDao creation.
createJobInstanceDao
protected JobInstanceDao createJobInstanceDao() throws java.lang.Exception
- Specified by:
createJobInstanceDao
in classAbstractJobExplorerFactoryBean
- Returns:
- fully configured
JobInstanceDao
implementation. - Throws:
java.lang.Exception
- thrown if error occurs during JobInstanceDao creation.
createJobExecutionDao
protected JobExecutionDao createJobExecutionDao() throws java.lang.Exception
- Specified by:
createJobExecutionDao
in classAbstractJobExplorerFactoryBean
- Returns:
- fully configured
JobExecutionDao
implementation. - Throws:
java.lang.Exception
- thrown if error occurs during JobExecutionDao creation.
createStepExecutionDao
protected StepExecutionDao createStepExecutionDao() throws java.lang.Exception
- Specified by:
createStepExecutionDao
in classAbstractJobExplorerFactoryBean
- Returns:
- fully configured
StepExecutionDao
implementation. - Throws:
java.lang.Exception
- thrown if error occurs during StepExecutionDao creation.
getObject
public JobExplorer getObject() throws java.lang.Exception
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<JobExplorer>
- Throws:
java.lang.Exception