Package com.opencqrs.framework.command
Class CommandEventCapturer<I>
java.lang.Object
com.opencqrs.framework.persistence.EventCapturer
com.opencqrs.framework.command.CommandEventCapturer<I>
- Type Parameters:
I- the instance as defined by theCommandHandlerDefinitionbeing executed
- All Implemented Interfaces:
CommandEventPublisher<I>,EventPublisher
Default implementation of
CommandEventPublisher used by CommandRouter to apply events to the
StateRebuildingHandlers relevant for the Command being executed.-
Constructor Summary
ConstructorsConstructorDescriptionCommandEventCapturer(I initialInstance, String subject, List<StateRebuildingHandlerDefinition<I, Object>> stateRebuildingHandlerDefinitions) -
Method Summary
Modifier and TypeMethodDescription<E> IPublishes an event and its meta-data to the subject specified byCommand.getSubject()and applies it to any assignableStateRebuildingHandlers participating in the command execution.<E> IpublishRelative(String subjectSuffix, E event, Map<String, ?> metaData) Publishes an event and its meta-data to the subject specified byCommand.getSubject()appended with the specified suffix and applies it to any assignableStateRebuildingHandlers participating in the command execution.Methods inherited from class com.opencqrs.framework.persistence.EventCapturer
getEvents, publishMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.opencqrs.framework.command.CommandEventPublisher
publish, publishRelativeMethods inherited from interface com.opencqrs.framework.persistence.EventPublisher
publish, publish, publish
-
Constructor Details
-
CommandEventCapturer
-
-
Method Details
-
publish
Description copied from interface:CommandEventPublisherPublishes an event and its meta-data to the subject specified byCommand.getSubject()and applies it to any assignableStateRebuildingHandlers participating in the command execution.- Specified by:
publishin interfaceCommandEventPublisher<I>- Type Parameters:
E- the event type- Parameters:
event- the event to be publishedmetaData- the event meta-data to be published- Returns:
- an updated or new instance with all events applied
-
publishRelative
Description copied from interface:CommandEventPublisherPublishes an event and its meta-data to the subject specified byCommand.getSubject()appended with the specified suffix and applies it to any assignableStateRebuildingHandlers participating in the command execution.- Specified by:
publishRelativein interfaceCommandEventPublisher<I>- Type Parameters:
E- the event type- Parameters:
subjectSuffix- the suffix to be appended to theCommand.getSubject()currently executed, must not start with/event- the event to be publishedmetaData- the event meta-data to be published- Returns:
- an updated or new instance with all events applied
-