Class PersistentApplicationEventMulticaster
java.lang.Object
org.springframework.context.event.AbstractApplicationEventMulticaster
org.springframework.modulith.events.support.PersistentApplicationEventMulticaster
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- SmartInitializingSingleton,- ApplicationEventMulticaster,- IncompleteEventPublications
public class PersistentApplicationEventMulticaster
extends AbstractApplicationEventMulticaster
implements IncompleteEventPublications, SmartInitializingSingleton
An 
ApplicationEventMulticaster to register EventPublications in an
 EventPublicationRegistry so that potentially failing transactional event listeners can get re-invoked upon
 application restart or via a schedule.
 
 Republication is handled in afterSingletonsInstantiated() inspecting the EventPublicationRegistry
 for incomplete publications.
- Author:
- Oliver Drotbohm
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescription(package private) static classFirst-class collection to work with transactional event listeners, i.e.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionPersistentApplicationEventMulticaster(Supplier<EventPublicationRegistry> registry, Supplier<Environment> environment) Creates a newPersistentApplicationEventMulticasterfor the givenEventPublicationRegistry.
- 
Method SummaryModifier and TypeMethodDescriptionvoidprotected Collection<ApplicationListener<?>>getApplicationListeners(ApplicationEvent event, ResolvableType eventType) voidmulticastEvent(ApplicationEvent event) voidmulticastEvent(ApplicationEvent event, ResolvableType eventType) voidTriggers the re-submission of events for which incompleteEventPublications are registered.voidTriggers the re-submission of events for which incompleteEventPublications are registered that exceed a certain age regarding their original publication date.Methods inherited from class org.springframework.context.event.AbstractApplicationEventMulticasteraddApplicationListener, addApplicationListenerBean, getApplicationListeners, removeAllListeners, removeApplicationListener, removeApplicationListenerBean, removeApplicationListenerBeans, removeApplicationListeners, setBeanClassLoader, setBeanFactory, supportsEvent, supportsEvent
- 
Field Details- 
REPUBLISH_ON_RESTART- See Also:
 
- 
REPUBLISH_ON_RESTART_LEGACY- See Also:
 
 
- 
- 
Constructor Details- 
PersistentApplicationEventMulticasterpublic PersistentApplicationEventMulticaster(Supplier<EventPublicationRegistry> registry, Supplier<Environment> environment) Creates a newPersistentApplicationEventMulticasterfor the givenEventPublicationRegistry.- Parameters:
- registry- must not be null.
- environment- must not be null.
 
 
- 
- 
Method Details- 
multicastEvent- Specified by:
- multicastEventin interface- ApplicationEventMulticaster
 
- 
multicastEvent- Specified by:
- multicastEventin interface- ApplicationEventMulticaster
 
- 
getApplicationListenersprotected Collection<ApplicationListener<?>> getApplicationListeners(ApplicationEvent event, ResolvableType eventType) - Overrides:
- getApplicationListenersin class- AbstractApplicationEventMulticaster
 
- 
resubmitIncompletePublicationsDescription copied from interface:IncompleteEventPublicationsTriggers the re-submission of events for which incompleteEventPublications are registered. Note, that this will materialize all incomplete event publications.- Specified by:
- resubmitIncompletePublicationsin interface- IncompleteEventPublications
- Parameters:
- filter- a- Predicateto select the event publications for which to resubmit events.
 
- 
resubmitIncompletePublicationsOlderThanDescription copied from interface:IncompleteEventPublicationsTriggers the re-submission of events for which incompleteEventPublications are registered that exceed a certain age regarding their original publication date.- Specified by:
- resubmitIncompletePublicationsOlderThanin interface- IncompleteEventPublications
- Parameters:
- duration- must not be null.
 
- 
afterSingletonsInstantiatedpublic void afterSingletonsInstantiated()- Specified by:
- afterSingletonsInstantiatedin interface- SmartInitializingSingleton
 
 
-