## 接口的使用
org.springframework.context.ApplicationContext

- 使用ApplicationContext的程序包
  程序包 | 说明
  --- | ---
  org.springframework.context | This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.
  org.springframework.context.annotation | Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.
  org.springframework.context.event | Support classes for application events, like standard context events.
  org.springframework.context.support | Classes supporting the org.springframework.context package, such as abstract base classes for ApplicationContext implementations and a MessageSource implementation.
  org.springframework.scheduling.annotation | Java 5 annotation for asynchronous method execution.
  org.springframework.ui.context.support | Classes supporting the org.springframework.ui.context package.
  org.springframework.validation.beanvalidation | Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator) into a Spring ApplicationContext and in particular with Spring's data binding and validation APIs.

- - ### org.springframework.context中ApplicationContext的使用

    org.springframework.context中ApplicationContext的子接口
    限定符和类型 | 接口和说明
    --- | ---
    `interface` | `ConfigurableApplicationContext` SPI interface to be implemented by most if not all application contexts.

    返回ApplicationContext的org.springframework.context中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `ApplicationContext` | ApplicationContext.`getParent()` Return the parent context, or `null` if there is no parent and this is the root of the context hierarchy.

    参数类型为ApplicationContext的org.springframework.context中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | ApplicationContextAware.`setApplicationContext(ApplicationContext applicationContext)` Set the ApplicationContext that this object runs in.
    `void` | ConfigurableApplicationContext.`setParent(ApplicationContext parent)` Set the parent of this application context.

  - ### org.springframework.context.annotation中ApplicationContext的使用

    实现ApplicationContext的org.springframework.context.annotation中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `AnnotationConfigApplicationContext` Standalone application context, accepting annotated classes as input - in particular `@Configuration`-annotated classes, but also plain `@Component` types and JSR-330 compliant classes using `javax.inject` annotations.

  - ### org.springframework.context.event中ApplicationContext的使用

    返回ApplicationContext的org.springframework.context.event中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `ApplicationContext` | ApplicationContextEvent.`getApplicationContext()` Get the `ApplicationContext` that the event was raised for.

    参数类型为ApplicationContext的org.springframework.context.event中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | EventListenerMethodProcessor.`setApplicationContext(ApplicationContext applicationContext)`

    参数类型为ApplicationContext的org.springframework.context.event中的构造器
    构造器和说明
    `ApplicationContextEvent(ApplicationContext source)` Create a new ContextStartedEvent.
    `ContextClosedEvent(ApplicationContext source)` Creates a new ContextClosedEvent.
    `ContextRefreshedEvent(ApplicationContext source)` Create a new ContextRefreshedEvent.
    `ContextStartedEvent(ApplicationContext source)` Create a new ContextStartedEvent.
    `ContextStoppedEvent(ApplicationContext source)` Create a new ContextStoppedEvent.

  - ### org.springframework.context.support中ApplicationContext的使用

    实现ApplicationContext的org.springframework.context.support中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `AbstractApplicationContext` Abstract implementation of the `ApplicationContext` interface.
    `class` | `AbstractRefreshableApplicationContext` Base class for `ApplicationContext` implementations which are supposed to support multiple calls to `AbstractApplicationContext.refresh()`, creating a new internal bean factory instance every time.
    `class` | `AbstractRefreshableConfigApplicationContext` `AbstractRefreshableApplicationContext` subclass that adds common handling of specified config locations.
    `class` | `AbstractXmlApplicationContext` Convenient base class for `ApplicationContext` implementations, drawing configuration from XML documents containing bean definitions understood by an `XmlBeanDefinitionReader`.
    `class` | `ClassPathXmlApplicationContext` Standalone XML application context, taking the context definition files from the class path, interpreting plain paths as class path resource names that include the package path (e.g.
    `class` | `FileSystemXmlApplicationContext` Standalone XML application context, taking the context definition files from the file system or from URLs, interpreting plain paths as relative file system locations (e.g.
    `class` | `GenericApplicationContext` Generic ApplicationContext implementation that holds a single internal `DefaultListableBeanFactory` instance and does not assume a specific bean definition format.
    `class` | `GenericGroovyApplicationContext` An `ApplicationContext` implementation that extends `GenericApplicationContext` and implements `GroovyObject` such that beans can be retrieved with the dot de-reference syntax instead of using `AbstractApplicationContext.getBean(java.lang.String)`.
    `class` | `GenericXmlApplicationContext` Convenient application context with built-in XML support.
    `class` | `StaticApplicationContext` `ApplicationContext` implementation which supports programmatic registration of beans and messages, rather than reading bean definitions from external configuration sources.

    返回ApplicationContext的org.springframework.context.support中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `ApplicationContext` | ApplicationObjectSupport.`getApplicationContext()` Return the ApplicationContext that this object is associated with.
    `ApplicationContext` | AbstractApplicationContext.`getParent()` Return the parent context, or `null` if there is no parent (that is, this context is the root of the context hierarchy).
    `protected ApplicationContext` | ApplicationObjectSupport.`obtainApplicationContext()` Obtain the ApplicationContext for actual use.

    参数类型为ApplicationContext的org.springframework.context.support中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected void` | ApplicationObjectSupport.`initApplicationContext(ApplicationContext context)` Subclasses can override this for custom initialization behavior.
    `void` | ApplicationObjectSupport.`setApplicationContext(ApplicationContext context)`
    `void` | LiveBeansView.`setApplicationContext(ApplicationContext applicationContext)`
    `void` | AbstractApplicationContext.`setParent(ApplicationContext parent)` Set the parent of this application context.
    `void` | GenericApplicationContext.`setParent(ApplicationContext parent)` Set the parent of this application context, also setting the parent of the internal BeanFactory accordingly.

    参数类型为ApplicationContext的org.springframework.context.support中的构造器
    构造器和说明
    `AbstractApplicationContext(ApplicationContext parent)` Create a new AbstractApplicationContext with the given parent context.
    `AbstractRefreshableApplicationContext(ApplicationContext parent)` Create a new AbstractRefreshableApplicationContext with the given parent context.
    `AbstractRefreshableConfigApplicationContext(ApplicationContext parent)` Create a new AbstractRefreshableConfigApplicationContext with the given parent context.
    `AbstractXmlApplicationContext(ApplicationContext parent)` Create a new AbstractXmlApplicationContext with the given parent context.
    `ClassPathXmlApplicationContext(ApplicationContext parent)` Create a new ClassPathXmlApplicationContext for bean-style configuration.
    `ClassPathXmlApplicationContext(String[] configLocations, ApplicationContext parent)` Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
    `ClassPathXmlApplicationContext(String[] configLocations, boolean refresh, ApplicationContext parent)` Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files.
    `ClassPathXmlApplicationContext(String[] paths, Class<?> clazz, ApplicationContext parent)` Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
    `FileSystemXmlApplicationContext(ApplicationContext parent)` Create a new FileSystemXmlApplicationContext for bean-style configuration.
    `FileSystemXmlApplicationContext(String[] configLocations, ApplicationContext parent)` Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.
    `FileSystemXmlApplicationContext(String[] configLocations, boolean refresh, ApplicationContext parent)` Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files.
    `GenericApplicationContext(ApplicationContext parent)` Create a new GenericApplicationContext with the given parent.
    `GenericApplicationContext(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory, ApplicationContext parent)` Create a new GenericApplicationContext with the given DefaultListableBeanFactory.
    `StaticApplicationContext(ApplicationContext parent)` Create a new StaticApplicationContext with the given parent.

  - ### org.springframework.scheduling.annotation中ApplicationContext的使用

    参数类型为ApplicationContext的org.springframework.scheduling.annotation中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | ScheduledAnnotationBeanPostProcessor.`setApplicationContext(ApplicationContext applicationContext)` Setting an `ApplicationContext` is optional: If set, registered tasks will be activated in the `ContextRefreshedEvent` phase; if not set, it will happen at `ScheduledAnnotationBeanPostProcessor.afterSingletonsInstantiated()` time.

  - ### org.springframework.ui.context.support中ApplicationContext的使用

    参数类型为ApplicationContext的org.springframework.ui.context.support中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static ThemeSource` | UiApplicationContextUtils.`initThemeSource(ApplicationContext context)` Initialize the ThemeSource for the given application context, autodetecting a bean with the name "themeSource".

  - ### org.springframework.validation.beanvalidation中ApplicationContext的使用

    参数类型为ApplicationContext的org.springframework.validation.beanvalidation中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | LocalValidatorFactoryBean.`setApplicationContext(ApplicationContext applicationContext)`