Package org.springframework.cloud.task.batch.configuration

# Class TaskBatchExecutionListenerFactoryBean

java.lang.Object
org.springframework.cloud.task.batch.configuration.TaskBatchExecutionListenerFactoryBean

All Implemented Interfaces:
  `org.springframework.beans.factory.FactoryBean<TaskBatchExecutionListener>`

public class TaskBatchExecutionListenerFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<TaskBatchExecutionListener>
`FactoryBean` for a `TaskBatchExecutionListener`. Provides a jdbc based listener if there is a `DataSource` available. Otherwise, builds a listener that uses the map based implementation.

Author:
  Michael Minella

- ## Field Summary

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

  `OBJECT_TYPE_ATTRIBUTE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TaskBatchExecutionListenerFactoryBean(DataSource dataSource, TaskExplorer taskExplorer)`
  Initializes the TaskBatchExecutionListenerFactoryBean and defaults the tablePrefix to `TaskProperties.DEFAULT_TABLE_PREFIX`.
  `TaskBatchExecutionListenerFactoryBean(DataSource dataSource, TaskExplorer taskExplorer, String tablePrefix)`
  Initializes the TaskBatchExecutionListenerFactoryBean.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TaskBatchExecutionListener`
  `getObject()`
  `Class<?>`
  `getObjectType()`
  `boolean`
  `isSingleton()`

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

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

- ## Constructor Details

  - ### TaskBatchExecutionListenerFactoryBean

    public TaskBatchExecutionListenerFactoryBean(DataSource dataSource, TaskExplorer taskExplorer)
    Initializes the TaskBatchExecutionListenerFactoryBean and defaults the tablePrefix to `TaskProperties.DEFAULT_TABLE_PREFIX`.
    Parameters:
      `dataSource` - the dataSource to use for the TaskBatchExecutionListener.
      `taskExplorer` - the taskExplorer to use for the TaskBatchExecutionListener.

  - ### TaskBatchExecutionListenerFactoryBean

    public TaskBatchExecutionListenerFactoryBean(DataSource dataSource, TaskExplorer taskExplorer, String tablePrefix)
    Initializes the TaskBatchExecutionListenerFactoryBean.
    Parameters:
      `dataSource` - the dataSource to use for the TaskBatchExecutionListener.
      `taskExplorer` - the taskExplorer to use for the TaskBatchExecutionListener.
      `tablePrefix` - the prefix for the task tables accessed by the TaskBatchExecutionListener.

- ## Method Details

  - ### getObject

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

  - ### getObjectType

    public Class<?> getObjectType()
    Specified by:
      `getObjectType` in interface `org.springframework.beans.factory.FactoryBean<TaskBatchExecutionListener>`

  - ### isSingleton

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