|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.test.utils.RecordingCommandBus
public class RecordingCommandBus
CommandBus implementation that does not perform any actions on subscriptions or dispatched commands, but records them instead. This implementation is not a stand-in replacement for a mock, but might prove useful in many simple cases.
| Constructor Summary | |
|---|---|
RecordingCommandBus()
|
|
| Method Summary | ||
|---|---|---|
void |
clearCommands()
Clears all the commands recorded by this Command Bus. |
|
void |
clearSubscriptions()
Clears all subscribed handlers on this command bus. |
|
void |
dispatch(org.axonframework.commandhandling.CommandMessage<?> command)
|
|
|
dispatch(org.axonframework.commandhandling.CommandMessage<?> command,
org.axonframework.commandhandling.CommandCallback<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.commandhandling.CommandHandler<?>> |
getSubscriptions()
Returns a Map will all Command Names and their Command Handler that have been subscribed to this command bus. |
|
boolean |
isSubscribed(org.axonframework.commandhandling.CommandHandler<?> commandHandler)
Indicates whether the given commandHandler is subscribed to this command bus. |
|
|
isSubscribed(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> commandHandler)
Indicates whether the given commandHandler is subscribed to commands of the given
commandType on this command bus. |
|
void |
setCallbackBehavior(CallbackBehavior callbackBehavior)
Sets the instance that defines the behavior of the Command Bus when a command is dispatched with a callback. |
|
|
subscribe(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> handler)
|
|
|
unsubscribe(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> handler)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RecordingCommandBus()
| Method Detail |
|---|
public void dispatch(org.axonframework.commandhandling.CommandMessage<?> command)
dispatch in interface org.axonframework.commandhandling.CommandBus
public <R> void dispatch(org.axonframework.commandhandling.CommandMessage<?> command,
org.axonframework.commandhandling.CommandCallback<R> callback)
dispatch in interface org.axonframework.commandhandling.CommandBus
public <C> void subscribe(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> handler)
subscribe in interface org.axonframework.commandhandling.CommandBus
public <C> boolean unsubscribe(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> handler)
unsubscribe in interface org.axonframework.commandhandling.CommandBuspublic void clearCommands()
public void clearSubscriptions()
public boolean isSubscribed(org.axonframework.commandhandling.CommandHandler<?> commandHandler)
commandHandler is subscribed to this command bus.
commandHandler - The command handler to verify the subscription for
true if the handler is subscribed, otherwise false.
public <C> boolean isSubscribed(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> 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 for
true if the handler is subscribed, otherwise false.public Map<String,org.axonframework.commandhandling.CommandHandler<?>> getSubscriptions()
public List<org.axonframework.commandhandling.CommandMessage<?>> getDispatchedCommands()
public void setCallbackBehavior(CallbackBehavior callbackBehavior)
callbackBehavior - The instance deciding to how the callback should be invoked.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||