Class ChildForwardingCommandMessageHandlingMember<P,C>
java.lang.Object
org.axonframework.modelling.command.inspection.ChildForwardingCommandMessageHandlingMember<P,C>
- Type Parameters:
P- the parent entity typeC- the child entity type
- All Implemented Interfaces:
org.axonframework.commandhandling.CommandMessageHandlingMember<P>,org.axonframework.messaging.annotation.MessageHandlingMember<P>,ForwardingCommandMessageHandlingMember<P>
public class ChildForwardingCommandMessageHandlingMember<P,C>
extends Object
implements ForwardingCommandMessageHandlingMember<P>
Implementation of a
CommandMessageHandlingMember that forwards commands to a child entity.- Since:
- 3.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionChildForwardingCommandMessageHandlingMember(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 aChildForwardingCommandMessageHandlingMemberthat routes commands to a compatible child entity. -
Method Summary
Modifier and TypeMethodDescriptionannotationAttributes(Class<? extends Annotation> annotationType) <R> Optional<R>booleancanForward(org.axonframework.commandhandling.CommandMessage<?> message, P target) Check if this handler is in a state where it can currently accept the command.booleancanHandle(org.axonframework.messaging.Message<?> message) booleancanHandleMessageType(Class<? extends org.axonframework.messaging.Message> messageType) booleanhasAnnotation(Class<? extends Annotation> annotationType) booleanClass<?>intpriority()<HT> Optional<HT>Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.annotation.MessageHandlingMember
canHandleType, declaringClass, signature
-
Constructor Details
-
ChildForwardingCommandMessageHandlingMember
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) Initializes aChildForwardingCommandMessageHandlingMemberthat routes commands to a compatible child entity. Child entities are resolved using the givenchildEntityResolver. If an entity is found the command will be handled using the givenchildHandler.- Parameters:
childHandlerInterceptors- interceptors forchildHandlerchildHandler- handler of the command once a suitable entity is foundchildEntityResolver- resolver of child entities for a given command
-
-
Method Details
-
commandName
- Specified by:
commandNamein interfaceorg.axonframework.commandhandling.CommandMessageHandlingMember<P>
-
routingKey
- Specified by:
routingKeyin interfaceorg.axonframework.commandhandling.CommandMessageHandlingMember<P>
-
isFactoryHandler
public boolean isFactoryHandler()- Specified by:
isFactoryHandlerin interfaceorg.axonframework.commandhandling.CommandMessageHandlingMember<P>
-
payloadType
- Specified by:
payloadTypein interfaceorg.axonframework.messaging.annotation.MessageHandlingMember<P>
-
priority
public int priority()- Specified by:
priorityin interfaceorg.axonframework.messaging.annotation.MessageHandlingMember<P>
-
canForward
Description copied from interface:ForwardingCommandMessageHandlingMemberCheck if this handler is in a state where it can currently accept the command.- Specified by:
canForwardin interfaceForwardingCommandMessageHandlingMember<P>- Parameters:
message- The message that is to be forwardedtarget- The target to forward the command message- Returns:
trueif this handler can forward command to target entity,falseotherwise.
-
canHandle
public boolean canHandle(@Nonnull org.axonframework.messaging.Message<?> message) - Specified by:
canHandlein interfaceorg.axonframework.messaging.annotation.MessageHandlingMember<P>
-
canHandleMessageType
public boolean canHandleMessageType(@Nonnull Class<? extends org.axonframework.messaging.Message> messageType) - Specified by:
canHandleMessageTypein interfaceorg.axonframework.messaging.annotation.MessageHandlingMember<P>
-
handle
-
unwrap
- Specified by:
unwrapin interfaceorg.axonframework.messaging.annotation.MessageHandlingMember<P>
-
hasAnnotation
- Specified by:
hasAnnotationin interfaceorg.axonframework.messaging.annotation.MessageHandlingMember<P>
-
annotationAttributes
public Optional<Map<String,Object>> annotationAttributes(Class<? extends Annotation> annotationType) - Specified by:
annotationAttributesin interfaceorg.axonframework.messaging.annotation.MessageHandlingMember<P>
-
attribute
- Specified by:
attributein interfaceorg.axonframework.messaging.annotation.MessageHandlingMember<P>
-