Class AbstractRefreshableApplicationContext

All Implemented Interfaces:
Closeable, AutoCloseable, BeanFactory, HierarchicalBeanFactory, ListableBeanFactory, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, EnvironmentCapable, ResourceLoader, ResourcePatternResolver
Direct Known Subclasses:
AbstractRefreshableConfigApplicationContext

public abstract class AbstractRefreshableApplicationContext extends AbstractApplicationContext
Base class for ApplicationContext implementations which are supposed to support multiple calls to AbstractApplicationContext.refresh(), 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(org.springframework.beans.factory.support.DefaultListableBeanFactory), which gets invoked on each refresh. A concrete implementation is supposed to load bean definitions into the given DefaultListableBeanFactory, typically delegating to one or more specific bean definition readers.

Note that there is a similar base class for WebApplicationContexts. 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; AnnotationConfigApplicationContext supports @Configuration-annotated classes as a source of bean definitions.

Since:
1.1.3
Author:
Juergen Hoeller, Chris Beams
See Also: