Top Description Methods
io.vertx.core.spi.cluster

public Interface NodeSelector

extends VertxServiceProvider
Known Direct Implementers
io.vertx.core.spi.cluster.impl.DefaultNodeSelector
Imports
io.vertx.core.Promise, .Vertx, io.vertx.core.eventbus.Message, io.vertx.core.impl.VertxBuilder, io.vertx.core.spi.VertxServiceProvider

Used by the clustered EventBus to select a node for a given message.

This selector is skipped only when the user raises the io.vertx.core.eventbus.DeliveryOptions#setLocalOnly(boolean) flag. Consequently, implementations must be aware of local io.vertx.core.eventbus.EventBus registrations.

Method Summary

Modifier and TypeMethod and Description
public void
eventBusStarted()

Invoked after the clustered io.vertx.core.eventbus.EventBus has started.

public default void
init(VertxBuilder
the builder
builder
)

Implements io.vertx.core.spi.VertxServiceProvider.init.

Let the provider initialize the Vert.x builder.

public void
init(Vertx vertx, ClusterManager clusterManager)

Invoked before the vertx instance tries to join the cluster.

public void
registrationsLost()

Invoked by the ClusterManager when some handler registrations have been lost.

public void
registrationsUpdated(RegistrationUpdateEvent event)

Invoked by the ClusterManager when messaging handler registrations are added or removed.

public void
selectForPublish(Message<?> message, Promise<Iterable<String>> promise)

Select a node for publishing the given message.

public void
selectForSend(Message<?> message, Promise<String> promise)

Select a node for sending the given message.

public default boolean

Returns:

true if the node selector wants updates for the given address, false otherwise
wantsUpdatesFor
(String
the event bus address
address
)

Invoked by the ClusterManager to determine if the node selector wants updates for the given address.

Method Detail

eventBusStartedback to summary
public void eventBusStarted()

Invoked after the clustered io.vertx.core.eventbus.EventBus has started.

initback to summary
public default void init(VertxBuilder builder)

Implements io.vertx.core.spi.VertxServiceProvider.init.

Doc from io.vertx.core.spi.VertxServiceProvider.init.

Let the provider initialize the Vert.x builder.

Parameters
builder:VertxBuilder

the builder

Annotations
@Override
initback to summary
public void init(Vertx vertx, ClusterManager clusterManager)

Invoked before the vertx instance tries to join the cluster.

registrationsLostback to summary
public void registrationsLost()

Invoked by the ClusterManager when some handler registrations have been lost.

registrationsUpdatedback to summary
public void registrationsUpdated(RegistrationUpdateEvent event)

Invoked by the ClusterManager when messaging handler registrations are added or removed.

selectForPublishback to summary
public void selectForPublish(Message<?> message, Promise<Iterable<String>> promise)

Select a node for publishing the given message.

The provided promise needs to be completed with Promise#tryComplete and Promise#tryFail as it might completed outside the selector.

Exceptions
IllegalArgumentException:
if Message#isSend() returns true
selectForSendback to summary
public void selectForSend(Message<?> message, Promise<String> promise)

Select a node for sending the given message.

The provided promise needs to be completed with Promise#tryComplete and Promise#tryFail as it might completed outside the selector.

Exceptions
IllegalArgumentException:
if Message#isSend() returns false
wantsUpdatesForback to summary
public default boolean wantsUpdatesFor(String address)

Invoked by the ClusterManager to determine if the node selector wants updates for the given address.

Parameters
address:String

the event bus address

Returns:boolean

true if the node selector wants updates for the given address, false otherwise