| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Partial implementation of ApplicationContext. Doesn't mandate the type of storage used for configuration, but implements common functionality.
This class uses the Template Method design pattern, requiring concrete subclasses to implement protected abstract methods.
A message source may be supplied as a bean in the default bean factory, with the name "messageSource". Else, message resolution is delegated to the parent context.
| Field Summary | |
final static String | MESSAGE_SOURCE_BEAN_NAMEName of the MessageSource bean in the factory. |
| Constructor Summary | |
AbstractApplicationContext()Create a new AbstractApplicationContext with no parent. | |
AbstractApplicationContext(ApplicationContext parent)Create a new AbstractApplicationContext with the given parent context. | |
| Method Summary | |
void | close()Destroy the singletons in the bean factory of this application context. |
boolean | containsBean(String name) |
boolean | containsBeanDefinition(String name) |
String[] | getAliases(String name) |
Object | getBean(String name) |
Object | getBean(String name, Class requiredType) |
int | getBeanDefinitionCount() |
String[] | getBeanDefinitionNames() |
String[] | getBeanDefinitionNames(Class type) |
abstract ConfigurableListableBeanFactory | getBeanFactory()Subclasses must return their internal bean factory here. |
Map | getBeansOfType(Class type, boolean includePrototypes, boolean includeFactoryBeans) |
String | getDisplayName()Return a friendly name for context |
String | getMessage(String code, Object[] args, String defaultMessage, Locale locale) |
String | getMessage(String code, Object[] args, Locale locale) |
String | getMessage(MessageSourceResolvable resolvable, Locale locale) |
ApplicationContext | getParent()Return the parent context, or null if there is no parent, and this is the root of the context hierarchy. |
BeanFactory | getParentBeanFactory() |
Resource | getResource(String location)This implementation supports fully qualified URLs, including the "classpath:" pseudo-URL, and context-specific file paths via getResourceByPath. |
long | getStartupDate()Return the timestamp when this context was first loaded |
boolean | isSingleton(String name) |
void | publishEvent(ApplicationEvent event)Publish the given event to all listeners. |
void | refresh()Load or reload configuration. |
void | setParent(ApplicationContext parent) |
String | toString()Show information about this context |
| Field Detail |
public final static String MESSAGE_SOURCE_BEAN_NAME
| Constructor Detail |
public AbstractApplicationContext()
public AbstractApplicationContext(ApplicationContext parent)
| Method Detail |
public void close()
public boolean containsBean(String name)
public boolean containsBeanDefinition(String name)
public String[] getAliases(String name)
throws org.springframework.beans.factory.NoSuchBeanDefinitionException
public Object getBean(String name)
throws org.springframework.beans.BeansException
public Object getBean(String name, Class requiredType)
throws org.springframework.beans.BeansException
public int getBeanDefinitionCount()
public String[] getBeanDefinitionNames()
public String[] getBeanDefinitionNames(Class type)
public abstract ConfigurableListableBeanFactory getBeanFactory()
public Map getBeansOfType(Class type, boolean includePrototypes, boolean includeFactoryBeans)
throws org.springframework.beans.BeansException
public String getDisplayName()
public String getMessage(String code, Object[] args, String defaultMessage, Locale locale)
public String getMessage(String code, Object[] args, Locale locale)
throws org.springframework.context.NoSuchMessageException
public String getMessage(MessageSourceResolvable resolvable, Locale locale)
throws org.springframework.context.NoSuchMessageException
public ApplicationContext getParent()
public BeanFactory getParentBeanFactory()
public Resource getResource(String location)
public long getStartupDate()
public boolean isSingleton(String name)
throws org.springframework.beans.factory.NoSuchBeanDefinitionException
public void publishEvent(ApplicationEvent event)
Note: Listeners get initialized after the message source, to be able to access it within listener implementations. Thus, message source implementation cannot publish events.
public void refresh()
throws org.springframework.beans.BeansException
public void setParent(ApplicationContext parent)
public String toString()
| Association Links |
to Class org.springframework.context.ApplicationContext
to Class java.lang.String
to Class org.springframework.context.MessageSource
to Class org.springframework.context.event.ApplicationEventMulticaster
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||