org.springframework.batch.admin.service
Class SimpleJobServiceFactoryBean

java.lang.Object
  extended by org.springframework.batch.admin.service.SimpleJobServiceFactoryBean
All Implemented Interfaces:
FactoryBean<JobService>, InitializingBean

public class SimpleJobServiceFactoryBean
extends Object
implements FactoryBean<JobService>, InitializingBean

A factory for a JobService that makes the configuration of its various ingredients as convenient as possible.

Author:
Dave Syer

Constructor Summary
SimpleJobServiceFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  ExecutionContextDao createExecutionContextDao()
           
protected  SearchableJobExecutionDao createJobExecutionDao()
           
protected  SearchableJobInstanceDao createJobInstanceDao()
           
protected  SearchableStepExecutionDao createStepExecutionDao()
           
 JobService getObject()
          Create a SimpleJobService from the configuration provided.
 Class<? extends JobService> getObjectType()
          Tells the containing bean factory what kind of object is the product of getObject().
 boolean isSingleton()
          Allows optimisation in the containing bean factory.
 void setDatabaseType(String dbType)
          Sets the database type.
 void setDataSource(DataSource dataSource)
          Public setter for the DataSource.
 void setIncrementerFactory(DataFieldMaxValueIncrementerFactory incrementerFactory)
          A factory for incrementers (used to build primary keys for meta data).
 void setJobLauncher(JobLauncher jobLauncher)
          The launcher used to run jobs.
 void setJobLocator(ListableJobLocator jobLocator)
          A registry that can be used to locate jobs to run.
 void setJobRepository(JobRepository jobRepository)
          The repository used to store and update jobs and step executions.
 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 setTablePrefix(String tablePrefix)
          Sets the table prefix for all the batch meta-data tables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleJobServiceFactoryBean

public SimpleJobServiceFactoryBean()
Method Detail

setLobHandler

public void setLobHandler(LobHandler lobHandler)
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 - the LobHandler to set
See Also:
LobHandler

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 both JdbcJobExecutionDao and JdbcStepExecutionDao and also the short version of the execution context in JdbcExecutionContextDao . 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

setDataSource

public void setDataSource(DataSource dataSource)
Public setter for the DataSource.

Parameters:
dataSource - a DataSource

setDatabaseType

public void setDatabaseType(String dbType)
Sets the database type.

Parameters:
dbType - as specified by DefaultDataFieldMaxValueIncrementerFactory

setTablePrefix

public void setTablePrefix(String tablePrefix)
Sets the table prefix for all the batch meta-data tables.

Parameters:
tablePrefix -

setIncrementerFactory

public void setIncrementerFactory(DataFieldMaxValueIncrementerFactory incrementerFactory)
A factory for incrementers (used to build primary keys for meta data). Defaults to DefaultDataFieldMaxValueIncrementerFactory.

Parameters:
incrementerFactory - the incrementer factory to set

setJobRepository

public void setJobRepository(JobRepository jobRepository)
The repository used to store and update jobs and step executions.

Parameters:
jobRepository - the JobRepository to set

setJobLauncher

public void setJobLauncher(JobLauncher jobLauncher)
The launcher used to run jobs.

Parameters:
jobLauncher - a JobLauncher

setJobLocator

public void setJobLocator(ListableJobLocator jobLocator)
A registry that can be used to locate jobs to run.

Parameters:
jobLocator - a JobLocator

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

createJobInstanceDao

protected SearchableJobInstanceDao createJobInstanceDao()
                                                 throws Exception
Throws:
Exception

createJobExecutionDao

protected SearchableJobExecutionDao createJobExecutionDao()
                                                   throws Exception
Throws:
Exception

createStepExecutionDao

protected SearchableStepExecutionDao createStepExecutionDao()
                                                     throws Exception
Throws:
Exception

createExecutionContextDao

protected ExecutionContextDao createExecutionContextDao()
                                                 throws Exception
Throws:
Exception

getObject

public JobService getObject()
                     throws Exception
Create a SimpleJobService from the configuration provided.

Specified by:
getObject in interface FactoryBean<JobService>
Throws:
Exception
See Also:
FactoryBean.getObject()

getObjectType

public Class<? extends JobService> getObjectType()
Tells the containing bean factory what kind of object is the product of getObject().

Specified by:
getObjectType in interface FactoryBean<JobService>
Returns:
SimpleJobService
See Also:
FactoryBean.getObjectType()

isSingleton

public boolean isSingleton()
Allows optimisation in the containing bean factory.

Specified by:
isSingleton in interface FactoryBean<JobService>
Returns:
true
See Also:
FactoryBean.isSingleton()


Copyright © 2011. All Rights Reserved.