Interface BroadcastConsumerBabelProtocol
- All Superinterfaces:
BabelProtocol
Marker interface for protocols that consume a broadcast service.
A protocol implementing this interface can:
- Call
broadcast(Babel, BabelMessage)to send a message to all members of the overlay via the configured broadcast provider. - Annotate methods with
@UponBroadcastDeliverto receive messages delivered by the broadcast provider.
For the annotation handling to work, a
BroadcastConsumerExtensionFactory must be registered with the
BabelBootstrap for
this protocol class.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidbroadcast(Babel runtime, BabelMessage message) Sendsmessageto all members of the overlay by routing aBroadcastRequestevent to the registered broadcast provider.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
-
broadcast
Sendsmessageto all members of the overlay by routing aBroadcastRequestevent to the registered broadcast provider.- Parameters:
runtime- theBabelruntime used to dispatch the requestmessage- the message to broadcast
-