Class ClasspathXmlApplicationContextsFactoryBean
java.lang.Object
org.springframework.batch.core.configuration.support.ClasspathXmlApplicationContextsFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.FactoryBean<ApplicationContextFactory[]>,org.springframework.context.ApplicationContextAware
public class ClasspathXmlApplicationContextsFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<ApplicationContextFactory[]>, org.springframework.context.ApplicationContextAware
A convenient factory for creating a set of
ApplicationContextFactory components
from a set of resources.- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate anApplicationContextFactoryfrom each resource provided insetResources(Resource[]).Class<?>The type of object returned by this factory as an array ofApplicationContextFactory.booleanOptimization hint for bean factory.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) An application context that can be used as a parent context for all the factories.voidsetBeanFactoryPostProcessorClasses(Class<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>[] beanFactoryPostProcessorClasses) Determines which bean factory post processors (such as property placeholders) should be copied from the parent context.voidsetBeanPostProcessorExcludeClasses(Class<?>[] beanPostProcessorExcludeClasses) Determines, by exclusion, which bean post processors should be copied from the parent context.voidsetCopyConfiguration(boolean copyConfiguration) Flag to indicate that configuration, such as bean post processors and custom editors, should be copied from the parent context.voidsetResources(org.springframework.core.io.Resource[] resources) A set of resources to load by using aGenericApplicationContextFactory.
-
Constructor Details
-
ClasspathXmlApplicationContextsFactoryBean
public ClasspathXmlApplicationContextsFactoryBean()
-
-
Method Details
-
setResources
public void setResources(org.springframework.core.io.Resource[] resources) A set of resources to load by using aGenericApplicationContextFactory. Each resource should be a Spring configuration file that is loaded into an application context whose parent is the current context. In a configuration file, the resources can be given as a pattern (for example,classpath*:/config/*-context.xml).- Parameters:
resources- array of resources to use
-
setCopyConfiguration
public void setCopyConfiguration(boolean copyConfiguration) Flag to indicate that configuration, such as bean post processors and custom editors, should be copied from the parent context. Defaults totrue.- Parameters:
copyConfiguration- the flag value to set
-
setBeanFactoryPostProcessorClasses
public void setBeanFactoryPostProcessorClasses(Class<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>[] beanFactoryPostProcessorClasses) Determines which bean factory post processors (such as property placeholders) should be copied from the parent context. Defaults toPropertySourcesPlaceholderConfigurerandCustomEditorConfigurer.- Parameters:
beanFactoryPostProcessorClasses- post processor types to be copied
-
setBeanPostProcessorExcludeClasses
Determines, by exclusion, which bean post processors should be copied from the parent context. Defaults toBeanFactoryAware(so any post processors that have a reference to the parent bean factory are not copied into the child). Note that these classes do not themselves have to beBeanPostProcessorimplementations or sub-interfaces.- Parameters:
beanPostProcessorExcludeClasses- the classes to set
-
getObject
Create anApplicationContextFactoryfrom each resource provided insetResources(Resource[]).- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<ApplicationContextFactory[]>- Returns:
- an array of
ApplicationContextFactory - Throws:
Exception- See Also:
-
FactoryBean.getObject()
-
getObjectType
The type of object returned by this factory as an array ofApplicationContextFactory.- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<ApplicationContextFactory[]>- Returns:
- array of
ApplicationContextFactory - See Also:
-
FactoryBean.getObjectType()
-
isSingleton
public boolean isSingleton()Optimization hint for bean factory.- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<ApplicationContextFactory[]>- Returns:
true- See Also:
-
FactoryBean.isSingleton()
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) An application context that can be used as a parent context for all the factories.- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Parameters:
applicationContext- theApplicationContextto set- See Also:
-
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
-