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
ApplicationContextFactory
implementation that takes a parent context and a path
to the context to create. When the createApplicationContext
method is called,
the child ApplicationContext
is 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
ConstructorDescriptionGenericApplicationContextFactory
(Object... resources) Create an application context factory for the specified resource. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.context.ConfigurableApplicationContext
createApplicationContext
(org.springframework.context.ConfigurableApplicationContext parent, 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
-
Constructor Details
-
GenericApplicationContextFactory
Create an application context factory for the specified resource. The resource can be an actualResource
(in which case, it is 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 results in anIllegalArgumentException
).- Parameters:
resources
- some resources (XML configuration files, @Configuration classes, or Java packages to scan)
-
-
Method Details
-
createApplicationContext
protected org.springframework.context.ConfigurableApplicationContext createApplicationContext(org.springframework.context.ConfigurableApplicationContext parent, Object... resources)
-