Package org.axonframework.queryhandling
Annotation Interface QueryHandler
@Documented
@Retention(RUNTIME)
@Target({METHOD,ANNOTATION_TYPE})
@MessageHandler(messageType=QueryMessage.class)
public @interface QueryHandler
Marker annotation to mark any method on an object as being a QueryHandler. Use the
AnnotationQueryHandlerAdapter to subscribe
the annotated class to the query bus.
The annotated method's first parameter is the query handled by that method. Optionally, the query handler may
specify a second parameter of type MetaData. The active MetaData will be
passed if that parameter is supplied.
- Since:
- 3.1
- Author:
- Marc Gathier
-
Optional Element Summary
Optional Elements
-
Element Details
-
queryName
String queryNameThe name of the Query this handler listens to. Defaults to the fully qualified class name of the payload type (i.e. first parameter).- Returns:
- The query name
- Default:
""
-