S - The concrete type of the state object.public interface CommandBus<S extends State> extends CommandLoggerAware<S>
| Modifier and Type | Method and Description |
|---|---|
void |
handleCommand(Command command)
Execute the command handler that is mapped to this command type.
|
<C extends Command,E extends Event> |
mapCommandHandler(Class<C> commandClass,
CommandHandler<S,C,E> commandHandler)
Map a command handler for a concrete command type.
|
void |
setCommandHandlerExecutor(ExecutorService executor)
Sets the executor service that will run async command handlers.
|
addCommandLoggervoid handleCommand(Command command)
command - The command to handle.mapCommandHandler(Class, CommandHandler)<C extends Command,E extends Event> void mapCommandHandler(Class<C> commandClass, CommandHandler<S,C,E> commandHandler)
C - The concrete command type that this handler will handle.E - The concrete event type that this handler will produce.commandClass - The concrete command type that this handler will handle.commandHandler - The handler that is executed when handleCommand(Command) is
called.void setCommandHandlerExecutor(ExecutorService executor)
executor - The executor service to use.Copyright © 2016 Cooking Fox. All rights reserved.