@@ -0,0 +1,1238 @@
+package org.axonframework.queryhandling;%0A%0Aimport org.axonframework.messaging.MessageHandler;%0A%0A/**%0A * Encapsulates the identifying fields of a Query Handler when one is subscribed to the%0A * %7B@link org.axonframework.queryhandling.QueryBus%7D. As such contains the response type of the query handler and the%0A * complete handler itself.%0A * The first is typically used by the QueryBus to select the right query handler when a query comes in.%0A * The latter is used to perform the actual query.%0A *%0A * @param %3CR%3E the type of response this query subscription contains%0A */%0Aclass QuerySubscription%3CR%3E %7B%0A%0A    private final Class%3CR%3E responseType;%0A    private final MessageHandler%3C? super QueryMessage%3C?, R%3E%3E queryHandler;%0A%0A    QuerySubscription(Class%3CR%3E responseType,%0A                      MessageHandler%3C? super QueryMessage%3C?, R%3E%3E queryHandler) %7B%0A        this.responseType = responseType;%0A        this.queryHandler = queryHandler;%0A    %7D%0A%0A    public Class%3CR%3E getResponseType() %7B%0A        return responseType;%0A    %7D%0A%0A    public boolean canHandle(ResponseType queryResponseType) %7B%0A        return queryResponseType.matches(responseType);%0A    %7D%0A%0A    public MessageHandler%3C? super QueryMessage%3C?, R%3E%3E getQueryHandler() %7B%0A        return queryHandler;%0A    %7D%0A%7D%0A

Introduce a QuerySubscription for subscribing query handlers