Interface BroadcastProviderBabelProtocol
- All Superinterfaces:
BabelProtocol
Interface for protocols that implement a broadcast service.
A broadcast provider receives BroadcastRequest events from consumer
protocols (via the BroadcastProviderExtension), performs the actual
dissemination (e.g., gossip, flooding, tree-based multicast), and calls
deliverMessage(Babel, BabelMessage, BabelNode) for each message that should be delivered to the
local consumers.
To wire up a provider, register a BroadcastProviderExtensionFactory
(or BroadcastProviderExtension.newFactory()) with the
BabelBootstrap.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddeliverMessage(Babel runtime, BabelMessage message, BabelNode node) Delivers a broadcast-received message to all local consumer protocols by dispatching aBroadcastDeliverEventthrough the runtime.voiduponBroadcastRequest(BabelMessage message) Called by theBroadcastProviderExtensionwhen a consumer protocol requests thatmessagebe broadcast to all overlay members.Methods inherited from interface BabelProtocol
connectionDown, connectionFailed, connectionUp, init, pause, resume, stopModifier and TypeMethodDescriptiondefault voidconnectionDown(BabelNode peer, @Nullable Throwable cause) Invoked when a previously established connection topeerhas been closed, either locally or remotely.default voidconnectionFailed(BabelNode peer, @Nullable Throwable cause) Invoked when an outgoing connection attempt topeerfailed before a connection could be established.default voidconnectionUp(BabelNode peer) Invoked when an outgoing connection topeerhas been established successfully through the protocol's assignedBabelChannel.default voidinit(Babel runtime, ComposedBabelChannel channel) Initiates the protocol's logic and execution.default voidpause()Suspends the protocol's operations.default voidresume(Babel runtime, ComposedBabelChannel channel) Reinstates the protocol's execution from a paused state.default voidstop()Completely halt the protocols execution.
-
Method Details
-
uponBroadcastRequest
Called by theBroadcastProviderExtensionwhen a consumer protocol requests thatmessagebe broadcast to all overlay members.- Parameters:
message- the message to disseminate
-
deliverMessage
Delivers a broadcast-received message to all local consumer protocols by dispatching aBroadcastDeliverEventthrough the runtime.- Parameters:
runtime- theBabelruntime used to dispatch the delivery eventmessage- the message to deliver locallynode- the original sender of the broadcast
-