Class AggregateMemberAnnotatedChildEntityDefinition

java.lang.Object
org.axonframework.modelling.command.inspection.AbstractChildEntityDefinition
org.axonframework.modelling.command.inspection.AggregateMemberAnnotatedChildEntityDefinition
All Implemented Interfaces:
ChildEntityDefinition

public class AggregateMemberAnnotatedChildEntityDefinition extends AbstractChildEntityDefinition
Implementation of a ChildEntityDefinition that is used to detect single entities annotated with AggregateMember. If such a field or method is found a ChildEntity is created that delegates to the entity.
Since:
3.0
Author:
Allard Buijze
  • Constructor Details

    • AggregateMemberAnnotatedChildEntityDefinition

      public AggregateMemberAnnotatedChildEntityDefinition()
  • Method Details

    • isMemberTypeSupported

      protected boolean isMemberTypeSupported(Member member)
      Description copied from class: AbstractChildEntityDefinition
      Check whether the given Member is of a type supported by this definition.
      Specified by:
      isMemberTypeSupported in class AbstractChildEntityDefinition
      Parameters:
      member - a Member containing or returning a Child Entity
      Returns:
      true if the type is as required by the implementation and false if it is not
    • extractChildEntityModel

      protected <T> EntityModel<Object> extractChildEntityModel(EntityModel<T> declaringEntity, Map<String,Object> attributes, Member member)
      Description copied from class: AbstractChildEntityDefinition
      Extracts the Child Entity contained in the given declaringEntity as an EntityModel. The type of the Child Entity is defined through a key in the provided attributes or based on given Field.
      Specified by:
      extractChildEntityModel in class AbstractChildEntityDefinition
      Type Parameters:
      T - the type T of the given declaringEntity EntityModel
      Parameters:
      declaringEntity - the EntityModel declaring the given field
      attributes - a Map containing the AggregateMember attributes
      member - the Member containing the Child Entity.
      Returns:
      the Child Entity contained in the declaringEntity
    • resolveCommandTarget

      protected <T> Object resolveCommandTarget(org.axonframework.commandhandling.CommandMessage<?> msg, T parent, Member member, EntityModel<Object> childEntityModel)
      Description copied from class: AbstractChildEntityDefinition
      Resolve the target of an incoming CommandMessage to the right Child Entity. Returns the Child Entity the msg needs to be routed to.
      Specified by:
      resolveCommandTarget in class AbstractChildEntityDefinition
      Type Parameters:
      T - the type T of the given parent Entity
      Parameters:
      msg - the CommandMessage which is being resolved to a target entity
      parent - the parent Entity of type T of this Child Entity
      member - the Member containing the Child Entity.
      childEntityModel - the EntityModel for the Child Entity
      Returns:
      the Child Entity which is the target of the incoming CommandMessage.
    • resolveEventTargets

      protected <T> Stream<Object> resolveEventTargets(org.axonframework.eventhandling.EventMessage message, T parentEntity, Member member, ForwardingMode eventForwardingMode)
      Description copied from class: AbstractChildEntityDefinition
      Resolve the targets of an incoming EventMessage to the right Child Entities. Returns a Stream of all the Child Entities the Event Message should be routed to.
      Specified by:
      resolveEventTargets in class AbstractChildEntityDefinition
      Type Parameters:
      T - the type T of the given parent Entity
      Parameters:
      message - the EventMessage to route
      parentEntity - the parent Entity of type T of this Child Entity
      member - the Member containing the Child Entity
      eventForwardingMode - the ForwardingMode used to filter the message to route based on the ForwardingMode implementation
      Returns:
      a filtered Stream of Child Entity targets for the incoming EventMessage