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,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
.- Since:
- 1.0.0
- Author:
- Mercy
-
-
Constructor Summary
Constructors Modifier Constructor Description DeferredApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher delegate)
Deprecated.protected
DeferredApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher delegate, boolean shouldDefer)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
Deprecated.void
publishEvent(java.lang.Object event)
Deprecated.Current method will not be invoked before Spring 4.2void
publishEvent(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:
publishEvent
in 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:
publishEvent
in interfaceorg.springframework.context.ApplicationEventPublisher
- Parameters:
event
- theApplicationEvent
or the payload ofevent
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
Deprecated.- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
-