Interface QueryHandlerRegistry<S extends QueryHandlerRegistry<S>>
- Type Parameters:
S- The type of the registry itself, used for fluent interfacing.
- All Known Subinterfaces:
QueryBus
- All Known Implementing Classes:
DistributedQueryBus,InterceptingQueryBus,SimpleQueryBus,SimpleQueryHandlingComponent
public interface QueryHandlerRegistry<S extends QueryHandlerRegistry<S>>
Interface describing a registry of
query handlers.- Since:
- 5.0.0
- Author:
- Allard Buijze, Gerard Klijs, Milan Savic, Mitchell Herrijgers, Sara Pellegrini, Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptiondefault Ssubscribe(Set<QualifiedName> names, QueryHandler queryHandler) subscribe(QualifiedName queryName, QueryHandler queryHandler) default Ssubscribe(QueryHandlingComponent handlingComponent) Subscribe the givenhandlingComponentwith this registry.
-
Method Details
-
subscribe
Subscribe the givenhandlerforqueriesandresponseof the givennames.If a subscription already exists for any
namein the given set, the behavior is undefined. Implementations may throw an exception to refuse duplicate subscription or alternatively decide whether the existing or newhandlergets the subscription.- Parameters:
names- The names of the queries the givenqueryHandlercan handle.queryHandler- The handler instance that handlesqueriesfor the given names.- Returns:
- This registry for fluent interfacing.
-
subscribe
Subscribe the givenqueryHandlerforqueriesandresponseof the givenqueryName.If a subscription already exists for the
queryName, the behavior is undefined. Implementations may throw an exception to refuse duplicate subscription or alternatively decide whether the existing or newhandlergets the subscription.- Parameters:
queryName- The fully qualified name of the queryqueryHandler- The handler instance that handlesqueriesfor the given queryName.- Returns:
- This registry for fluent interfacing.
-
subscribe
Subscribe the givenhandlingComponentwith this registry.Typically invokes
subscribe(Set, QueryHandler), using theQueryHandlingComponent.supportedQueries()as the set of compatiblehandler namesthe component in question can deal with.- Parameters:
handlingComponent- The query handling component instance to subscribe with this registry.- Returns:
- This registry for fluent interfacing.
-