| Package | Description |
|---|---|
| org.axonframework.commandhandling |
Classes that implement the concept of command handling using explicit command objects.
|
| org.axonframework.commandhandling.callbacks | |
| org.axonframework.commandhandling.distributed | |
| org.axonframework.commandhandling.distributed.commandfilter | |
| org.axonframework.commandhandling.gateway |
| Modifier and Type | Class and Description |
|---|---|
class |
GenericCommandMessage<T>
Implementation of the CommandMessage that takes all properties as constructor parameters.
|
| Modifier and Type | Method and Description |
|---|---|
CommandMessage<T> |
CommandMessage.andMetaData(Map<String,?> metaData)
Returns a copy of this CommandMessage with it MetaData merged with the given
metaData. |
static <C> CommandMessage<C> |
GenericCommandMessage.asCommandMessage(Object command)
Returns the given command as a
CommandMessage. |
protected <C> CommandMessage<C> |
SimpleCommandBus.intercept(CommandMessage<C> command)
Invokes all the dispatch interceptors.
|
CommandMessage<T> |
CommandMessage.withMetaData(Map<String,?> metaData)
Returns a copy of this CommandMessage with the given
metaData. |
| Modifier and Type | Method and Description |
|---|---|
MessageHandler<? super CommandMessage<?>> |
DuplicateCommandHandlerResolver.resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler)
Chooses what to do when a duplicate handler is registered, returning the handler that should be selected for
command handling, or otherwise throwing an exception to reject registration altogether.
|
MessageHandler<? super CommandMessage<?>> |
FailingDuplicateCommandHandlerResolver.resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler) |
MessageHandler<? super CommandMessage<?>> |
LoggingDuplicateCommandHandlerResolver.resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
AnnotationCommandHandlerAdapter.canHandle(CommandMessage<?> message) |
<C> void |
CommandBus.dispatch(CommandMessage<C> command)
Dispatch the given
command to the CommandHandler subscribed to the given command's name. |
<C> void |
SimpleCommandBus.dispatch(CommandMessage<C> command) |
<C,R> void |
CommandBus.dispatch(CommandMessage<C> command,
CommandCallback<? super C,? super R> callback)
Dispatch the given
command to the CommandHandler subscribed to the given command's name. |
<C,R> void |
SimpleCommandBus.dispatch(CommandMessage<C> command,
CommandCallback<? super C,? super R> callback) |
protected <C,R> void |
SimpleCommandBus.doDispatch(CommandMessage<C> command,
CommandCallback<? super C,? super R> callback)
Performs the actual dispatching logic.
|
Object |
AnnotationCommandHandlerAdapter.handle(CommandMessage<?> command)
Invokes the @CommandHandler annotated method that accepts the given
command. |
protected <C,R> void |
SimpleCommandBus.handle(CommandMessage<C> command,
MessageHandler<? super CommandMessage<?>> handler,
CommandCallback<? super C,? super R> callback)
Performs the actual handling logic.
|
protected <C,R> void |
AsynchronousCommandBus.handle(CommandMessage<C> command,
MessageHandler<? super CommandMessage<?>> handler,
CommandCallback<? super C,? super R> callback) |
protected <C> CommandMessage<C> |
SimpleCommandBus.intercept(CommandMessage<C> command)
Invokes all the dispatch interceptors.
|
void |
MonitorAwareCallback.onResult(CommandMessage<? extends C> commandMessage,
CommandResultMessage<? extends R> commandResultMessage) |
void |
CommandCallback.onResult(CommandMessage<? extends C> commandMessage,
CommandResultMessage<? extends R> commandResultMessage)
Invoked when command handling execution is completed.
|
| Modifier and Type | Method and Description |
|---|---|
protected <C,R> void |
SimpleCommandBus.handle(CommandMessage<C> command,
MessageHandler<? super CommandMessage<?>> handler,
CommandCallback<? super C,? super R> callback)
Performs the actual handling logic.
|
protected <C,R> void |
AsynchronousCommandBus.handle(CommandMessage<C> command,
MessageHandler<? super CommandMessage<?>> handler,
CommandCallback<? super C,? super R> callback) |
SimpleCommandBus.Builder |
SimpleCommandBus.Builder.messageMonitor(MessageMonitor<? super CommandMessage<?>> messageMonitor)
Sets the
MessageMonitor of generic type CommandMessage used the to monitor the command bus. |
AsynchronousCommandBus.Builder |
AsynchronousCommandBus.Builder.messageMonitor(MessageMonitor<? super CommandMessage<?>> messageMonitor) |
Registration |
SimpleCommandBus.registerDispatchInterceptor(MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor)
Registers the given list of dispatch interceptors to the command bus.
|
Registration |
SimpleCommandBus.registerHandlerInterceptor(MessageHandlerInterceptor<? super CommandMessage<?>> handlerInterceptor)
Registers the given interceptor to the command bus.
|
MessageHandler<? super CommandMessage<?>> |
DuplicateCommandHandlerResolver.resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler)
Chooses what to do when a duplicate handler is registered, returning the handler that should be selected for
command handling, or otherwise throwing an exception to reject registration altogether.
|
MessageHandler<? super CommandMessage<?>> |
DuplicateCommandHandlerResolver.resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler)
Chooses what to do when a duplicate handler is registered, returning the handler that should be selected for
command handling, or otherwise throwing an exception to reject registration altogether.
|
MessageHandler<? super CommandMessage<?>> |
FailingDuplicateCommandHandlerResolver.resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler) |
MessageHandler<? super CommandMessage<?>> |
FailingDuplicateCommandHandlerResolver.resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler) |
MessageHandler<? super CommandMessage<?>> |
LoggingDuplicateCommandHandlerResolver.resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler) |
MessageHandler<? super CommandMessage<?>> |
LoggingDuplicateCommandHandlerResolver.resolve(String commandName,
MessageHandler<? super CommandMessage<?>> registeredHandler,
MessageHandler<? super CommandMessage<?>> candidateHandler) |
Registration |
CommandBus.subscribe(String commandName,
MessageHandler<? super CommandMessage<?>> handler)
Subscribe the given
handler to commands with the given commandName. |
Registration |
SimpleCommandBus.subscribe(String commandName,
MessageHandler<? super CommandMessage<?>> handler)
Subscribe the given
handler to commands with given commandName. |
| Constructor and Description |
|---|
NoHandlerForCommandException(CommandMessage<?> commandMessage)
Initialize a NoHandlerForCommandException with a message describing the given
CommandMessage. |
| Constructor and Description |
|---|
DuplicateCommandHandlerSubscriptionException(String commandName,
MessageHandler<? super CommandMessage<?>> initialHandler,
MessageHandler<? super CommandMessage<?>> duplicateHandler)
Initialize a duplicate command handler subscription exception using the given
initialHandler and duplicateHandler to form a specific message. |
DuplicateCommandHandlerSubscriptionException(String commandName,
MessageHandler<? super CommandMessage<?>> initialHandler,
MessageHandler<? super CommandMessage<?>> duplicateHandler)
Initialize a duplicate command handler subscription exception using the given
initialHandler and duplicateHandler to form a specific message. |
| Modifier and Type | Method and Description |
|---|---|
void |
NoOpCallback.onResult(CommandMessage<?> commandMessage,
CommandResultMessage<?> commandResultMessage)
Invoked when command handling execution is completed.
|
void |
FutureCallback.onResult(CommandMessage<? extends C> commandMessage,
CommandResultMessage<? extends R> commandResultMessage) |
void |
FailureLoggingCallback.onResult(CommandMessage<? extends C> commandMessage,
CommandResultMessage<? extends R> commandResultMessage) |
void |
LoggingCallback.onResult(CommandMessage message,
CommandResultMessage commandResultMessage) |
| Modifier and Type | Method and Description |
|---|---|
CommandMessage<?> |
DispatchMessage.getCommandMessage(Serializer serializer)
Returns the CommandMessage wrapped in this Message.
|
CommandMessage<C> |
CommandCallbackWrapper.getMessage()
Returns the command message that was sent.
|
| Modifier and Type | Method and Description |
|---|---|
<C> void |
DistributedCommandBus.dispatch(CommandMessage<C> command) |
<C,R> void |
DistributedCommandBus.dispatch(CommandMessage<C> command,
CommandCallback<? super C,? super R> callback)
Dispatch the given
command to the CommandHandler subscribed to the given command's name. |
protected String |
AnnotationRoutingStrategy.doResolveRoutingKey(CommandMessage<?> command) |
protected abstract String |
AbstractRoutingStrategy.doResolveRoutingKey(CommandMessage<?> command)
Resolve the Routing Key for the given
command. |
protected String |
MetaDataRoutingStrategy.doResolveRoutingKey(CommandMessage<?> command) |
Optional<Member> |
CommandRouter.findDestination(CommandMessage<?> message)
Returns the member instance to which the given
message should be routed. |
Optional<Member> |
ConsistentHash.getMember(String routingKey,
CommandMessage<?> commandMessage)
Returns the member instance to which the given
message should be routed. |
String |
UnresolvedRoutingKeyPolicy.getRoutingKey(CommandMessage<?> command) |
String |
AbstractRoutingStrategy.getRoutingKey(CommandMessage<?> command) |
String |
RoutingStrategy.getRoutingKey(CommandMessage<?> command)
Generates a routing key for the given
command. |
boolean |
CommandMessageFilter.matches(CommandMessage<?> commandMessage)
Indicates whether the given
commandMessage matches this filter. |
void |
CommandCallbackWrapper.onResult(CommandMessage<? extends C> message,
CommandResultMessage<? extends R> commandResultMessage) |
<C> void |
CommandBusConnector.send(Member destination,
CommandMessage<? extends C> command)
Sends the given
command to the node assigned to handle messages with the given routingKey. |
<C,R> void |
CommandBusConnector.send(Member destination,
CommandMessage<C> command,
CommandCallback<? super C,R> callback)
Sends the given
command to the node assigned to handle messages with the given routingKey. |
| Modifier and Type | Method and Description |
|---|---|
DistributedCommandBus.Builder |
DistributedCommandBus.Builder.messageMonitor(MessageMonitor<? super CommandMessage<?>> messageMonitor)
Sets the
MessageMonitor for generic types implementing CommandMessage, which is used to
monitor incoming messages and their execution result. |
Registration |
DistributedCommandBus.registerDispatchInterceptor(MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor)
Registers the given list of dispatch interceptors to the command bus.
|
Registration |
DistributedCommandBus.registerHandlerInterceptor(MessageHandlerInterceptor<? super CommandMessage<?>> handlerInterceptor) |
Registration |
CommandBusConnector.subscribe(String commandName,
MessageHandler<? super CommandMessage<?>> handler)
Subscribes a command message handler for commands with given
commandName. |
Registration |
DistributedCommandBus.subscribe(String commandName,
MessageHandler<? super CommandMessage<?>> handler)
Subscribe the given
handler to commands with the given commandName. |
| Constructor and Description |
|---|
CommandCallbackWrapper(A channelId,
CommandMessage<C> message,
CommandCallback<? super C,? super R> callback)
Initializes a
CommandCallbackWrapper which wraps the original callback and holds on to the
command message and channelId of the channel on which the message is sent. |
DispatchMessage(CommandMessage<?> commandMessage,
Serializer serializer,
boolean expectReply)
Initialized a DispatchMessage for the given
commandMessage, which uses the given
serializer to deserialize its contents. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
AndCommandMessageFilter.matches(CommandMessage<?> commandMessage) |
boolean |
NegateCommandMessageFilter.matches(CommandMessage<?> commandMessage) |
boolean |
OrCommandMessageFilter.matches(CommandMessage<?> commandMessage) |
boolean |
DenyCommandNameFilter.matches(CommandMessage<?> commandMessage) |
boolean |
AcceptAll.matches(CommandMessage<?> message) |
boolean |
CommandNameFilter.matches(CommandMessage<?> commandMessage) |
boolean |
DenyAll.matches(CommandMessage<?> message) |
| Modifier and Type | Method and Description |
|---|---|
protected <C> CommandMessage<? extends C> |
AbstractCommandGateway.processInterceptors(CommandMessage<C> commandMessage)
Invokes all the dispatch interceptors and returns the CommandMessage instance that should be dispatched.
|
| Modifier and Type | Method and Description |
|---|---|
protected long |
ExponentialBackOffIntervalRetryScheduler.computeRetryInterval(CommandMessage commandMessage,
RuntimeException lastFailure,
List<Class<? extends Throwable>[]> failures) |
protected abstract long |
AbstractRetryScheduler.computeRetryInterval(CommandMessage commandMessage,
RuntimeException lastFailure,
List<Class<? extends Throwable>[]> failures)
Compute the amount of milliseconds delay until the next retry, given the information passed.
|
protected long |
IntervalRetryScheduler.computeRetryInterval(CommandMessage commandMessage,
RuntimeException lastFailure,
List<Class<? extends Throwable>[]> failures) |
void |
RetryingCallback.onResult(CommandMessage<? extends C> commandMessage,
CommandResultMessage<? extends R> commandResultMessage) |
protected <C> CommandMessage<? extends C> |
AbstractCommandGateway.processInterceptors(CommandMessage<C> commandMessage)
Invokes all the dispatch interceptors and returns the CommandMessage instance that should be dispatched.
|
boolean |
AbstractRetryScheduler.scheduleRetry(CommandMessage commandMessage,
RuntimeException lastFailure,
List<Class<? extends Throwable>[]> failures,
Runnable dispatchTask)
This is the entrypoint of the
RetryScheduler. |
boolean |
RetryScheduler.scheduleRetry(CommandMessage commandMessage,
RuntimeException lastFailure,
List<Class<? extends Throwable>[]> failures,
Runnable commandDispatch)
Inspect the given
commandMessage that failed with given lastFailure. |
| Modifier and Type | Method and Description |
|---|---|
AbstractCommandGateway.Builder |
AbstractCommandGateway.Builder.dispatchInterceptors(List<MessageDispatchInterceptor<? super CommandMessage<?>>> dispatchInterceptors)
|
DefaultCommandGateway.Builder |
DefaultCommandGateway.Builder.dispatchInterceptors(List<MessageDispatchInterceptor<? super CommandMessage<?>>> dispatchInterceptors) |
CommandGatewayFactory.Builder |
CommandGatewayFactory.Builder.dispatchInterceptors(List<MessageDispatchInterceptor<? super CommandMessage<?>>> dispatchInterceptors)
Sets the
MessageDispatchInterceptors which are invoked before dispatching a CommandMessage on
the CommandBus. |
protected Registration |
AbstractCommandGateway.registerDispatchInterceptor(MessageDispatchInterceptor<? super CommandMessage<?>> interceptor)
Registers a command dispatch interceptor within a
CommandGateway. |
Registration |
DefaultCommandGateway.registerDispatchInterceptor(MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor) |
CommandGatewayFactory |
CommandGatewayFactory.registerDispatchInterceptor(MessageDispatchInterceptor<CommandMessage<?>> dispatchInterceptor)
Registers the given
dispatchInterceptor which is invoked for each Command dispatched through the
Command Gateways created by this factory. |
Copyright © 2010–2022. All rights reserved.