Annotation Interface HandleCommand
@Documented
@Retention(RUNTIME)
@Target({METHOD,CONSTRUCTOR})
@HandleMessage(COMMAND)
public @interface HandleCommand
Marks a method or constructor as a handler for command messages (
MessageType.COMMAND).
Command handlers typically represent intent to perform an action or change state. They often return a result,
which is published to the result log unless marked passive.
This annotation is a concrete specialization of HandleMessage for commands.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>[]Restricts which payload types this handler may be invoked for.booleanIftrue, disables this handler during discovery.Determines how the handler responds when referenced protected data is no longer available.booleanIftrue, this handler is considered passive and will not emit a result message.booleanIftrue, indexed request messages whose effective timeout has already expired may be skipped before this handler is invoked.
-
Element Details
-
onMissingProtectedData
MissingProtectedDataPolicy onMissingProtectedDataDetermines how the handler responds when referenced protected data is no longer available.- Default:
DEFAULT
-
disabled
boolean disabledIftrue, disables this handler during discovery.- Default:
false
-
passive
boolean passiveIftrue, this handler is considered passive and will not emit a result message. Useful when the handler is for side effects only.- Default:
false
-
skipExpiredRequests
boolean skipExpiredRequestsIftrue, indexed request messages whose effective timeout has already expired may be skipped before this handler is invoked.Defaults to
falseso a sender-side timeout does not change command execution semantics. Enable this only for commands that are safe to drop when they are stale.- Default:
false
-
allowedClasses
Class<?>[] allowedClassesRestricts which payload types this handler may be invoked for.- Default:
{}
-