public abstract class AbstractCommandGateway extends Object
Modifier | Constructor and Description |
---|---|
protected |
AbstractCommandGateway(CommandBus commandBus,
RetryScheduler retryScheduler,
List<CommandDispatchInterceptor> commandDispatchInterceptors)
Initialize the AbstractCommandGateway with given
commandBus , retryScheduler and
commandDispatchInterceptors . |
Modifier and Type | Method and Description |
---|---|
protected CommandMessage |
processInterceptors(CommandMessage commandMessage)
Invokes all the dispatch interceptors and returns the CommandMessage instance that should be dispatched.
|
protected <R> void |
send(Object command,
CommandCallback<R> callback)
Sends the given
command , and invokes the callback when the command is processed. |
protected void |
sendAndForget(Object command)
Dispatches a command without callback.
|
protected AbstractCommandGateway(CommandBus commandBus, RetryScheduler retryScheduler, List<CommandDispatchInterceptor> commandDispatchInterceptors)
commandBus
, retryScheduler
and
commandDispatchInterceptors
.commandBus
- The command bus on which to dispatch eventsretryScheduler
- The scheduler capable of performing retries of failed commands. May be
null
when to prevent retries.commandDispatchInterceptors
- The interceptors to invoke when dispatching a commandprotected <R> void send(Object command, CommandCallback<R> callback)
command
, and invokes the callback
when the command is processed.R
- The type of response expected from the commandcommand
- The command to dispatchcallback
- The callback to notify with the processing resultprotected void sendAndForget(Object command)
command
- The command to dispatchprotected CommandMessage processInterceptors(CommandMessage commandMessage)
commandMessage
- The incoming command messageCopyright © 2010-2014. All Rights Reserved.