public class AggregateMemberAnnotatedChildEntityMapDefinition extends AbstractChildEntityDefinition
AbstractChildEntityDefinition
that is used to detect Maps with entities as
values annotated with AggregateMember
. If such a field is found a ChildEntity
is created that
delegates to the entities in the annotated Map.Constructor and Description |
---|
AggregateMemberAnnotatedChildEntityMapDefinition() |
Modifier and Type | Method and Description |
---|---|
protected <T> EntityModel<Object> |
extractChildEntityModel(EntityModel<T> declaringEntity,
Map<String,Object> attributes,
Field field)
Extracts the Child Entity contained in the given
declaringEntity as an
EntityModel . |
protected boolean |
isFieldTypeSupported(Field field)
Check whether the given
Field is of a type supported by this definition. |
protected <T> Object |
resolveCommandTarget(CommandMessage<?> msg,
T parent,
Field field,
EntityModel<Object> childEntityModel)
Resolve the target of an incoming
CommandMessage to the right Child
Entity. |
protected <T> Stream<Object> |
resolveEventTargets(EventMessage message,
T parentEntity,
Field field,
ForwardingMode eventForwardingMode)
Resolve the targets of an incoming
EventMessage to the right Child
Entities. |
createChildDefinition, extractCommandHandlerRoutingKeys
public AggregateMemberAnnotatedChildEntityMapDefinition()
protected boolean isFieldTypeSupported(Field field)
AbstractChildEntityDefinition
Field
is of a type supported by this definition.isFieldTypeSupported
in class AbstractChildEntityDefinition
field
- A Field
containing a Child Entity.protected <T> EntityModel<Object> extractChildEntityModel(EntityModel<T> declaringEntity, Map<String,Object> attributes, Field field)
AbstractChildEntityDefinition
declaringEntity
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 AbstractChildEntityDefinition
T
- The type T
of the given declaringEntity
EntityModel
.declaringEntity
- The EntityModel
declaring the
given field
.attributes
- A Map
containing the
AggregateMember
attributes.field
- The Field
containing the Child Entity.declaringEntity
.protected <T> Object resolveCommandTarget(CommandMessage<?> msg, T parent, Field field, EntityModel<Object> childEntityModel)
AbstractChildEntityDefinition
CommandMessage
to the right Child
Entity. Returns the Child Entity the msg
needs to be routed to.resolveCommandTarget
in class AbstractChildEntityDefinition
T
- The type T
of the given parent
Entity.msg
- The CommandMessage
which is being resolved to a
target entity.parent
- The parent
Entity of type T
of this Child Entity.field
- The Field
containing the Child Entity.childEntityModel
- The EntityModel
for the Child
Entity.CommandMessage
.protected <T> Stream<Object> resolveEventTargets(EventMessage message, T parentEntity, Field field, ForwardingMode eventForwardingMode)
AbstractChildEntityDefinition
EventMessage
to the right Child
Entities. Returns a Stream
of all the Child Entities the Event Message should be
routed to.resolveEventTargets
in class AbstractChildEntityDefinition
T
- The type T
of the given parent
Entity.message
- The EventMessage
to route.parentEntity
- The parent
Entity of type T
of this Child Entity.field
- The Field
containing the Child Entity.eventForwardingMode
- The ForwardingMode
used to filter the
message
to route based on the ForwardingMode implementation.Stream
of Child Entity targets for the incoming
EventMessage
.Copyright © 2010–2018. All rights reserved.