public abstract class AbstractCommandGateway extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AbstractCommandGateway.Builder
Abstract Builder class to instantiate
AbstractCommandGateway implementations. |
Modifier | Constructor and Description |
---|---|
protected |
AbstractCommandGateway(AbstractCommandGateway.Builder builder)
Instantiate an
AbstractCommandGateway based on the fields contained in the AbstractCommandGateway.Builder . |
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 Registration |
registerDispatchInterceptor(MessageDispatchInterceptor<? super CommandMessage<?>> interceptor)
Registers a command dispatch interceptor within a
CommandGateway . |
protected <C,R> void |
send(C command,
CommandCallback<? super C,? super 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(AbstractCommandGateway.Builder builder)
AbstractCommandGateway
based on the fields contained in the AbstractCommandGateway.Builder
.
Will assert that the CommandBus
is not null
and throws an AxonConfigurationException
if it is.
builder
- the AbstractCommandGateway.Builder
used to instantiate a AbstractCommandGateway
instanceprotected <C,R> void send(C command, CommandCallback<? super C,? super 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 Registration registerDispatchInterceptor(MessageDispatchInterceptor<? super CommandMessage<?>> interceptor)
CommandGateway
.interceptor
- To intercept command messagesprotected <C> CommandMessage<? extends C> processInterceptors(CommandMessage<C> commandMessage)
commandMessage
- The incoming command messagepublic CommandBus getCommandBus()
Copyright © 2010–2019. All rights reserved.