Class AnnotatedChildEntity<P,C>
java.lang.Object
org.axonframework.modelling.command.inspection.AnnotatedChildEntity<P,C>
- Type Parameters:
P- the parent entity typeC- the child entity type
- All Implemented Interfaces:
ChildEntity<P>
Implementation of a
ChildEntity that uses annotations on a target entity to resolve event and command
handlers.- Since:
- 3.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedChildEntity(EntityModel<C> entityModel, boolean forwardCommands, BiFunction<CommandMessage<?>, P, C> commandTargetResolver, BiFunction<EventMessage<?>, P, Stream<C>> eventTargetResolver) Initiates a new AnnotatedChildEntity instance that uses the providedentityModelto delegate command and event handling to an annotated child entity. -
Method Summary
Modifier and TypeMethodDescriptionList<MessageHandlingMember<? super P>> Returns the command handlers declared in this entity.voidpublish(EventMessage<?> msg, P declaringInstance) Publish the givenmsgto the appropriate handlers on the givendeclaringInstance.
-
Constructor Details
-
AnnotatedChildEntity
public AnnotatedChildEntity(EntityModel<C> entityModel, boolean forwardCommands, BiFunction<CommandMessage<?>, P, C> commandTargetResolver, BiFunction<EventMessage<?>, P, Stream<C>> eventTargetResolver) Initiates a new AnnotatedChildEntity instance that uses the providedentityModelto delegate command and event handling to an annotated child entity.- Parameters:
entityModel- aEntityModeldescribing the entity.forwardCommands- flag indicating whether commands should be forwarded to the entity.commandTargetResolver- resolver for command handler methods on the target.eventTargetResolver- resolver for event handler methods on the target.
-
-
Method Details
-
publish
Description copied from interface:ChildEntityPublish the givenmsgto the appropriate handlers on the givendeclaringInstance.- Specified by:
publishin interfaceChildEntity<P>- Parameters:
msg- the message to publishdeclaringInstance- the instance of this entity to invoke handlers on
-
commandHandlers
Description copied from interface:ChildEntityReturns the command handlers declared in this entity.- Specified by:
commandHandlersin interfaceChildEntity<P>- Returns:
- a list of
MessageHandlingMembers that are capable of processing command messages
-