org.springframework.batch.core.configuration.support

## Class GenericApplicationContextFactory

- java.lang.Object
- - org.springframework.batch.core.configuration.support.AbstractApplicationContextFactory
  - - org.springframework.batch.core.configuration.support.GenericApplicationContextFactory

- All Implemented Interfaces:
    ApplicationContextFactory, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
  Direct Known Subclasses:
    ClassPathXmlApplicationContextFactory

      public class GenericApplicationContextFactory
      extends AbstractApplicationContextFactory

  `ApplicationContextFactory` implementation that takes a parent context and a path to the context to create. When createApplicationContext method is called, the child `ApplicationContext` will be returned. The child context is not re-created every time it is requested, it is lazily initialized and cached. Clients should ensure that it is closed when it is no longer needed.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericApplicationContextFactory(java.lang.Object... resources)` Create an application context factory for the resource specified.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected org.springframework.context.ConfigurableApplicationContext` | `createApplicationContext(org.springframework.context.ConfigurableApplicationContext parent, java.lang.Object... resources)`

    - ### Methods inherited from class org.springframework.batch.core.configuration.support.AbstractApplicationContextFactory

      `createApplicationContext, equals, getBeanFactoryPostProcessorClasses, hashCode, isCopyConfiguration, prepareBeanFactory, prepareContext, setApplicationContext, setBeanFactoryPostProcessorClasses, setBeanPostProcessorExcludeClasses, setCopyConfiguration, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### GenericApplicationContextFactory

          public GenericApplicationContextFactory(java.lang.Object... resources)

      Create an application context factory for the resource specified. The resource can be an actual `Resource`, in which case it will be interpreted as an XML file, or it can be a @Configuration class, or a package name. All types must be the same (mixing XML with a java package for example is not allowed and will result in an `IllegalArgumentException`).
      Parameters:
        `resources` - some resources (XML configuration files, @Configuration classes or java packages to scan)

  - ### Method Detail

    - #### createApplicationContext

          protected org.springframework.context.ConfigurableApplicationContext createApplicationContext(org.springframework.context.ConfigurableApplicationContext parent,
                                                                                                        java.lang.Object... resources)

      Specified by:
        `createApplicationContext` in class `AbstractApplicationContextFactory`
      See Also:
        `AbstractApplicationContextFactory.createApplicationContext(ConfigurableApplicationContext, Object...)`