Class ForwardMatchingInstances<T extends Message<?>>
java.lang.Object
org.axonframework.modelling.command.ForwardMatchingInstances<T>
- Type Parameters:
T- the implementationTof theMessagebeing filtered.
- All Implemented Interfaces:
ForwardingMode<T>
public class ForwardMatchingInstances<T extends Message<?>>
extends Object
implements ForwardingMode<T>
Only forward messages of type
T if the routing key of the message matches that of the entity. Essentially,
this means that events are only forwarded if the Message mentions the identifier of the entity instance.- Since:
- 3.1
- Author:
- Steven van Beelen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<E> Stream<E> filterCandidates(T message, Stream<E> candidates) voidinitialize(Member member, EntityModel childEntity) Initializes an instance of aForwardingMode.
-
Constructor Details
-
ForwardMatchingInstances
public ForwardMatchingInstances()
-
-
Method Details
-
initialize
Description copied from interface:ForwardingModeInitializes an instance of aForwardingMode.- Specified by:
initializein interfaceForwardingMode<T extends Message<?>>- Parameters:
member- TheMemberto apply a ForwardingMode on. Provided to be able to check for annotations attributes which might assist in the forwarding process.childEntity- AEntityModelconstructed from the givenfield.
-
filterCandidates
Description copied from interface:ForwardingMode- Specified by:
filterCandidatesin interfaceForwardingMode<T extends Message<?>>- Type Parameters:
E- The type of thecandidates- Parameters:
message- The message of typeTto be forwarded.candidates- TheStreamof candidates to filter.- Returns:
- a filtered
Streamofcandidateswhich will handle themessage.
-