P - the parent entity typeC - the child entity typepublic class ChildForwardingCommandMessageHandlingMember<P,C> extends Object implements ForwardingCommandMessageHandlingMember<P>
CommandMessageHandlingMember that forwards commands to a child entity.| Constructor and Description |
|---|
ChildForwardingCommandMessageHandlingMember(List<org.axonframework.messaging.annotation.MessageHandlingMember<? super C>> childHandlerInterceptors,
org.axonframework.messaging.annotation.MessageHandlingMember<? super C> childHandler,
BiFunction<org.axonframework.commandhandling.CommandMessage<?>,P,C> childEntityResolver)
Initializes a
ChildForwardingCommandMessageHandlingMember that routes commands to a compatible child
entity. |
| Modifier and Type | Method and Description |
|---|---|
Optional<Map<String,Object>> |
annotationAttributes(Class<? extends Annotation> annotationType) |
<R> Optional<R> |
attribute(String attributeKey) |
boolean |
canForward(org.axonframework.commandhandling.CommandMessage<?> message,
P target)
Check if this handler is in a state where it can currently accept the command.
|
boolean |
canHandle(org.axonframework.messaging.Message<?> message) |
boolean |
canHandleMessageType(Class<? extends org.axonframework.messaging.Message> messageType) |
String |
commandName() |
Object |
handle(org.axonframework.messaging.Message<?> message,
P target) |
boolean |
hasAnnotation(Class<? extends Annotation> annotationType) |
boolean |
isFactoryHandler() |
Class<?> |
payloadType() |
int |
priority() |
String |
routingKey() |
<HT> Optional<HT> |
unwrap(Class<HT> handlerType) |
public ChildForwardingCommandMessageHandlingMember(List<org.axonframework.messaging.annotation.MessageHandlingMember<? super C>> childHandlerInterceptors, org.axonframework.messaging.annotation.MessageHandlingMember<? super C> childHandler, BiFunction<org.axonframework.commandhandling.CommandMessage<?>,P,C> childEntityResolver)
ChildForwardingCommandMessageHandlingMember that routes commands to a compatible child
entity. Child entities are resolved using the given childEntityResolver. If an entity is found the
command will be handled using the given childHandler.childHandlerInterceptors - interceptors for childHandlerchildHandler - handler of the command once a suitable entity is foundchildEntityResolver - resolver of child entities for a given commandpublic String commandName()
commandName in interface org.axonframework.commandhandling.CommandMessageHandlingMember<P>public String routingKey()
routingKey in interface org.axonframework.commandhandling.CommandMessageHandlingMember<P>public boolean isFactoryHandler()
isFactoryHandler in interface org.axonframework.commandhandling.CommandMessageHandlingMember<P>public Class<?> payloadType()
payloadType in interface org.axonframework.messaging.annotation.MessageHandlingMember<P>public int priority()
priority in interface org.axonframework.messaging.annotation.MessageHandlingMember<P>public boolean canForward(org.axonframework.commandhandling.CommandMessage<?> message,
P target)
ForwardingCommandMessageHandlingMembercanForward in interface ForwardingCommandMessageHandlingMember<P>message - The message that is to be forwardedtarget - The target to forward the command messagetrue if this handler can forward command to target entity, false otherwise.public boolean canHandle(@Nonnull org.axonframework.messaging.Message<?> message)
canHandle in interface org.axonframework.messaging.annotation.MessageHandlingMember<P>public boolean canHandleMessageType(@Nonnull Class<? extends org.axonframework.messaging.Message> messageType)
canHandleMessageType in interface org.axonframework.messaging.annotation.MessageHandlingMember<P>public Object handle(@Nonnull org.axonframework.messaging.Message<?> message, @Nullable P target) throws Exception
public <HT> Optional<HT> unwrap(Class<HT> handlerType)
unwrap in interface org.axonframework.messaging.annotation.MessageHandlingMember<P>public boolean hasAnnotation(Class<? extends Annotation> annotationType)
hasAnnotation in interface org.axonframework.messaging.annotation.MessageHandlingMember<P>public Optional<Map<String,Object>> annotationAttributes(Class<? extends Annotation> annotationType)
annotationAttributes in interface org.axonframework.messaging.annotation.MessageHandlingMember<P>Copyright © 2010–2022. All rights reserved.