public abstract class AbstractCommandGateway extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCommandGateway(CommandBus commandBus,
RetryScheduler retryScheduler,
List<MessageDispatchInterceptor<? super CommandMessage<?>>> messageDispatchInterceptors)
Initialize the AbstractCommandGateway with given
commandBus, retryScheduler and
commandDispatchInterceptors. |
| Modifier and Type | Method and Description |
|---|---|
CommandBus |
getCommandBus()
Returns the CommandBus used by this gateway.
|
protected <C> CommandMessage<? extends C> |
processInterceptors(CommandMessage<C> commandMessage)
Invokes all the dispatch interceptors and returns the CommandMessage instance that should be dispatched.
|
protected <C,R> void |
send(C command,
CommandCallback<? super C,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<MessageDispatchInterceptor<? super CommandMessage<?>>> messageDispatchInterceptors)
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.messageDispatchInterceptors - The interceptors to invoke when dispatching a commandprotected <C,R> void send(C command,
CommandCallback<? super C,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 <C> CommandMessage<? extends C> processInterceptors(CommandMessage<C> commandMessage)
commandMessage - The incoming command messagepublic CommandBus getCommandBus()
Copyright © 2010–2018. All rights reserved.