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 java.lang.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 and Description
    `ApplicationContextJobFactory(java.lang.String jobName, ApplicationContextFactory applicationContextFactory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Job` | `createJob()` Create an `ApplicationContext` from the factory provided and pull out a bean with the name given during initialization.
    `java.lang.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 Detail

    - #### ApplicationContextJobFactory

          public ApplicationContextJobFactory(java.lang.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 Detail

    - #### 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 java.lang.String getJobName()

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