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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected org.springframework.batch.core.repository.dao.ExecutionContextDaoprotected SearchableJobExecutionDaoprotected SearchableJobInstanceDaoprotected SearchableStepExecutionDaoCreate aSimpleJobServicefrom the configuration provided.Class<? extends JobService>Tells the containing bean factory what kind of object is the product ofgetObject().booleanAllows optimisation in the containing bean factory.voidsetDatabaseType(String dbType) Sets the database type.voidsetDataSource(DataSource dataSource) Public setter for theDataSource.voidsetEnvironment(Environment environment) voidsetIncrementerFactory(org.springframework.batch.item.database.support.DataFieldMaxValueIncrementerFactory incrementerFactory) A factory for incrementers (used to build primary keys for meta data).voidsetJobExplorer(org.springframework.batch.core.explore.JobExplorer jobExplorer) voidsetJobLauncher(org.springframework.batch.core.launch.JobLauncher jobLauncher) The launcher used to run jobs.voidsetJobRepository(org.springframework.batch.core.repository.JobRepository jobRepository) The repository used to store and update jobs and step executions.voidsetJobService(JobService jobService) Sets theJobServicefor the factory bean.voidsetLobHandler(LobHandler lobHandler) A special handler for large objects.voidsetMaxVarCharLength(int maxVarCharLength) Public setter for the length of long string columns in database.voidsetSerializer(org.springframework.batch.core.repository.ExecutionContextSerializer serializer) A custom implementation of theExecutionContextSerializer.voidsetTablePrefix(String tablePrefix) Sets the table prefix for all the batch meta-data tables.voidsetTaskTablePrefix(String taskTablePrefix) voidsetTransactionManager(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- theLobHandlerto 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 bothJdbcJobExecutionDaoandJdbcStepExecutionDaoand 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:
setEnvironmentin 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 theJobServicefor 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- theJobRepositoryto 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:
afterPropertiesSetin 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 aSimpleJobServicefrom the configuration provided.- Specified by:
getObjectin interfaceFactoryBean<JobService>- Throws:
Exception- See Also:
-
getObjectType
Tells the containing bean factory what kind of object is the product ofgetObject().- Specified by:
getObjectTypein interfaceFactoryBean<JobService>- Returns:
- SimpleJobService
- See Also:
-
isSingleton
public boolean isSingleton()Allows optimisation in the containing bean factory.- Specified by:
isSingletonin interfaceFactoryBean<JobService>- Returns:
- true
- See Also:
-