Class SimpleJobServiceFactoryBean
java.lang.Object
org.springframework.cloud.dataflow.server.batch.SimpleJobServiceFactoryBean
- All Implemented Interfaces:
Aware
,FactoryBean<JobService>
,InitializingBean
,EnvironmentAware
public class SimpleJobServiceFactoryBean
extends Object
implements FactoryBean<JobService>, InitializingBean, EnvironmentAware
A factory for a
JobService
that makes the configuration of its various
ingredients as convenient as possible.- Author:
- Dave Syer, Corneil du Plessis
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected org.springframework.batch.core.repository.dao.ExecutionContextDao
protected SearchableJobExecutionDao
protected SearchableJobInstanceDao
protected SearchableStepExecutionDao
Create aSimpleJobService
from the configuration provided.Class<? extends JobService>
Tells the containing bean factory what kind of object is the product ofgetObject()
.boolean
Allows optimisation in the containing bean factory.void
setDatabaseType
(String dbType) Sets the database type.void
setDataSource
(DataSource dataSource) Public setter for theDataSource
.void
setEnvironment
(Environment environment) void
setIncrementerFactory
(org.springframework.batch.item.database.support.DataFieldMaxValueIncrementerFactory incrementerFactory) A factory for incrementers (used to build primary keys for meta data).void
setJobExplorer
(org.springframework.batch.core.explore.JobExplorer jobExplorer) void
setJobLauncher
(org.springframework.batch.core.launch.JobLauncher jobLauncher) The launcher used to run jobs.void
setJobRepository
(org.springframework.batch.core.repository.JobRepository jobRepository) The repository used to store and update jobs and step executions.void
setJobService
(JobService jobService) Sets theJobService
for the factory bean.void
setLobHandler
(LobHandler lobHandler) A special handler for large objects.void
setMaxVarCharLength
(int maxVarCharLength) Public setter for the length of long string columns in database.void
setSerializer
(org.springframework.batch.core.repository.ExecutionContextSerializer serializer) A custom implementation of theExecutionContextSerializer
.void
setTablePrefix
(String tablePrefix) Sets the table prefix for all the batch meta-data tables.void
setTaskTablePrefix
(String taskTablePrefix) void
setTransactionManager
(PlatformTransactionManager transactionManager)
-
Constructor Details
-
SimpleJobServiceFactoryBean
public SimpleJobServiceFactoryBean()
-
-
Method Details
-
setTransactionManager
-
setLobHandler
A special handler for large objects. The default is usually fine, except for some (usually older) versions of Oracle. The default is determined from the data base type.- Parameters:
lobHandler
- theLobHandler
to set- See Also:
-
setMaxVarCharLength
public void setMaxVarCharLength(int maxVarCharLength) Public setter for the length of long string columns in database. Do not set this if you haven't modified the schema. Note this value will be used for the exit message in bothJdbcJobExecutionDao
andJdbcStepExecutionDao
and also the short version of the execution context inJdbcExecutionContextDao
. For databases with multi-byte character sets this number can be smaller (by up to a factor of 2 for 2-byte characters) than the declaration of the column length in the DDL for the tables.- Parameters:
maxVarCharLength
- the exitMessageLength to set
-
setEnvironment
- Specified by:
setEnvironment
in interfaceEnvironmentAware
-
setDataSource
Public setter for theDataSource
.- Parameters:
dataSource
- aDataSource
-
setDatabaseType
Sets the database type.- Parameters:
dbType
- as specified byDefaultDataFieldMaxValueIncrementerFactory
-
setTablePrefix
Sets the table prefix for all the batch meta-data tables.- Parameters:
tablePrefix
- Prefix for batch meta-data tables
-
setTaskTablePrefix
-
setJobService
Sets theJobService
for the factory bean.- Parameters:
jobService
- the JobService for this Factory Bean.
-
setIncrementerFactory
public void setIncrementerFactory(org.springframework.batch.item.database.support.DataFieldMaxValueIncrementerFactory incrementerFactory) A factory for incrementers (used to build primary keys for meta data). Defaults toDefaultDataFieldMaxValueIncrementerFactory
.- Parameters:
incrementerFactory
- the incrementer factory to set
-
setJobExplorer
public void setJobExplorer(org.springframework.batch.core.explore.JobExplorer jobExplorer) -
setJobRepository
public void setJobRepository(org.springframework.batch.core.repository.JobRepository jobRepository) The repository used to store and update jobs and step executions.- Parameters:
jobRepository
- theJobRepository
to set
-
setJobLauncher
public void setJobLauncher(org.springframework.batch.core.launch.JobLauncher jobLauncher) The launcher used to run jobs.- Parameters:
jobLauncher
- aJobLauncher
-
setSerializer
public void setSerializer(org.springframework.batch.core.repository.ExecutionContextSerializer serializer) A custom implementation of theExecutionContextSerializer
.- Parameters:
serializer
- the serializer to set- See Also:
-
ExecutionContextSerializer
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
Exception
-
createJobInstanceDao
- Throws:
Exception
-
createJobExecutionDao
- Throws:
Exception
-
createStepExecutionDao
- Throws:
Exception
-
createExecutionContextDao
protected org.springframework.batch.core.repository.dao.ExecutionContextDao createExecutionContextDao() throws Exception- Throws:
Exception
-
getObject
Create aSimpleJobService
from the configuration provided.- Specified by:
getObject
in interfaceFactoryBean<JobService>
- Throws:
Exception
- See Also:
-
getObjectType
Tells the containing bean factory what kind of object is the product ofgetObject()
.- Specified by:
getObjectType
in interfaceFactoryBean<JobService>
- Returns:
- SimpleJobService
- See Also:
-
isSingleton
public boolean isSingleton()Allows optimisation in the containing bean factory.- Specified by:
isSingleton
in interfaceFactoryBean<JobService>
- Returns:
- true
- See Also:
-