相关文章推荐
大气的香槟  ·  如何检测CSS flex ...·  9 月前    · 
刚毅的红金鱼  ·  kernel module ...·  1 年前    · 
高大的荔枝  ·  ErrorMvcAutoConfigurat ...·  1 年前    · 
逃课的橡皮擦  ·  Java枚举类 - 掘金·  1 年前    · 
Package org.springframework.batch.core.repository.support

Class JobRepositoryFactoryBean

java.lang.Object
org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean
org.springframework.batch.core.repository.support.JobRepositoryFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean< JobRepository > , org.springframework.beans.factory.InitializingBean
public class JobRepositoryFactoryBean extends AbstractJobRepositoryFactoryBean implements org.springframework.beans.factory.InitializingBean
A FactoryBean that automates the creation of a SimpleJobRepository using JDBC DAO implementations which persist batch metadata in database. Requires the user to describe what kind of database they are using.
Author:
Ben Hale, Lucas Ward, Dave Syer, Michael Minella, Mahmoud Ben Hassine
Set the Charset to use when serializing/deserializing the execution context.
setClobType (int type)
setConversionService (org.springframework.core.convert.support.ConfigurableConversionService conversionService)
Set the conversion service to use in the job repository.
Sets the database type.
Public setter for the DataSource .
setJdbcOperations (org.springframework.jdbc.core.JdbcOperations jdbcOperations)
Public setter for the JdbcOperations .
* Sets the generator for creating the key used in identifying unique {link JobInstance} objects
setLobHandler (org.springframework.jdbc.support.lob.LobHandler lobHandler)
A special handler for large objects.
setMaxVarCharLength (int maxVarCharLength)
Public setter for the length of long string columns in database.
setMaxVarCharLengthForExitMessage (int maxVarCharLengthForExitMessage)
Public setter for the length of the exit message in both JdbcJobExecutionDao and JdbcStepExecutionDao .
setMaxVarCharLengthForShortContext (int maxVarCharLengthForShortContext)
Public setter for the length of short context string column in database.
A custom implementation of the ExecutionContextSerializer .
Sets the table prefix for all the batch meta-data tables.

Methods inherited from class org.springframework.batch.core.repository.support. AbstractJobRepositoryFactoryBean

getObject , getObjectType , getTransactionManager , isSingleton , setIsolationLevelForCreate , setIsolationLevelForCreateEnum , setTransactionAttributeSource , setTransactionManager , setValidateTransactionState

Methods inherited from class java.lang. Object

clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait

setSerializer

public void setSerializer ( ExecutionContextSerializer serializer)
A custom implementation of the ExecutionContextSerializer . The default, if not injected, is the DefaultExecutionContextSerializer .
Parameters:
serializer - used to serialize/deserialize ExecutionContext
See Also:
  • ExecutionContextSerializer
  • setLobHandler

    public void setLobHandler (org.springframework.jdbc.support.lob.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 . If you want to use separate values for exit message and short context, then use setMaxVarCharLengthForExitMessage(int) and setMaxVarCharLengthForShortContext(int) . 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

    setMaxVarCharLengthForShortContext

    public void setMaxVarCharLengthForShortContext (int maxVarCharLengthForShortContext)
    Public setter for the length of short context string column in database. Do not set this if you haven't modified the schema. 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. Defaults to AbstractJdbcBatchMetadataDao.DEFAULT_SHORT_CONTEXT_LENGTH
    Parameters:
    maxVarCharLengthForShortContext - the short context length to set
    Since:

    setMaxVarCharLengthForExitMessage

    public void setMaxVarCharLengthForExitMessage (int maxVarCharLengthForExitMessage)
    Public setter for the length of the exit message in both JdbcJobExecutionDao and JdbcStepExecutionDao . Do not set this if you haven't modified the schema. 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. Defaults to AbstractJdbcBatchMetadataDao.DEFAULT_EXIT_MESSAGE_LENGTH .
    Parameters:
    maxVarCharLengthForExitMessage - the exitMessageLength to set
    Since:

    setDataSource

    public void setDataSource ( DataSource dataSource)
    Public setter for the DataSource .
    Parameters:
    dataSource - a DataSource

    setJdbcOperations

    public void setJdbcOperations (org.springframework.jdbc.core.JdbcOperations jdbcOperations)
    Public setter for the JdbcOperations . If this property is not set explicitly, a new JdbcTemplate will be created for the configured DataSource by default.
    Parameters:
    jdbcOperations - a JdbcOperations

    setTablePrefix

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

    setJobKeyGenerator

    public void setJobKeyGenerator ( JobKeyGenerator jobKeyGenerator)
    * Sets the generator for creating the key used in identifying unique {link JobInstance} objects
    Parameters:
    jobKeyGenerator - a JobKeyGenerator
    Since:
    public void setCharset (@NonNull Charset charset)
    Set the Charset to use when serializing/deserializing the execution context. Defaults to "UTF-8". Must not be null .
    Parameters:
    charset - to use when serializing/deserializing the execution context.
    Since:
    See Also:
  • JdbcExecutionContextDao.setCharset(Charset)
  • setConversionService

    public void setConversionService (@NonNull org.springframework.core.convert.support.ConfigurableConversionService conversionService)
    Set the conversion service to use in the job repository. 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:
    Specified by:
    afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    Overrides:
    afterPropertiesSet in class AbstractJobRepositoryFactoryBean
    Throws:
    Exception
    createJobInstanceDao in class AbstractJobRepositoryFactoryBean
    Returns:
    fully configured JobInstanceDao implementation.
    Throws:
    Exception - thrown if error occurs creating JobInstanceDao.

    createJobExecutionDao

    protected JobExecutionDao createJobExecutionDao () throws Exception
    Specified by:
    createJobExecutionDao in class AbstractJobRepositoryFactoryBean
    Returns:
    fully configured JobExecutionDao implementation.
    Throws:
    Exception - thrown if error occurs creating JobExecutionDao.

    createStepExecutionDao

    protected StepExecutionDao createStepExecutionDao () throws Exception
    Specified by:
    createStepExecutionDao in class AbstractJobRepositoryFactoryBean
    Returns:
    fully configured StepExecutionDao implementation.
    Throws:
    Exception - thrown if error occurs creating StepExecutionDao.

    createExecutionContextDao

    protected ExecutionContextDao createExecutionContextDao () throws Exception
    Specified by:
    createExecutionContextDao in class AbstractJobRepositoryFactoryBean
    Returns:
    fully configured ExecutionContextDao implementation.
    Throws:
    Exception - thrown if error occurs creating ExecutionContextDao.