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

- 使用ApplicationListener的程序包
  程序包 | 说明
  --- | ---
  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.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.context中ApplicationListener的使用

    参数类型为ApplicationListener的org.springframework.context中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | ConfigurableApplicationContext.`addApplicationListener(ApplicationListener<?> listener)` Add a new ApplicationListener that will be notified on context events such as context refresh and context shutdown.

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

    org.springframework.context.event中ApplicationListener的子接口
    限定符和类型 | 接口和说明
    --- | ---
    `interface` | `GenericApplicationListener` Extended variant of the standard `ApplicationListener` interface, exposing further metadata such as the supported event and source type.
    `interface` | `SmartApplicationListener` Extended variant of the standard `ApplicationListener` interface, exposing further metadata such as the supported event and source type.

    实现ApplicationListener的org.springframework.context.event中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `ApplicationListenerMethodAdapter` `GenericApplicationListener` adapter that delegates the processing of an event to an `EventListener` annotated method.
    `class` | `GenericApplicationListenerAdapter` `GenericApplicationListener` adapter that determines supported event types through introspecting the generically declared type of the target listener.
    `class` | `SourceFilteringListener` `ApplicationListener` decorator that filters events from a specified event source, invoking its delegate listener for matching `ApplicationEvent` objects only.

    返回ApplicationListener的org.springframework.context.event中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `ApplicationListener<?>` | DefaultEventListenerFactory.`createApplicationListener(String beanName, Class<?> type, Method method)`
    `ApplicationListener<?>` | EventListenerFactory.`createApplicationListener(String beanName, Class<?> type, Method method)` Create an `ApplicationListener` for the specified method.

    返回变量类型为ApplicationListener的类型的org.springframework.context.event中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected Collection<ApplicationListener<?>>` | AbstractApplicationEventMulticaster.`getApplicationListeners()` Return a Collection containing all ApplicationListeners.
    `protected Collection<ApplicationListener<?>>` | AbstractApplicationEventMulticaster.`getApplicationListeners(ApplicationEvent event, org.springframework.core.ResolvableType eventType)` Return a Collection of ApplicationListeners matching the given event type.

    参数类型为ApplicationListener的org.springframework.context.event中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | AbstractApplicationEventMulticaster.`addApplicationListener(ApplicationListener<?> listener)`
    `void` | ApplicationEventMulticaster.`addApplicationListener(ApplicationListener<?> listener)` Add a listener to be notified of all events.
    `protected void` | SimpleApplicationEventMulticaster.`invokeListener(ApplicationListener<?> listener, ApplicationEvent event)` Invoke the given listener with the given event.
    `void` | AbstractApplicationEventMulticaster.`removeApplicationListener(ApplicationListener<?> listener)`
    `void` | ApplicationEventMulticaster.`removeApplicationListener(ApplicationListener<?> listener)` Remove a listener from the notification list.
    `protected boolean` | AbstractApplicationEventMulticaster.`supportsEvent(ApplicationListener<?> listener, org.springframework.core.ResolvableType eventType, Class<?> sourceType)` Determine whether the given listener supports the given event.

    参数类型为ApplicationListener的org.springframework.context.event中的构造器
    构造器和说明
    `GenericApplicationListenerAdapter(ApplicationListener<?> delegate)` Create a new GenericApplicationListener for the given delegate.
    `SourceFilteringListener(Object source, ApplicationListener<?> delegate)` Create a SourceFilteringListener for the given event source.

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

    返回变量类型为ApplicationListener的类型的org.springframework.context.support中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `Collection<ApplicationListener<?>>` | AbstractApplicationContext.`getApplicationListeners()` IOC 容器的刷新

    参数类型为ApplicationListener的org.springframework.context.support中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | AbstractApplicationContext.`addApplicationListener(ApplicationListener<?> listener)`

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

    实现ApplicationListener的org.springframework.scheduling.annotation中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `ScheduledAnnotationBeanPostProcessor` Bean post-processor that registers methods annotated with @`Scheduled` to be invoked by a `TaskScheduler` according to the "fixedRate", "fixedDelay", or "cron" expression provided via the annotation.