Package org.springframework.batch.core.explore.support

# Class JobExplorerFactoryBean

java.lang.Object
org.springframework.batch.core.explore.support.AbstractJobExplorerFactoryBean
org.springframework.batch.core.explore.support.JobExplorerFactoryBean

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

public class JobExplorerFactoryBean extends AbstractJobExplorerFactoryBean implements org.springframework.beans.factory.InitializingBean
A `FactoryBean` that automates the creation of a `SimpleJobExplorer` using JDBC DAO implementations. Requires the user to describe what kind of database they are using.

Since:
  2.0
Author:
  Dave Syer, Mahmoud Ben Hassine

- ## Field Summary

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

  `OBJECT_TYPE_ATTRIBUTE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JobExplorerFactoryBean()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterPropertiesSet()`
  `protected ExecutionContextDao`
  `createExecutionContextDao()`
  `protected JobExecutionDao`
  `createJobExecutionDao()`
  `protected JobInstanceDao`
  `createJobInstanceDao()`
  `protected StepExecutionDao`
  `createStepExecutionDao()`
  `JobExplorer`
  `getObject()`
  `void`
  `setDataSource(DataSource dataSource)`
  Public setter for the `DataSource`.
  `void`
  `setJdbcOperations(org.springframework.jdbc.core.JdbcOperations jdbcOperations)`
  Public setter for the `JdbcOperations`.
  `void`
  `setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler)`
  The lob handler to use when saving `ExecutionContext` instances.
  `void`
  `setSerializer(ExecutionContextSerializer serializer)`
  A custom implementation of the `ExecutionContextSerializer`.
  `void`
  `setTablePrefix(String tablePrefix)`
  Sets the table prefix for all the batch meta-data tables.

  ### Methods inherited from class org.springframework.batch.core.explore.support.AbstractJobExplorerFactoryBean

  `getObjectType, isSingleton`

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

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

- ## Constructor Details

  - ### JobExplorerFactoryBean

    public JobExplorerFactoryBean()

- ## Method Details

  - ### setSerializer

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

  - ### 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 for the batch meta-data tables

  - ### setLobHandler

    public void setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler)
    The lob handler to use when saving `ExecutionContext` instances. Defaults to null which works for most databases.
    Parameters:
      `lobHandler` - Large object handler for saving `ExecutionContext`

  - ### afterPropertiesSet

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

  - ### createExecutionContextDao

    protected ExecutionContextDao createExecutionContextDao() throws Exception
    Specified by:
      `createExecutionContextDao` in class `AbstractJobExplorerFactoryBean`
    Returns:
      fully configured `ExecutionContextDao` implementation.
    Throws:
      `Exception` - thrown if error occurs during ExecutionContextDao creation.

  - ### createJobInstanceDao

    protected JobInstanceDao createJobInstanceDao() throws Exception
    Specified by:
      `createJobInstanceDao` in class `AbstractJobExplorerFactoryBean`
    Returns:
      fully configured `JobInstanceDao` implementation.
    Throws:
      `Exception` - thrown if error occurs during JobInstanceDao creation.

  - ### createJobExecutionDao

    protected JobExecutionDao createJobExecutionDao() throws Exception
    Specified by:
      `createJobExecutionDao` in class `AbstractJobExplorerFactoryBean`
    Returns:
      fully configured `JobExecutionDao` implementation.
    Throws:
      `Exception` - thrown if error occurs during JobExecutionDao creation.

  - ### createStepExecutionDao

    protected StepExecutionDao createStepExecutionDao() throws Exception
    Specified by:
      `createStepExecutionDao` in class `AbstractJobExplorerFactoryBean`
    Returns:
      fully configured `StepExecutionDao` implementation.
    Throws:
      `Exception` - thrown if error occurs during StepExecutionDao creation.

  - ### getObject

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