Class AnnotationQueryHandlerAdapter<T>

java.lang.Object
org.axonframework.queryhandling.annotation.AnnotationQueryHandlerAdapter<T>
All Implemented Interfaces:
MessageHandler<QueryMessage<?,?>>, QueryHandlerAdapter

public class AnnotationQueryHandlerAdapter<T> extends Object implements QueryHandlerAdapter, MessageHandler<QueryMessage<?,?>>
Adapter that turns any @QueryHandler annotated bean into a MessageHandler implementation. Each annotated method is subscribed as a QueryHandler at the QueryBus for the query type specified by the parameter/return type of that method.
Since:
3.1
Author:
Marc Gathier
  • Constructor Details

    • AnnotationQueryHandlerAdapter

      public AnnotationQueryHandlerAdapter(T target)
      Initializes the adapter, forwarding call to the given target.
      Parameters:
      target - the instance with QueryHandler annotated methods
    • AnnotationQueryHandlerAdapter

      public AnnotationQueryHandlerAdapter(T target, ParameterResolverFactory parameterResolverFactory)
      Initializes the adapter, forwarding call to the given target, resolving parameters using the given parameterResolverFactory.
      Parameters:
      target - the instance with QueryHandler annotated methods
      parameterResolverFactory - the parameter resolver factory to resolve handler parameters with
    • AnnotationQueryHandlerAdapter

      public AnnotationQueryHandlerAdapter(T target, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition)
      Initializes the adapter, forwarding call to the given target, resolving parameters using the given parameterResolverFactory and creating handlers using handlerDefinition.
      Parameters:
      target - the instance with QueryHandler annotated methods
      parameterResolverFactory - the parameter resolver factory to resolve handler parameters with
      handlerDefinition - the handler definition used to create concrete handlers
  • Method Details