UnicastBus

public abstract class UnicastBus<T extends Signal<?, ?, ?>, E extends SignalEnvelope<? extends Object, T, ? extends Object>, C extends MessageClass<? extends Message>, D extends MessageDispatcher<C, E>> extends Bus<T, E, C, D>

A bus which delivers a message to one dispatcher.

See also

Inheritors

Constructors

Link copied to clipboard
protected void UnicastBus(BusBuilder<? extends Object, T, E, C, D> builder)

Functions

Link copied to clipboard
protected D dispatcherOf(E envelope)

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 abstract DeadMessageHandler<E> deadMessageHandler()
Obtains the instance of DeadMessageHandler for this bus.
Link copied to clipboard
protected abstract void dispatch(E envelope)
Passes the given envelope for dispatching.
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
protected StreamObserver<Ack> prepareObserver(Iterable<T> messages, StreamObserver<Ack> source)
Prepares the given StreamObserver to post messages into this bus.
Link copied to clipboard
public void register(D dispatcher)
Registers the passed dispatcher.
Link copied to clipboard
protected DispatcherRegistry<C, E, D> registry()
Obtains the dispatcher registry.
Link copied to clipboard
A callback for derived classes to modify the order of filters used by the bus.
Link copied to clipboard
protected abstract void store(Iterable<T> messages)
Stores the given messages into the underlying storage.
Link copied to clipboard
protected abstract E toEnvelope(T message)
Packs the given message of type T into an envelope of type E.
Link copied to clipboard
public void unregister(D dispatcher)
Unregisters dispatching for message classes of the passed dispatcher.
Link copied to clipboard
protected abstract EnvelopeValidator<E> validator()
Obtains the instance of EnvelopeValidator for this bus.