Annotation Interface HandleSelf
Annotation placed on a method of a payload class of a request, i.e. command, query or web request. Upon publication
of the request (i.e. in the publishing thread), the annotated method is invoked to handle the request.
Request like these don't require any other handler, though additional handlers may still handle the request. The advantage of this is that handler logic is contained within the payload class itself.
HandleSelf comes with the same advantages of local handlers.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanEnables overriding the default behavior.booleanEnables publication of the handled message for other consumers.booleanEnables publication of handler metrics, like aHandleMessageEvent(if tracker monitoring is enabled).booleanIf true, the result of the handler will be ignored.
-
Element Details
-
disabled
boolean disabledEnables overriding the default behavior. If a supertype has aHandleSelfmethod, an overriding method can disable this using annotation @HandleSelf(disabled = true) or vice versa.- Default:
- false
-
passive
boolean passiveIf true, the result of the handler will be ignored.- Default:
- false
-
logMessage
boolean logMessageEnables publication of the handled message for other consumers. Iftrue, messages and their payloads are logged as if they have not been handled yet. This is often desirable for self-handled queries and commands issued by e.g. admins.- Default:
- false
-
logMetrics
boolean logMetricsEnables publication of handler metrics, like aHandleMessageEvent(if tracker monitoring is enabled).- Default:
- false
-