public class RecordingCommandBus extends Object implements org.axonframework.commandhandling.CommandBus
| Constructor and Description |
|---|
RecordingCommandBus() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCommands()
Clears all the commands recorded by this Command Bus.
|
void |
clearSubscriptions()
Clears all subscribed handlers on this command bus.
|
<C> void |
dispatch(org.axonframework.commandhandling.CommandMessage<C> command) |
<C,R> void |
dispatch(org.axonframework.commandhandling.CommandMessage<C> command,
org.axonframework.commandhandling.CommandCallback<? super C,? super R> callback) |
List<org.axonframework.commandhandling.CommandMessage<?>> |
getDispatchedCommands()
Returns a list with all commands that have been dispatched by this command bus.
|
Map<String,org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>>> |
getSubscriptions()
Returns a Map will all Command Names and their Command Handler that have been subscribed to this command bus.
|
boolean |
isSubscribed(org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>> commandHandler)
Indicates whether the given
commandHandler is subscribed to this command bus. |
<C> boolean |
isSubscribed(String commandName,
org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>> commandHandler)
Indicates whether the given
commandHandler is subscribed to commands of the given
commandType on this command bus. |
org.axonframework.common.Registration |
registerDispatchInterceptor(org.axonframework.messaging.MessageDispatchInterceptor<? super org.axonframework.commandhandling.CommandMessage<?>> dispatchInterceptor) |
org.axonframework.common.Registration |
registerHandlerInterceptor(org.axonframework.messaging.MessageHandlerInterceptor<? super org.axonframework.commandhandling.CommandMessage<?>> handlerInterceptor) |
void |
setCallbackBehavior(CallbackBehavior callbackBehavior)
Sets the instance that defines the behavior of the Command Bus when a command is dispatched with a callback.
|
org.axonframework.common.Registration |
subscribe(String commandName,
org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>> handler) |
public <C> void dispatch(org.axonframework.commandhandling.CommandMessage<C> command)
dispatch in interface org.axonframework.commandhandling.CommandBuspublic <C,R> void dispatch(org.axonframework.commandhandling.CommandMessage<C> command,
org.axonframework.commandhandling.CommandCallback<? super C,? super R> callback)
dispatch in interface org.axonframework.commandhandling.CommandBuspublic org.axonframework.common.Registration subscribe(String commandName, org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>> handler)
subscribe in interface org.axonframework.commandhandling.CommandBuspublic void clearCommands()
public void clearSubscriptions()
public boolean isSubscribed(org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>> commandHandler)
commandHandler is subscribed to this command bus.commandHandler - The command handler to verify the subscription fortrue if the handler is subscribed, otherwise false.public <C> boolean isSubscribed(String commandName, org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>> commandHandler)
commandHandler is subscribed to commands of the given
commandType on this command bus.C - The type of command to verify the subscription forcommandName - The name of the command to verify the subscription forcommandHandler - The command handler to verify the subscription fortrue if the handler is subscribed, otherwise false.public Map<String,org.axonframework.messaging.MessageHandler<? super org.axonframework.commandhandling.CommandMessage<?>>> getSubscriptions()
public List<org.axonframework.commandhandling.CommandMessage<?>> getDispatchedCommands()
public void setCallbackBehavior(CallbackBehavior callbackBehavior)
callbackBehavior - The instance deciding to how the callback should be invoked.public org.axonframework.common.Registration registerDispatchInterceptor(org.axonframework.messaging.MessageDispatchInterceptor<? super org.axonframework.commandhandling.CommandMessage<?>> dispatchInterceptor)
registerDispatchInterceptor in interface org.axonframework.messaging.MessageDispatchInterceptorSupport<org.axonframework.commandhandling.CommandMessage<?>>public org.axonframework.common.Registration registerHandlerInterceptor(org.axonframework.messaging.MessageHandlerInterceptor<? super org.axonframework.commandhandling.CommandMessage<?>> handlerInterceptor)
registerHandlerInterceptor in interface org.axonframework.messaging.MessageHandlerInterceptorSupport<org.axonframework.commandhandling.CommandMessage<?>>Copyright © 2010–2022. All rights reserved.