org.springframework.batch.core.configuration.support
Class ClasspathXmlApplicationContextsFactoryBean

java.lang.Object
  extended by org.springframework.batch.core.configuration.support.ClasspathXmlApplicationContextsFactoryBean
All Implemented Interfaces:
FactoryBean, ApplicationContextAware

public class ClasspathXmlApplicationContextsFactoryBean
extends Object
implements FactoryBean, ApplicationContextAware

A convenient factory for creating a set of ApplicationContextFactory components from a set of resources.

Author:
Dave Syer

Constructor Summary
ClasspathXmlApplicationContextsFactoryBean()
           
 
Method Summary
 Object getObject()
          Create an ApplicationContextFactory from each resource provided in setResources(Resource[]).
 Class<?> getObjectType()
          The type of object returned by this factory - an array of ApplicationContextFactory.
 boolean isSingleton()
          Optimization hint for bean factory.
 void setApplicationContext(ApplicationContext applicationContext)
          An application context that can be used as a parent context for all the factories.
 void setBeanFactoryPostProcessorClasses(Class<? extends BeanFactoryPostProcessor>[] beanFactoryPostProcessorClasses)
          Determines which bean factory post processors (like property placeholders) should be copied from the parent context.
 void setBeanPostProcessorExcludeClasses(Class<?>[] beanPostProcessorExcludeClasses)
          Determines by exclusion which bean post processors should be copied from the parent context.
 void setCopyConfiguration(boolean copyConfiguration)
          Flag to indicate that configuration such as bean post processors and custom editors should be copied from the parent context.
 void setResources(Resource[] resources)
          A set of resources to load using a ClassPathXmlApplicationContextFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClasspathXmlApplicationContextsFactoryBean

public ClasspathXmlApplicationContextsFactoryBean()
Method Detail

setResources

public void setResources(Resource[] resources)
A set of resources to load using a ClassPathXmlApplicationContextFactory. Each resource should be a Spring configuration file which is loaded into an application context whose parent is the current context. In a configuration file the resources can be given as a pattern (e.g. classpath*:/config/*-context.xml).

Parameters:
resources -

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 to true.

Parameters:
copyConfiguration - the flag value to set

setBeanFactoryPostProcessorClasses

public void setBeanFactoryPostProcessorClasses(Class<? extends BeanFactoryPostProcessor>[] beanFactoryPostProcessorClasses)
Determines which bean factory post processors (like property placeholders) should be copied from the parent context. Defaults to PropertyPlaceholderConfigurer and CustomEditorConfigurer.

Parameters:
copyBeanFactoryPostProcessors - the flag value to set

setBeanPostProcessorExcludeClasses

public void setBeanPostProcessorExcludeClasses(Class<?>[] beanPostProcessorExcludeClasses)
Determines by exclusion which bean post processors should be copied from the parent context. Defaults to BeanFactoryAware (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 be BeanPostProcessor implementations or sub-interfaces.

Parameters:
beanPostProcessorExcludeClasses - the classes to set

getObject

public Object getObject()
                 throws Exception
Create an ApplicationContextFactory from each resource provided in setResources(Resource[]).

Specified by:
getObject in interface FactoryBean
Returns:
an array of ApplicationContextFactory
Throws:
Exception
See Also:
FactoryBean.getObject()

getObjectType

public Class<?> getObjectType()
The type of object returned by this factory - an array of ApplicationContextFactory.

Specified by:
getObjectType in interface FactoryBean
Returns:
array of ApplicationContextFactory
See Also:
FactoryBean.getObjectType()

isSingleton

public boolean isSingleton()
Optimization hint for bean factory.

Specified by:
isSingleton in interface FactoryBean
Returns:
true
See Also:
FactoryBean.isSingleton()

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
An application context that can be used as a parent context for all the factories.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - the ApplicationContext to set
Throws:
BeansException
See Also:
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)


Copyright © 2013 SpringSource. All Rights Reserved.