public class AggregateMemberAnnotatedChildEntityCollectionDefinition extends AbstractChildEntityDefinition
AbstractChildEntityDefinition that is used to detect Collections of entities (member type
assignable to Iterable) annotated with AggregateMember. If such a field or method is found a ChildEntity is created that delegates to the entities in the annotated collection.| Constructor and Description |
|---|
AggregateMemberAnnotatedChildEntityCollectionDefinition() |
| Modifier and Type | Method and Description |
|---|---|
protected <T> EntityModel<Object> |
extractChildEntityModel(EntityModel<T> declaringEntity,
Map<String,Object> attributes,
Member member)
Extracts the Child Entity contained in the given
declaringEntity as an EntityModel. |
protected boolean |
isMemberTypeSupported(Member member)
Check whether the given
Member is of a type supported by this definition. |
protected <T> Object |
resolveCommandTarget(CommandMessage<?> msg,
T parent,
Member member,
EntityModel<Object> childEntityModel)
Resolve the target of an incoming
CommandMessage to the right Child Entity. |
protected <T> Stream<Object> |
resolveEventTargets(EventMessage message,
T parentEntity,
Member member,
ForwardingMode eventForwardingMode)
Resolve the targets of an incoming
EventMessage to the right Child Entities. |
createChildDefinition, extractCommandHandlerRoutingKeys, isFieldTypeSupportedpublic AggregateMemberAnnotatedChildEntityCollectionDefinition()
protected boolean isMemberTypeSupported(Member member)
AbstractChildEntityDefinitionMember is of a type supported by this definition.isMemberTypeSupported in class AbstractChildEntityDefinitionmember - a Member containing or returning a Child Entityprotected <T> EntityModel<Object> extractChildEntityModel(EntityModel<T> declaringEntity, Map<String,Object> attributes, Member member)
AbstractChildEntityDefinitiondeclaringEntity as an EntityModel. The type of
the Child Entity is defined through a key in the provided attributes or based on given Field.extractChildEntityModel in class AbstractChildEntityDefinitionT - the type T of the given declaringEntity EntityModeldeclaringEntity - the EntityModel declaring the given fieldattributes - a Map containing the AggregateMember attributesmember - the Member containing the Child Entity.declaringEntityprotected <T> Object resolveCommandTarget(CommandMessage<?> msg, T parent, Member member, EntityModel<Object> childEntityModel)
AbstractChildEntityDefinitionCommandMessage to the right Child Entity. Returns the Child Entity the
msg needs to be routed to.resolveCommandTarget in class AbstractChildEntityDefinitionT - the type T of the given parent Entitymsg - the CommandMessage which is being resolved to a target entityparent - the parent Entity of type T of this Child Entitymember - the Member containing the Child Entity.childEntityModel - the EntityModel for the Child EntityCommandMessage.protected <T> Stream<Object> resolveEventTargets(EventMessage message, T parentEntity, Member member, ForwardingMode eventForwardingMode)
AbstractChildEntityDefinitionEventMessage to the right Child Entities. Returns a Stream of
all the Child Entities the Event Message should be routed to.resolveEventTargets in class AbstractChildEntityDefinitionT - the type T of the given parent Entitymessage - the EventMessage to routeparentEntity - the parent Entity of type T of this Child Entitymember - the Member containing the Child EntityeventForwardingMode - the ForwardingMode used to filter the message to route based on the
ForwardingMode implementationStream of Child Entity targets for the incoming EventMessageCopyright © 2010–2020. All rights reserved.