Package org.springframework.batch.core.configuration.support

# Class ApplicationContextJobFactory

java.lang.Object
org.springframework.batch.core.configuration.support.ApplicationContextJobFactory

All Implemented Interfaces:
  `JobFactory`

public class ApplicationContextJobFactory extends Object implements JobFactory
A `JobFactory` that creates its own `ApplicationContext` and pulls a bean out when asked to create a `Job`.

Author:
  Dave Syer

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ApplicationContextJobFactory(String jobName, ApplicationContextFactory applicationContextFactory)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final Job`
  `createJob()`
  Create an `ApplicationContext` from the factory provided and pull out a bean with the name given during initialization.
  `String`
  `getJobName()`
  Just return the name of instance passed in on initialization.

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

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

- ## Constructor Details

  - ### ApplicationContextJobFactory

    public ApplicationContextJobFactory(String jobName, ApplicationContextFactory applicationContextFactory)
    Parameters:
      `jobName` - the id of the `Job` in the application context to be created
      `applicationContextFactory` - a factory for an application context containing a job with the job name provided

- ## Method Details

  - ### createJob

    public final Job createJob()
    Create an `ApplicationContext` from the factory provided and pull out a bean with the name given during initialization.
    Specified by:
      `createJob` in interface `JobFactory`
    See Also:
      - `JobFactory.createJob()`

  - ### getJobName

    public String getJobName()
    Just return the name of instance passed in on initialization.
    Specified by:
      `getJobName` in interface `JobFactory`
    See Also:
      - `JobFactory.getJobName()`