类 DeferredApplicationEventPublisher
- java.lang.Object
-
- io.microsphere.spring.context.event.DeferredApplicationEventPublisher
-
- 所有已实现的接口:
java.util.EventListener,org.springframework.context.ApplicationEventPublisher,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
public class DeferredApplicationEventPublisher extends java.lang.Object implements org.springframework.context.ApplicationEventPublisher, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>Before Spring Framework 4.2,AbstractApplicationContextis an implementation ofApplicationEventPublishercan't handle the earlyeventthat ispublishedbeforeApplicationEventMulticaster's initialization, in this scenario,DeferredApplicationEventPublisheris introduced and used to resolvepublishEvent(ApplicationEvent)too early to publishApplicationEventwhenSpring ApplicationContexts' ApplicationEventMulticasteris not ready. First,DeferredApplicationEventPublisherstores these early events temporarily, and thenre-publishthem onApplication context is ready.In contrast, If current runtime is based on Spring Framework that
supports early application events,DeferredApplicationEventPublisheronly delegates theApplication Contextthat was injected byconstructor.- 从以下版本开始:
- 1.0.0
- 作者:
- Mercy
-
-
构造器概要
构造器 构造器 说明 DeferredApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher delegate)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)voidpublishEvent(java.lang.Object event)Current method will not be invoked before Spring 4.2voidpublishEvent(org.springframework.context.ApplicationEvent event)protected booleansupportsPublishEventMethod()
-
-
-
方法详细资料
-
supportsPublishEventMethod
protected boolean supportsPublishEventMethod()
-
publishEvent
public void publishEvent(org.springframework.context.ApplicationEvent event)
- 指定者:
publishEvent在接口中org.springframework.context.ApplicationEventPublisher
-
publishEvent
public void publishEvent(java.lang.Object event)
Current method will not be invoked before Spring 4.2- 指定者:
publishEvent在接口中org.springframework.context.ApplicationEventPublisher- 参数:
event- theApplicationEventor the payload ofevent
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
- 指定者:
onApplicationEvent在接口中org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
-