类 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,AbstractApplicationContext
is an implementation ofApplicationEventPublisher
can't handle the earlyevent
that ispublished
beforeApplicationEventMulticaster
's initialization, in this scenario,DeferredApplicationEventPublisher
is introduced and used to resolvepublishEvent(ApplicationEvent)
too early to publishApplicationEvent
whenSpring ApplicationContexts' ApplicationEventMulticaster
is not ready. First,DeferredApplicationEventPublisher
stores these early events temporarily, and thenre-publish
them onApplication context is ready
.In contrast, If current runtime is based on Spring Framework that
supports early application events
,DeferredApplicationEventPublisher
only delegates theApplication Context
that was injected byconstructor
.- 从以下版本开始:
- 1.0.0
- 作者:
- Mercy
-
-
构造器概要
构造器 构造器 说明 DeferredApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher delegate)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
void
publishEvent(java.lang.Object event)
Current method will not be invoked before Spring 4.2void
publishEvent(org.springframework.context.ApplicationEvent event)
protected boolean
supportsPublishEventMethod()
-
-
-
方法详细资料
-
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
- theApplicationEvent
or the payload ofevent
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
- 指定者:
onApplicationEvent
在接口中org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
-