public class FailingDuplicateCommandHandlerResolver extends Object implements DuplicateCommandHandlerResolver
DuplicateCommandHandlerResolver that throws a DuplicateCommandHandlerSubscriptionException
when a duplicate registration is detected.| Modifier and Type | Method and Description |
|---|---|
static FailingDuplicateCommandHandlerResolver |
instance()
Returns a DuplicateCommandHandlerResolver that throws an exception when a duplicate registration is detected
|
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 FailingDuplicateCommandHandlerResolver instance()
public MessageHandler<? super CommandMessage<?>> resolve(@Nonnull String commandName, @Nonnull MessageHandler<? super CommandMessage<?>> registeredHandler, @Nonnull MessageHandler<? super CommandMessage<?>> candidateHandler)
DuplicateCommandHandlerResolverresolve in interface DuplicateCommandHandlerResolvercommandName - 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–2023. All rights reserved.