An ApplicationContext provides:
org.springframework.beans.factory.ListableBeanFactory .
org.springframework.core.io.ResourceLoader interface.
ApplicationEventPublisher interface.
MessageSource interface.
In addition to standard org.
lifecycle capabilities, ApplicationContext implementations detect and invoke
ApplicationContextAware beans as well as ResourceLoaderAware,
ApplicationEventPublisherAware and MessageSourceAware beans.
ConfigurableApplicationContext, org.springframework.beans.factory.BeanFactory , org.springframework.core.io.ResourceLoader
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: a name for the deployed application, or the empty String by defaultReturn a name for the deployed application that this context belongs to. |
| public AutowireCapableBeanFactory | Returns: the AutowireCapableBeanFactory for this contextExpose AutowireCapableBeanFactory functionality for this context. |
| public String | Returns: a display name for this context (nevernull)Return a friendly name for this context. |
| public String | Returns: the unique id of the context, ornull if noneReturn the unique id of this application context. |
| public ApplicationContext | Returns: the parent context, ornull if there is no parentReturn the parent context, or |
| public long | Returns: the timestamp (ms) when this context was first loadedReturn the timestamp when this context was first loaded. |
| getApplicationName | back to summary |
|---|---|
| public String getApplicationName() Return a name for the deployed application that this context belongs to.
| |
| getAutowireCapableBeanFactory | back to summary |
|---|---|
| public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException 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
NOTE: As of 4.2, this method will consistently throw IllegalStateException after the application context has been closed. In current Spring Framework versions, only refreshable application contexts behave that way; as of 4.2, all application context implementations will be required to comply.
| |
| getDisplayName | back to summary |
|---|---|
| public String getDisplayName() Return a friendly name for this context.
| |
| getId | back to summary |
|---|---|
| public String getId() Return the unique id of this application context. | |
| getParent | back to summary |
|---|---|
| public ApplicationContext getParent() Return the parent context, or
| |
| getStartupDate | back to summary |
|---|---|
| public long getStartupDate() Return the timestamp when this context was first loaded.
| |