Class AnnotatedChildEntity<P,C>

java.lang.Object
org.axonframework.modelling.command.inspection.AnnotatedChildEntity<P,C>
Type Parameters:
P - the parent entity type
C - the child entity type
All Implemented Interfaces:
ChildEntity<P>

public class AnnotatedChildEntity<P,C> extends Object implements 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

    Constructors
    Constructor
    Description
    AnnotatedChildEntity(EntityModel<C> entityModel, boolean forwardCommands, BiFunction<org.axonframework.commandhandling.CommandMessage<?>,P,C> commandTargetResolver, BiFunction<org.axonframework.eventhandling.EventMessage<?>,P,Stream<C>> eventTargetResolver)
    Initiates a new AnnotatedChildEntity instance that uses the provided entityModel to delegate command and event handling to an annotated child entity.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.axonframework.messaging.annotation.MessageHandlingMember<? super P>>
    Returns the command handlers declared in this entity.
    void
    publish(org.axonframework.eventhandling.EventMessage<?> msg, P declaringInstance)
    Publish the given msg to the appropriate handlers on the given declaringInstance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AnnotatedChildEntity

      public AnnotatedChildEntity(EntityModel<C> entityModel, boolean forwardCommands, BiFunction<org.axonframework.commandhandling.CommandMessage<?>,P,C> commandTargetResolver, BiFunction<org.axonframework.eventhandling.EventMessage<?>,P,Stream<C>> eventTargetResolver)
      Initiates a new AnnotatedChildEntity instance that uses the provided entityModel to delegate command and event handling to an annotated child entity.
      Parameters:
      entityModel - a EntityModel describing 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

      public void publish(org.axonframework.eventhandling.EventMessage<?> msg, P declaringInstance)
      Description copied from interface: ChildEntity
      Publish the given msg to the appropriate handlers on the given declaringInstance.
      Specified by:
      publish in interface ChildEntity<P>
      Parameters:
      msg - the message to publish
      declaringInstance - the instance of this entity to invoke handlers on
    • commandHandlers

      public List<org.axonframework.messaging.annotation.MessageHandlingMember<? super P>> commandHandlers()
      Description copied from interface: ChildEntity
      Returns the command handlers declared in this entity.
      Specified by:
      commandHandlers in interface ChildEntity<P>
      Returns:
      a list of MessageHandlingMembers that are capable of processing command messages