Class DeferredApplicationEventPublisher
- java.lang.Object
-
- io.microsphere.spring.context.event.DeferredApplicationEventPublisher
-
- All Implemented Interfaces:
java.util.EventListener,org.springframework.context.ApplicationEventPublisher,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
@Deprecated public class DeferredApplicationEventPublisher extends java.lang.Object implements org.springframework.context.ApplicationEventPublisher, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>Deprecated.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.- Since:
- 1.0.0
- Author:
- Mercy
-
-
Constructor Summary
Constructors Modifier Constructor Description DeferredApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher delegate)Deprecated.protectedDeferredApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher delegate, boolean shouldDefer)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)Deprecated.voidpublishEvent(java.lang.Object event)Deprecated.Current method will not be invoked before Spring 4.2voidpublishEvent(org.springframework.context.ApplicationEvent event)Deprecated.
-
-
-
Constructor Detail
-
DeferredApplicationEventPublisher
public DeferredApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher delegate)
Deprecated.- Parameters:
delegate-ApplicationEventPublisher
-
DeferredApplicationEventPublisher
protected DeferredApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher delegate, boolean shouldDefer)Deprecated.
-
-
Method Detail
-
publishEvent
public void publishEvent(org.springframework.context.ApplicationEvent event)
Deprecated.- Specified by:
publishEventin interfaceorg.springframework.context.ApplicationEventPublisher
-
publishEvent
public void publishEvent(java.lang.Object event)
Deprecated.Current method will not be invoked before Spring 4.2- Specified by:
publishEventin interfaceorg.springframework.context.ApplicationEventPublisher- Parameters:
event- theApplicationEventor the payload ofevent
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
Deprecated.- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
-