public class DeferredApplicationEventPublisher extends Object implements org.springframework.context.ApplicationEventPublisher, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
ApplicationEventPublisher to resolve
publishEvent(ApplicationEvent) too early to publish ApplicationEvent
when Spring
ApplicationContexts' ApplicationEventMulticaster is not ready, thus current class will
hold all early events temporary until
Spring ApplicationContext is active,
and then those events will be replayed.| Constructor and Description |
|---|
DeferredApplicationEventPublisher(org.springframework.context.ConfigurableApplicationContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) |
void |
publishEvent(org.springframework.context.ApplicationEvent event) |
public DeferredApplicationEventPublisher(org.springframework.context.ConfigurableApplicationContext context)
public void publishEvent(org.springframework.context.ApplicationEvent event)
publishEvent in interface org.springframework.context.ApplicationEventPublisherpublic void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>Copyright © 2020. All rights reserved.