Class EventSavingSubscriber
java.lang.Object
com.reallifedeveloper.common.domain.event.EventSavingSubscriber
- All Implemented Interfaces:
DomainEventSubscriber<DomainEvent>
A
DomainEventSubscriber that saves all events in memory.- Author:
- RealLifeDeveloper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all handled events.events()Gives an unmodifiable list of the events that have been handled so far.Class<? extends DomainEvent>Gives the type of domain event to handle.voidhandleEvent(DomainEvent event) Handles the given event.
-
Constructor Details
-
EventSavingSubscriber
public EventSavingSubscriber()
-
-
Method Details
-
handleEvent
Description copied from interface:DomainEventSubscriberHandles the given event.- Specified by:
handleEventin interfaceDomainEventSubscriber<DomainEvent>- Parameters:
event- the domain event to handle
-
eventType
Description copied from interface:DomainEventSubscriberGives the type of domain event to handle.- Specified by:
eventTypein interfaceDomainEventSubscriber<DomainEvent>- Returns:
- the type of domain event to handle
-
events
Gives an unmodifiable list of the events that have been handled so far.- Returns:
- a list of the events that have been handled.
-
clear
public void clear()Removes all handled events.
-