|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.core.configuration.support.AbstractApplicationContextFactory
public abstract class 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. If a path is not set, the parent will always be returned.
| Constructor Summary | |
|---|---|
AbstractApplicationContextFactory(Object resource)
Create a factory instance with the resource specified. |
|
| Method Summary | |
|---|---|
org.springframework.context.ConfigurableApplicationContext |
createApplicationContext()
Creates an ApplicationContext from the provided path. |
protected abstract org.springframework.context.ConfigurableApplicationContext |
createApplicationContext(org.springframework.context.ConfigurableApplicationContext parent,
Object resource)
|
boolean |
equals(Object obj)
|
protected Collection<Class<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>> |
getBeanFactoryPostProcessorClasses()
Protected access to the list of bean factory post processor classes that should be copied over to the context from the parent. |
int |
hashCode()
|
protected boolean |
isCopyConfiguration()
Protected access for subclasses to the flag determining whether configuration should be copied from parent context. |
protected void |
prepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory parent,
org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
Extension point for special subclasses that want to do more complex things with the bean factory prior to refresh. |
protected void |
prepareContext(org.springframework.context.ConfigurableApplicationContext parent,
org.springframework.context.ConfigurableApplicationContext context)
Extension point for special subclasses that want to do more complex things with the context prior to refresh. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Setter for the parent application context. |
void |
setBeanFactoryPostProcessorClasses(Class<? extends org.springframework.beans.factory.config.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. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractApplicationContextFactory(Object resource)
| Method Detail |
|---|
public void setCopyConfiguration(boolean copyConfiguration)
copyConfiguration - the flag value to setprotected final boolean isCopyConfiguration()
public void setBeanFactoryPostProcessorClasses(Class<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>[] beanFactoryPostProcessorClasses)
PropertyPlaceholderConfigurer and CustomEditorConfigurer.
beanFactoryPostProcessorClasses - array of post processor types to be copiedpublic void setBeanPostProcessorExcludeClasses(Class<?>[] beanPostProcessorExcludeClasses)
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.
beanPostProcessorExcludeClasses - the classes to setprotected final Collection<Class<? extends org.springframework.beans.factory.config.BeanFactoryPostProcessor>> getBeanFactoryPostProcessorClasses()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)public org.springframework.context.ConfigurableApplicationContext createApplicationContext()
ApplicationContext from the provided path.
createApplicationContext in interface ApplicationContextFactoryApplicationContextFactory.createApplicationContext()
protected abstract org.springframework.context.ConfigurableApplicationContext createApplicationContext(org.springframework.context.ConfigurableApplicationContext parent,
Object resource)
protected void prepareContext(org.springframework.context.ConfigurableApplicationContext parent,
org.springframework.context.ConfigurableApplicationContext context)
parent - the parent for the new application contextcontext - the new application context before it is refreshed, but after bean factory is initializedsetBeanFactoryPostProcessorClasses(Class[])
protected void prepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory parent,
org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
flag set.
parent - the parent bean factory for the new context (will never be null)beanFactory - the new bean factory before bean definitions are loadedsetCopyConfiguration(boolean),
DefaultListableBeanFactory.copyConfigurationFrom(ConfigurableBeanFactory)public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||