CommandBus

public final class CommandBus extends UnicastBus<T, E, C, D>

Dispatches the incoming commands to the corresponding handler.

Types

Link copied to clipboard
public class Builder extends BusBuilder<B, T, E, C, D>
The Builder for CommandBus.

Functions

Link copied to clipboard
Obtains the instance of DeadMessageHandler for this bus.
Link copied to clipboard
protected void dispatch(CommandEnvelope command)
Passes the given envelope for dispatching.
Link copied to clipboard
public void initObservers(EventBus eventBus)
Initializes the immediateRejectionObserver with the passed EventBus.
Link copied to clipboard
public final boolean isMultitenant()
Link copied to clipboard
Creates a new Builder for the CommandBus.
Link copied to clipboard
protected StreamObserver<Ack> prepareObserver(Iterable<Command> commands, StreamObserver<Ack> source)
Prepares the given to post messages into this bus.
Link copied to clipboard
Obtains the view Set of commands that are known to this CommandBus.
Link copied to clipboard
protected CommandDispatcherRegistry registry()
Obtains the dispatcher registry.
Link copied to clipboard
Places a CommandReceivedTap first and a CommandScheduler last in the filter chain.
Link copied to clipboard
protected void store(Iterable<Command> commands)
Stores the given messages into the underlying storage.
Link copied to clipboard
protected CommandEnvelope toEnvelope(Command message)
Packs the given message of type T into an envelope of type E.
Link copied to clipboard
Obtains the instance of EnvelopeValidator for this bus.

Inherited functions

Link copied to clipboard
public void checkOpen()
Ensures that the object is open.
Link copied to clipboard
public void close()
Closes the filters of this bus and unregisters all the dispatchers.
public abstract void close()
Link copied to clipboard
protected D dispatcherOf(E envelope)
Link copied to clipboard
public boolean hasFilter(BusFilter<E> filter)
Link copied to clipboard
public boolean hasListener(Listener<E> listener)
Link copied to clipboard
public final boolean isOpen()
Tells if this bus can accept messages for posting.
Link copied to clipboard
protected void onDispatched(SignalId signal)
Called after the dispatching of the signal to all of the target dispatchers has been completed.
Link copied to clipboard
protected void onDispatchingStarted(SignalId signal)
Called before the dispatching of the signal with the passed ID is started.
Link copied to clipboard
public final void post(T message, StreamObserver<Ack> observer)
Posts the message to the bus.
public final void post(Iterable<T> messages, StreamObserver<Ack> observer)
Posts the given messages to the bus.
Link copied to clipboard
public void register(D dispatcher)
Registers the passed dispatcher.
Link copied to clipboard
public void unregister(D dispatcher)
Unregisters dispatching for message classes of the passed dispatcher.