public class LoggingDuplicateQueryHandlerResolver extends Object implements DuplicateQueryHandlerResolver
DuplicateQueryHandlerResolver
that allows registrations to be overridden by new handlers,
but logs this (on WARN level) to a given logger.Modifier and Type | Method and Description |
---|---|
static LoggingDuplicateQueryHandlerResolver |
instance()
Returns an instance that logs duplicate registrations.
|
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 LoggingDuplicateQueryHandlerResolver instance()
public 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.