public class LoggingDuplicateCommandHandlerResolver extends Object implements DuplicateCommandHandlerResolver
Modifier and Type | Method and Description |
---|---|
static LoggingDuplicateCommandHandlerResolver |
instance()
Returns an instance that logs duplicate registrations.
|
MessageHandler<? super CommandMessage<?>> |
resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler)
Chooses what to do when a duplicate handler is registered, returning the handler that should be selected for
command handling, or otherwise throwing an exception to reject registration altogether.
|
public static LoggingDuplicateCommandHandlerResolver instance()
public MessageHandler<? super CommandMessage<?>> resolve(String commandName, MessageHandler<? super CommandMessage<?>> registeredHandler, MessageHandler<? super CommandMessage<?>> candidateHandler)
DuplicateCommandHandlerResolver
resolve
in interface DuplicateCommandHandlerResolver
commandName
- The name of the Command for which the duplicate was detectedregisteredHandler
- the MessageHandler
previously registered with the Command BuscandidateHandler
- the MessageHandler
that is newly registered and conflicts with the existing registrationMessageHandler
. Could be the registeredHandler
, the candidateHandler
or
another handler entirelyCopyright © 2010–2022. All rights reserved.