Save This Page
Home » spring-framework-2.5.4 » org.springframework » context » support » [javadoc | source]
org.springframework.context.support
abstract public class: AbstractRefreshableApplicationContext [javadoc | source]
java.lang.Object
   org.springframework.core.io.DefaultResourceLoader
      org.springframework.context.support.AbstractApplicationContext
         org.springframework.context.support.AbstractRefreshableApplicationContext

All Implemented Interfaces:
    ConfigurableApplicationContext, DisposableBean, ResourceLoader

Direct Known Subclasses:
    FileSystemXmlApplicationContext, ClassPathXmlApplicationContext, AbstractRefreshablePortletApplicationContext, XmlPortletApplicationContext, XmlWebApplicationContext, AbstractRefreshableWebApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractXmlApplicationContext

Base class for org.springframework.context.ApplicationContext implementations which are supposed to support multiple refreshs, creating a new internal bean factory instance every time. Typically (but not necessarily), such a context will be driven by a set of config locations to load bean definitions from.

The only method to be implemented by subclasses is #loadBeanDefinitions , which gets invoked on each refresh. A concrete implementation is supposed to load bean definitions into the given org.springframework.beans.factory.support.DefaultListableBeanFactory , typically delegating to one or more specific bean definition readers.

Note that there is a similar base class for WebApplicationContexts. org.springframework.web.context.support.AbstractRefreshableWebApplicationContext provides the same subclassing strategy, but additionally pre-implements all context functionality for web environments. There is also a pre-defined way to receive config locations for a web context.

Concrete standalone subclasses of this base class, reading in a specific bean definition format, are ClassPathXmlApplicationContext and FileSystemXmlApplicationContext , which both derive from the common AbstractXmlApplicationContext base class.

Fields inherited from org.springframework.context.support.AbstractApplicationContext:
MESSAGE_SOURCE_BEAN_NAME,  APPLICATION_EVENT_MULTICASTER_BEAN_NAME,  logger
Constructor:
 public AbstractRefreshableApplicationContext() 
 public AbstractRefreshableApplicationContext(ApplicationContext parent) 
    Create a new AbstractRefreshableApplicationContext with the given parent context.
    Parameters:
    parent - the parent context
Method from org.springframework.context.support.AbstractRefreshableApplicationContext Summary:
closeBeanFactory,   createBeanFactory,   customizeBeanFactory,   getBeanFactory,   hasBeanFactory,   loadBeanDefinitions,   refreshBeanFactory,   setAllowBeanDefinitionOverriding,   setAllowCircularReferences
Methods from org.springframework.context.support.AbstractApplicationContext:
addApplicationListener,   addBeanFactoryPostProcessor,   addListener,   cancelRefresh,   close,   closeBeanFactory,   containsBean,   containsBeanDefinition,   containsLocalBean,   destroy,   destroyBeans,   doClose,   finishBeanFactoryInitialization,   finishRefresh,   getAliases,   getApplicationListeners,   getAutowireCapableBeanFactory,   getBean,   getBean,   getBean,   getBeanDefinitionCount,   getBeanDefinitionNames,   getBeanFactory,   getBeanFactoryPostProcessors,   getBeanNamesForType,   getBeanNamesForType,   getBeansOfType,   getBeansOfType,   getDisplayName,   getId,   getInternalParentBeanFactory,   getInternalParentMessageSource,   getMessage,   getMessage,   getMessage,   getParent,   getParentBeanFactory,   getResourcePatternResolver,   getResources,   getStartupDate,   getType,   initApplicationEventMulticaster,   initMessageSource,   invokeBeanFactoryPostProcessors,   isActive,   isPrototype,   isRunning,   isSingleton,   isTypeMatch,   obtainFreshBeanFactory,   onClose,   onRefresh,   postProcessBeanFactory,   prepareBeanFactory,   prepareRefresh,   publishEvent,   refresh,   refreshBeanFactory,   registerBeanPostProcessors,   registerListeners,   registerShutdownHook,   setDisplayName,   setId,   setParent,   start,   stop,   toString
Methods from org.springframework.core.io.DefaultResourceLoader:
getClassLoader,   getResource,   getResourceByPath,   setClassLoader
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.context.support.AbstractRefreshableApplicationContext Detail:
 protected final  void closeBeanFactory() 
 protected DefaultListableBeanFactory createBeanFactory() 
 protected  void customizeBeanFactory(DefaultListableBeanFactory beanFactory) 
 public final ConfigurableListableBeanFactory getBeanFactory() 
 protected final boolean hasBeanFactory() 
    Determine whether this context currently holds a bean factory, i.e. has been refreshed at least once and not been closed yet.
 abstract protected  void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException, BeansException
    Load bean definitions into the given bean factory, typically through delegating to one or more bean definition readers.
 protected final  void refreshBeanFactory() throws BeansException 
    This implementation performs an actual refresh of this context's underlying bean factory, shutting down the previous bean factory (if any) and initializing a fresh bean factory for the next phase of the context's lifecycle.
 public  void setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding) 
    Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former. If not, an exception will be thrown. Default is "true".
 public  void setAllowCircularReferences(boolean allowCircularReferences) 
    Set whether to allow circular references between beans - and automatically try to resolve them.

    Default is "true". Turn this off to throw an exception when encountering a circular reference, disallowing them completely.