Package org.springframework.batch.core.repository.support

# Class AbstractJobRepositoryFactoryBean

java.lang.Object
org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean

All Implemented Interfaces:
  `org.springframework.beans.factory.FactoryBean<JobRepository>`, `org.springframework.beans.factory.InitializingBean`

Direct Known Subclasses:
  `JobRepositoryFactoryBean`

public abstract class AbstractJobRepositoryFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<JobRepository>, org.springframework.beans.factory.InitializingBean
A `FactoryBean` that automates the creation of a `SimpleJobRepository`. Declares abstract methods for providing DAO object implementations.

Author:
  Ben Hale, Lucas Ward, Robert Kasanicky, Mahmoud Ben Hassine
See Also:
  - `JobRepositoryFactoryBean`

- ## Field Summary

  ### Fields inherited from interface org.springframework.beans.factory.FactoryBean

  `OBJECT_TYPE_ATTRIBUTE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractJobRepositoryFactoryBean()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterPropertiesSet()`
  `protected abstract ExecutionContextDao`
  `createExecutionContextDao()`
  `protected abstract JobExecutionDao`
  `createJobExecutionDao()`
  `protected abstract JobInstanceDao`
  `createJobInstanceDao()`
  `protected abstract StepExecutionDao`
  `createStepExecutionDao()`
  `JobRepository`
  `getObject()`
  `Class<JobRepository>`
  `getObjectType()`
  The type of object to be returned from `getObject()`.
  `org.springframework.transaction.PlatformTransactionManager`
  `getTransactionManager()`
  The transaction manager used in this factory.
  `boolean`
  `isSingleton()`
  `void`
  `setIsolationLevelForCreate(String isolationLevelForCreate)`
  public setter for the isolation level to be used for the transaction when job execution entities are initially created.
  `void`
  `setIsolationLevelForCreate(org.springframework.transaction.annotation.Isolation isolationLevelForCreate)`
  public setter for the isolation level to be used for the transaction when job execution entities are initially created.
  `void`
  `setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)`
  Public setter for the `PlatformTransactionManager`.
  `void`
  `setValidateTransactionState(boolean validateTransactionState)`
  Flag to determine whether to check for an existing transaction when a JobExecution is created.

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### AbstractJobRepositoryFactoryBean

    public AbstractJobRepositoryFactoryBean()

- ## Method Details

  - ### createJobInstanceDao

    protected abstract JobInstanceDao createJobInstanceDao() throws Exception
    Returns:
      fully configured `JobInstanceDao` implementation.
    Throws:
      `Exception` - thrown if error occurs creating JobInstanceDao.

  - ### createJobExecutionDao

    protected abstract JobExecutionDao createJobExecutionDao() throws Exception
    Returns:
      fully configured `JobExecutionDao` implementation.
    Throws:
      `Exception` - thrown if error occurs creating JobExecutionDao.

  - ### createStepExecutionDao

    protected abstract StepExecutionDao createStepExecutionDao() throws Exception
    Returns:
      fully configured `StepExecutionDao` implementation.
    Throws:
      `Exception` - thrown if error occurs creating StepExecutionDao.

  - ### createExecutionContextDao

    protected abstract ExecutionContextDao createExecutionContextDao() throws Exception
    Returns:
      fully configured `ExecutionContextDao` implementation.
    Throws:
      `Exception` - thrown if error occurs creating ExecutionContextDao.

  - ### getObjectType

    public Class<JobRepository> getObjectType()
    The type of object to be returned from `getObject()`.
    Specified by:
      `getObjectType` in interface `org.springframework.beans.factory.FactoryBean<JobRepository>`
    Returns:
      JobRepository.class
    See Also:
      - `FactoryBean.getObjectType()`

  - ### isSingleton

    public boolean isSingleton()
    Specified by:
      `isSingleton` in interface `org.springframework.beans.factory.FactoryBean<JobRepository>`

  - ### setValidateTransactionState

    public void setValidateTransactionState(boolean validateTransactionState)
    Flag to determine whether to check for an existing transaction when a JobExecution is created. Defaults to true because it is usually a mistake, and leads to problems with restartability and also to deadlocks in multi-threaded steps.
    Parameters:
      `validateTransactionState` - the flag to set

  - ### setIsolationLevelForCreate

    public void setIsolationLevelForCreate(String isolationLevelForCreate)
    public setter for the isolation level to be used for the transaction when job execution entities are initially created. The default is ISOLATION_SERIALIZABLE, which prevents accidental concurrent execution of the same job (ISOLATION_REPEATABLE_READ would work as well).
    Parameters:
      `isolationLevelForCreate` - the isolation level name to set
    See Also:
      - `SimpleJobRepository.createJobExecution(String, org.springframework.batch.core.JobParameters)`

  - ### setIsolationLevelForCreate

    public void setIsolationLevelForCreate(org.springframework.transaction.annotation.Isolation isolationLevelForCreate)
    public setter for the isolation level to be used for the transaction when job execution entities are initially created. The default is ISOLATION_SERIALIZABLE, which prevents accidental concurrent execution of the same job (ISOLATION_REPEATABLE_READ would work as well).
    Parameters:
      `isolationLevelForCreate` - the isolation level to set
    See Also:
      - `SimpleJobRepository.createJobExecution(String, org.springframework.batch.core.JobParameters)`

  - ### setTransactionManager

    public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
    Public setter for the `PlatformTransactionManager`.
    Parameters:
      `transactionManager` - the transactionManager to set

  - ### getTransactionManager

    public org.springframework.transaction.PlatformTransactionManager getTransactionManager()
    The transaction manager used in this factory. Useful to inject into steps and jobs, to ensure that they are using the same instance.
    Returns:
      the transactionManager

  - ### afterPropertiesSet

    public void afterPropertiesSet() throws Exception
    Specified by:
      `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
    Throws:
      `Exception`

  - ### getObject

    public JobRepository getObject() throws Exception
    Specified by:
      `getObject` in interface `org.springframework.beans.factory.FactoryBean<JobRepository>`
    Throws:
      `Exception`