Package org.axonframework.messaging
Interface MessageHandler<T extends Message<?>>
- Type Parameters:
T- The message type this handler can process
- All Known Subinterfaces:
CommandMessageHandler,EventMessageHandler,Saga<T>
- All Known Implementing Classes:
AggregateAnnotationCommandHandler,AnnotatedSaga,AnnotationCommandHandlerAdapter,AnnotationEventHandlerAdapter,AnnotationQueryHandlerAdapter,EventValidator
public interface MessageHandler<T extends Message<?>>
Interface for a component that processes Messages.
- Since:
- 3.0
- Author:
- Rene de Waele
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanIndicates whether this handler can handle the given messagedefault booleancanHandleType(Class<?> payloadType) Indicates whether this handler can handle messages of given typedefault Class<?> Returns the instance type that this handler delegates to.Handles the givenmessage.
-
Method Details
-
handle
Handles the givenmessage.- Parameters:
message- The message to be processed.- Returns:
- The result of the message processing.
- Throws:
Exception- any exception that occurs during message handling
-
canHandle
Indicates whether this handler can handle the given message- Parameters:
message- The message to verify- Returns:
trueif this handler can handle the message, otherwisefalse
-
getTargetType
Returns the instance type that this handler delegates to.- Returns:
- Returns the instance type that this handler delegates to
-
canHandleType
Indicates whether this handler can handle messages of given type- Parameters:
payloadType- The payloadType to verify- Returns:
trueif this handler can handle the payloadType, otherwisefalse
-