org.springframework.context
Interface ConfigurableApplicationContext

All Known Subinterfaces:
ConfigurableWebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext

public interface ConfigurableApplicationContext
extends ApplicationContext

SPI interface to be implemented by most if not all application contexts. Provides means to configure an application context in addition to the application context client methods in the ApplicationContext interface.

Configuration and lifecycle methods are encapsulated here to avoid making them obvious to ApplicationContext client code.

Author:
Juergen Hoeller
Since: 03.11.2003

Method Summary
 voidclose()
          Close this application context, releasing all resources and locks that the implementation might hold.
 ConfigurableListableBeanFactorygetBeanFactory()
          Return the internal bean factory of this application context.
 voidrefresh()
          Load or refresh the persistent representation of the configuration, which might an XML file, properties file, or relational database schema.
 voidsetParent(ApplicationContext parent)
          Set the parent of this application context.

Methods inherited from interface org.springframework.context.ApplicationContext
getDisplayName, getParent, getResource, getStartupDate, publishEvent

Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
getParentBeanFactory

Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, isSingleton

Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeansOfType

Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage

Method Detail

close

public void close()
throws ApplicationContextException
Close this application context, releasing all resources and locks that the implementation might hold. This includes disposing all cached singleton beans.

Note: Does not invoke close on a parent context.

Throws:
org.springframework.context.ApplicationContextException - if there were fatal errors

getBeanFactory

public ConfigurableListableBeanFactory getBeanFactory()
Return the internal bean factory of this application context. Can be used to access specific functionality of the factory.

refresh

public void refresh()
throws org.springframework.beans.BeansException
Load or refresh the persistent representation of the configuration, which might an XML file, properties file, or relational database schema.
Throws:
org.springframework.context.ApplicationContextException - if the config cannot be loaded
org.springframework.beans.BeansException - if the bean factory could not be initialized

setParent

public void setParent(ApplicationContext parent)
Set the parent of this application context.

Note that the parent shouldn't be changed: It should only be set outside a constructor if it isn't available when an object of this class is created, for example in case of WebApplicationContext setup.

Parameters:
parent - the parent context
See Also:
ConfigurableWebApplicationContext