T
- The message type this handler can processpublic interface MessageHandler<T extends Message<?>>
Modifier and Type | Method and Description |
---|---|
default boolean |
canHandle(T message)
Indicates whether this handler can handle the given message
|
default boolean |
canHandleType(Class<?> payloadType)
Indicates whether this handler can handle messages of given type
|
default Class<?> |
getTargetType()
Returns the instance type that this handler delegates to.
|
Object |
handle(T message)
Handles the given
message . |
Object handle(T message) throws Exception
message
.message
- The message to be processed.Exception
- any exception that occurs during message handlingdefault boolean canHandle(T message)
message
- The message to verifytrue
if this handler can handle the message, otherwise false
default Class<?> getTargetType()
default boolean canHandleType(Class<?> payloadType)
payloadType
- The payloadType to verifytrue
if this handler can handle the payloadType, otherwise false
Copyright © 2010–2024. All rights reserved.