Class ProcessorEventHandlingComponents
java.lang.Object
org.axonframework.messaging.eventhandling.processing.ProcessorEventHandlingComponents
Internal class for managing multiple
EventHandlingComponent instances and processing event messages through
them. Each event handling component is wrapped in a SequencingEventHandlingComponent to ensure proper
sequencing where required.
Key responsibilities include:
- Distributing event messages to the associated
EventHandlingComponentinstances. - Ensuring event handling sequencing policies are respected when applicable.
- Determining support for specific event types across the managed components.
- Since:
- 5.0.0
- Author:
- Mateusz Nowak
-
Constructor Summary
ConstructorsConstructorDescriptionProcessorEventHandlingComponents(List<EventHandlingComponent> components) Constructs aProcessorEventHandlingComponentsinstance by wrapping the provided list ofEventHandlingComponents in SequencingEventHandlingComponent instances for sequential event handling where needed. -
Method Summary
Modifier and TypeMethodDescriptionhandle(List<? extends EventMessage> events, ProcessingContext context) Processes a batch of events in the processing context.sequenceIdentifiersFor(EventMessage event, ProcessingContext context) Retrieves a set of sequence identifiers for the given event message and processing context.Retrieves a set of all event names supported by the components comprising this ProcessorEventHandlingComponents instance.booleansupports(QualifiedName eventName) Checks if the specified event name is supported by any of the components.
-
Constructor Details
-
ProcessorEventHandlingComponents
Constructs aProcessorEventHandlingComponentsinstance by wrapping the provided list ofEventHandlingComponents in SequencingEventHandlingComponent instances for sequential event handling where needed.- Parameters:
components- The list ofEventHandlingComponents to be used for event processing. Must not be null and is transformed into a list ofSequencingEventHandlingComponents if necessary.
-
-
Method Details
-
handle
@Nonnull public MessageStream.Empty<Message> handle(@Nonnull List<? extends EventMessage> events, @Nonnull ProcessingContext context) Processes a batch of events in the processing context.The result of handling is an
empty stream. It's guaranteed that the events with samesequenceIdentifiersFor(EventMessage, ProcessingContext)value are processed by a single component in the order they are received, but the sequencing of event processing is not preserved between different event handling components. This is intentional, as they may have different sequencing policies.- Parameters:
events- The batch of event messages to be processed.context- The processing context in which the event messages are processed.- Returns:
- A stream of messages resulting from the processing of the event messages.
-
supportedEvents
Retrieves a set of all event names supported by the components comprising this ProcessorEventHandlingComponents instance. Each event is referenced through a QualifiedName.- Returns:
- A set of QualifiedName objects representing the supported events.
-
supports
Checks if the specified event name is supported by any of the components.- Parameters:
eventName- The qualified name of the event to be checked. Must not be null.- Returns:
- true if the event name is supported, false otherwise.
-
sequenceIdentifiersFor
public Set<Object> sequenceIdentifiersFor(@Nonnull EventMessage event, @Nonnull ProcessingContext context) Retrieves a set of sequence identifiers for the given event message and processing context. Each identifier represents a sequence property determined by the components within this instance.- Parameters:
event- The event message for which the sequence identifiers are to be determined. Must not be null.context- The processing context in which the sequence identifiers are evaluated. Must not be null.- Returns:
- A set of sequence identifiers associated with the given event and context.
-