M
- the type of outer objects (containing messages of interest) that are posted to the busE
- the type of envelopes for outer objects used by this busC
- the type of message classD
- the type of dispatches used by this buspublic abstract class MulticastBus<M extends io.spine.core.Signal<?,?,?>,E extends SignalEnvelope<?,M,?>,C extends io.spine.type.MessageClass<? extends com.google.protobuf.Message>,D extends MessageDispatcher<C,E>> extends Bus<M,E,C,D>
Bus
, which delivers a single message to multiple dispatchers.Modifier | Constructor and Description |
---|---|
protected |
MulticastBus(BusBuilder<?,M,E,C,D> builder) |
Modifier and Type | Method and Description |
---|---|
protected int |
callDispatchers(E messageEnvelope)
Call the dispatchers for the
messageEnvelope . |
protected void |
onDispatched(io.spine.core.SignalId signal)
Called after the dispatching of the signal to all of the target dispatchers
has been completed.
|
protected void |
onDispatchingStarted(io.spine.core.SignalId signal)
Called before the dispatching of the signal with the passed ID is started.
|
close, deadMessageHandler, dispatch, hasFilter, hasListener, isOpen, post, post, prepareObserver, register, registry, setupFilters, store, toEnvelope, unregister, validator
protected MulticastBus(BusBuilder<?,M,E,C,D> builder)
protected int callDispatchers(E messageEnvelope)
messageEnvelope
.messageEnvelope
- the message envelope to pass to the dispatchers0
if there weren't anyprotected final void onDispatchingStarted(io.spine.core.SignalId signal)
Bus
Descendants may override this method and define their own logic on handling the dispatching lifecycle.
onDispatchingStarted
in class Bus<M extends io.spine.core.Signal<?,?,?>,E extends SignalEnvelope<?,M,?>,C extends io.spine.type.MessageClass<? extends com.google.protobuf.Message>,D extends MessageDispatcher<C,E>>
signal
- the ID of the signal being dispatchedBus.onDispatched(SignalId)
protected final void onDispatched(io.spine.core.SignalId signal)
Bus
This method is called even if the dispatching of the message has failed.
Descendants may override this method and define their own logic on handling the dispatching lifecycle.
onDispatched
in class Bus<M extends io.spine.core.Signal<?,?,?>,E extends SignalEnvelope<?,M,?>,C extends io.spine.type.MessageClass<? extends com.google.protobuf.Message>,D extends MessageDispatcher<C,E>>
signal
- the ID of the dispatched signalBus.onDispatchingStarted(SignalId)