org.springframework.context

## 接口 ApplicationEventPublisher

- 所有已知子接口:
    ApplicationContext, ConfigurableApplicationContext
  所有已知实现类:
    AbstractApplicationContext, AbstractRefreshableApplicationContext, AbstractRefreshableConfigApplicationContext, AbstractXmlApplicationContext, AnnotationConfigApplicationContext, ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, GenericApplicationContext, GenericGroovyApplicationContext, GenericXmlApplicationContext, StaticApplicationContext
  函数接口:
    这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

      @FunctionalInterface
      public interface ApplicationEventPublisher

  Interface that encapsulates event publication functionality. Serves as super-interface for `ApplicationContext`.
  从以下版本开始:
    1.1.1
  作者:
    Juergen Hoeller, Stephane Nicoll
  另请参阅:
    `ApplicationContext`, `ApplicationEventPublisherAware`, `ApplicationEvent`, `EventPublicationInterceptor`

- - ### 方法概要

    所有方法 实例方法 抽象方法 默认方法
    限定符和类型 | 方法和说明
    --- | ---
    `default void` | `publishEvent(ApplicationEvent event)` Notify all matching listeners registered with this application of an application event.
    `void` | `publishEvent(Object event)` Notify all matching listeners registered with this application of an event.

- - ### 方法详细资料

    - #### publishEvent

          default void publishEvent(ApplicationEvent event)

      Notify all matching listeners registered with this application of an application event. Events may be framework events (such as RequestHandledEvent) or application-specific events.
      参数:
        `event` - the event to publish
      另请参阅:
        `org.springframework.web.context.support.RequestHandledEvent`

    - #### publishEvent

          void publishEvent(Object event)

      Notify all matching listeners registered with this application of an event.

      If the specified `event` is not an `ApplicationEvent`, it is wrapped in a `PayloadApplicationEvent`.

      参数:
        `event` - the event to publish
      从以下版本开始:
        4.2
      另请参阅:
        `PayloadApplicationEvent`