|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.commandhandling.distributed.DistributedCommandBus
public class DistributedCommandBus
Implementation of a CommandBus that is aware of multiple instances of a CommandBus working together to
spread load. Each "physical" CommandBus instance is considered a "segment" of a conceptual distributed CommandBus.
CommandBusConnector to dispatch commands and replies to different
segments of the CommandBus. Depending on the implementation used, each segment may run in a different JVM.
| Constructor Summary | |
|---|---|
DistributedCommandBus(CommandBusConnector connector)
Initializes the command bus with the given connector and an AnnotationRoutingStrategy. |
|
DistributedCommandBus(CommandBusConnector connector,
RoutingStrategy routingStrategy)
Initializes the command bus with the given connector and routingStrategy. |
|
| Method Summary | ||
|---|---|---|
void |
dispatch(org.axonframework.commandhandling.CommandMessage<?> command)
|
|
|
dispatch(org.axonframework.commandhandling.CommandMessage<?> command,
org.axonframework.commandhandling.CommandCallback<R> callback)
|
|
void |
setCommandDispatchInterceptors(Collection<org.axonframework.commandhandling.CommandDispatchInterceptor> newDispatchInterceptors)
Sets the interceptors that intercept commands just prior to dispatching them. |
|
|
subscribe(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> handler)
In the DistributedCommandBus, the handler is subscribed to the local segment only. |
|
|
unsubscribe(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> handler)
In the DistributedCommandBus, the handler is unsubscribed from the local segment only. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DistributedCommandBus(CommandBusConnector connector)
connector and an AnnotationRoutingStrategy.
connector - the connector that connects the different command bus segments
public DistributedCommandBus(CommandBusConnector connector,
RoutingStrategy routingStrategy)
connector and routingStrategy. The
routingStrategy is used to calculate a routing key for each dispatched command. For a given
configuration of segments, commands resulting in the same routing key are routed to the same segment.
connector - the connector that connects the different command bus segmentsroutingStrategy - the RoutingStrategy to define routing keys for each command| Method Detail |
|---|
public void dispatch(org.axonframework.commandhandling.CommandMessage<?> command)
dispatch in interface org.axonframework.commandhandling.CommandBusCommandDispatchException - when an error occurs while dispatching the command to a segment
public <R> void dispatch(org.axonframework.commandhandling.CommandMessage<?> command,
org.axonframework.commandhandling.CommandCallback<R> callback)
dispatch in interface org.axonframework.commandhandling.CommandBusCommandDispatchException - when an error occurs while dispatching the command to a segment
public <C> void subscribe(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> handler)
subscribe in interface org.axonframework.commandhandling.CommandBus
public <C> boolean unsubscribe(String commandName,
org.axonframework.commandhandling.CommandHandler<? super C> handler)
unsubscribe in interface org.axonframework.commandhandling.CommandBuspublic void setCommandDispatchInterceptors(Collection<org.axonframework.commandhandling.CommandDispatchInterceptor> newDispatchInterceptors)
newDispatchInterceptors - The interceptors to intercepts commands with
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||