| org.springframework.context.ApplicationContext
ApplicationContext | public interface ApplicationContext extends ListableBeanFactory,HierarchicalBeanFactory,MessageSource,ApplicationEventPublisher,ResourcePatternResolver(Code) | | 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:
- Bean factory methods for accessing application components.
Inherited from
org.springframework.beans.factory.ListableBeanFactory .
- The ability to load file resources in a generic fashion.
Inherited from the
org.springframework.core.io.ResourceLoader interface.
- The ability to publish events to registered listeners.
Inherited from the
ApplicationEventPublisher interface.
- The ability to resolve messages, supporting internationalization.
Inherited from the
MessageSource interface.
- Inheritance from a parent context. Definitions in a descendant context
will always take priority. This means, for example, that a single parent
context can be used by an entire web application, while each servlet has
its own child context that is independent of that of any other servlet.
In addition to standard
org.springframework.beans.factory.BeanFactory lifecycle capabilities, ApplicationContext implementations detect and invoke
ApplicationContextAware beans as well as
ResourceLoaderAware ,
ApplicationEventPublisherAware and
MessageSourceAware beans.
author: Rod Johnson author: Juergen Hoeller See Also: ConfigurableApplicationContext See Also: org.springframework.beans.factory.BeanFactory See Also: org.springframework.core.io.ResourceLoader |
Method Summary | |
AutowireCapableBeanFactory | getAutowireCapableBeanFactory() Expose AutowireCapableBeanFactory functionality for this context.
This is not typically used by application code, except for the purpose
of initializing bean instances that live outside the application context,
applying the Spring bean lifecycle (fully or partly) to them.
Alternatively, the internal BeanFactory exposed by the
ConfigurableApplicationContext interface offers access to the
AutowireCapableBeanFactory interface too. | 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. |
getAutowireCapableBeanFactory | AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException(Code) | | Expose AutowireCapableBeanFactory functionality for this context.
This is not typically used by application code, except for the purpose
of initializing bean instances that live outside the application context,
applying the Spring bean lifecycle (fully or partly) to them.
Alternatively, the internal BeanFactory exposed by the
ConfigurableApplicationContext interface offers access to the
AutowireCapableBeanFactory interface too. The present method mainly
serves as convenient, specific facility on the ApplicationContext
interface itself.
the AutowireCapableBeanFactory for this context throws: IllegalStateException - if the context does not supportthe AutowireCapableBeanFactory interface or does not hold an autowire-capablebean factory yet (usually if refresh() has never been called) See Also: ConfigurableApplicationContext.refresh See Also: ConfigurableApplicationContext.getBeanFactory |
getDisplayName | String getDisplayName()(Code) | | Return a friendly name for this context.
a display name for this context |
getParent | ApplicationContext getParent()(Code) | | Return the parent context, or null if there is no parent
and this is the root of the context hierarchy.
the parent context, or null if there is no parent |
getStartupDate | long getStartupDate()(Code) | | Return the timestamp when this context was first loaded.
the timestamp (ms) when this context was first loaded |
|
|