public class FailingDuplicateQueryHandlerResolver extends Object implements DuplicateQueryHandlerResolver
DuplicateQueryHandlerResolver
that throws a DuplicateQueryHandlerSubscriptionException
when a duplicate registration is detected.Modifier and Type | Method and Description |
---|---|
static FailingDuplicateQueryHandlerResolver |
instance()
Returns a
DuplicateQueryHandlerResolver that throws an exception when a duplicate registration is
detected |
List<QuerySubscription<?>> |
resolve(String queryName,
Type responseType,
List<QuerySubscription<?>> registeredHandlers,
QuerySubscription<?> candidateHandler)
Chooses what to do when a duplicate handler is registered, returning the handlers that should be selected for
query handling, or otherwise throwing an exception to reject registration altogether.
|
public static FailingDuplicateQueryHandlerResolver instance()
DuplicateQueryHandlerResolver
that throws an exception when a duplicate registration is
detectedDuplicateQueryHandlerResolver
that throws an exception when a duplicate registration is
detectedpublic List<QuerySubscription<?>> resolve(String queryName, Type responseType, List<QuerySubscription<?>> registeredHandlers, QuerySubscription<?> candidateHandler)
DuplicateQueryHandlerResolver
resolve
in interface DuplicateQueryHandlerResolver
queryName
- The name of the query for which the duplicate was detectedregisteredHandlers
- the MessageHandler
instances already registered with the Query BuscandidateHandler
- the MessageHandler
that is newly registered and conflicts with the existing
registrationsMessageHandler
instances. It is up to the implementation to discard implementations
already in the listCopyright © 2010–2023. All rights reserved.