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 TypeMethodDescriptionvoid
clear()
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.void
handleEvent
(DomainEvent event) Handles the given event.
-
Constructor Details
-
EventSavingSubscriber
public EventSavingSubscriber()
-
-
Method Details
-
handleEvent
Description copied from interface:DomainEventSubscriber
Handles the given event.- Specified by:
handleEvent
in interfaceDomainEventSubscriber<DomainEvent>
- Parameters:
event
- the domain event to handle
-
eventType
Description copied from interface:DomainEventSubscriber
Gives the type of domain event to handle.- Specified by:
eventType
in 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.
-