AbstractCommandDispatcher

public abstract class AbstractCommandDispatcher implements CommandDispatcher, ContextAware

The abstract base for non-aggregate classes that dispatch commands to their methods and post resulting events to EventBus.

Inheritors

Constructors

Link copied to clipboard

Functions

Link copied to clipboard
public boolean equals(Object o)
Indicates whether some other command handler is "equal to" this one.
Link copied to clipboard
public int hashCode()
Link copied to clipboard
public String id()
Obtains identity string of the dispatcher.
Link copied to clipboard
public boolean isRegistered()
Determines if this instance is already registered with a Bounded Context.
Link copied to clipboard
protected void onError(SignalEnvelope<? extends Object, ? extends Object, ? extends Object> signal, Error error)
Link copied to clipboard
protected void onRejection(SignalEnvelope<? extends Object, ? extends Object, ? extends Object> signal, Event rejection)
Link copied to clipboard
protected void postEvents(Iterable<Event> events)
Posts passed events to EventBus.
Link copied to clipboard
public Any producerId()
Obtains ID packed into Any for being used in generated events.
Link copied to clipboard
public void registerWith(BoundedContext context)
Registers this instance as a part of the given Bounded Context.

Inherited functions

Link copied to clipboard
public boolean canDispatch(E envelope)
Checks if this dispatcher can dispatch the given message.
Link copied to clipboard
public void checkNotRegistered()
Verifies that this instance is NOT registered yet.
Link copied to clipboard
public void checkRegistered()
Verifies that this instance is already registered.
Link copied to clipboard
public abstract DispatchOutcome dispatch(E envelope)
Dispatches the message contained in the passed envelope and returns the outcome.
Link copied to clipboard
public boolean dispatchesCommands()
Verifies if this instance dispatches at least one command.
Link copied to clipboard
public abstract ImmutableSet<C> messageClasses()
Obtains a set of message classes that can be processed by this dispatcher.