org.springframework.context
Interface ApplicationContext

All Superinterfaces:
ApplicationEventPublisher, BeanFactory, HierarchicalBeanFactory, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver
All Known Subinterfaces:
ConfigurableApplicationContext, ConfigurableWebApplicationContext, WebApplicationContext
All Known Implementing Classes:
AbstractApplicationContext, AbstractRefreshableApplicationContext, AbstractRefreshableWebApplicationContext, AbstractXmlApplicationContext, ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, GenericApplicationContext, GenericWebApplicationContext, StaticApplicationContext, StaticWebApplicationContext, XmlWebApplicationContext

public interface ApplicationContext
extends ListableBeanFactory, HierarchicalBeanFactory, MessageSource, ApplicationEventPublisher, ResourcePatternResolver

Central interface to provide configuration for an application. This is read-only while the application is running, but may be reloaded if the implementation supports this.

An ApplicationContext provides:

In addition to standard bean factory lifecycle capabilities, ApplicationContext implementations need to detect ApplicationContextAware beans and invoke the setApplicationContext method accordingly.

Author:
Rod Johnson, Juergen Hoeller
See Also:
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

Field Summary
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX, CLASSPATH_URL_PREFIX
 
Method Summary
 String getDisplayName()
          Return a friendly name for this context.
 ApplicationContext getParent()
          Return the parent context, or null if there is no parent, and this is the root of the context hierarchy.
 long getStartupDate()
          Return the timestamp when this context was first loaded.
 void publishEvent(ApplicationEvent event)
          Notify all listeners registered with this application of an application event.
 
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType
 
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getType, isSingleton
 
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
 
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getType, isSingleton
 
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
 
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
 
Methods inherited from interface org.springframework.core.io.ResourceLoader
getResource
 

Method Detail

getParent

ApplicationContext getParent()
Return the parent context, or null if there is no parent, and this is the root of the context hierarchy.

Returns:
the parent context, or null if there is no parent

getDisplayName

String getDisplayName()
Return a friendly name for this context.

Returns:
a display name for this context

getStartupDate

long getStartupDate()
Return the timestamp when this context was first loaded.

Returns:
the timestamp (ms) when this context was first loaded

publishEvent

void publishEvent(ApplicationEvent event)
Notify all listeners registered with this application of an application event. Events may be framework events (such as RequestHandledEvent) or application-specific events.

Specified by:
publishEvent in interface ApplicationEventPublisher
Parameters:
event - event to publish
See Also:
RequestHandledEvent


Copyright (c) 2002-2006 The Spring Framework Project.