Top Fields Constructors Methods
io.vertx.core.spi.cluster.impl

public Class DefaultNodeSelector

extends Object
implements NodeSelector
Class Inheritance
All Implemented Interfaces
io.vertx.core.spi.cluster.NodeSelector, io.vertx.core.spi.VertxServiceProvider
Imports
io.vertx.core.Promise, .Vertx, io.vertx.core.eventbus.Message, io.vertx.core.impl.Arguments, io.vertx.core.spi.cluster.ClusterManager, .NodeSelector, .RegistrationUpdateEvent, io.vertx.core.spi.cluster.impl.selector.Selectors

Author
Thomas Segismont

Field Summary

Modifier and TypeField and Description
private Selectors

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
init(Vertx vertx, ClusterManager clusterManager)

Implements io.vertx.core.spi.cluster.NodeSelector.init.

Invoked before the vertx instance tries to join the cluster.

public void
registrationsLost()

Implements io.vertx.core.spi.cluster.NodeSelector.registrationsLost.

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

public void
registrationsUpdated(RegistrationUpdateEvent event)

Implements io.vertx.core.spi.cluster.NodeSelector.registrationsUpdated.

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

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

Implements io.vertx.core.spi.cluster.NodeSelector.selectForPublish.

Select a node for publishing the given message.

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

Implements io.vertx.core.spi.cluster.NodeSelector.selectForSend.

Select a node for sending the given message.

public boolean
wantsUpdatesFor(String
the event bus address
address
)

Overrides default io.vertx.core.spi.cluster.NodeSelector.wantsUpdatesFor.

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

selectorsback to summary
private Selectors selectors

Constructor Detail

DefaultNodeSelectorback to summary
public DefaultNodeSelector()

Method Detail

eventBusStartedback to summary
public void eventBusStarted()

Implements io.vertx.core.spi.cluster.NodeSelector.eventBusStarted.

Doc from io.vertx.core.spi.cluster.NodeSelector.eventBusStarted.

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

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

Implements io.vertx.core.spi.cluster.NodeSelector.init.

Doc from io.vertx.core.spi.cluster.NodeSelector.init.

Invoked before the vertx instance tries to join the cluster.

Annotations
@Override
registrationsLostback to summary
public void registrationsLost()

Implements io.vertx.core.spi.cluster.NodeSelector.registrationsLost.

Doc from io.vertx.core.spi.cluster.NodeSelector.registrationsLost.

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

Annotations
@Override
registrationsUpdatedback to summary
public void registrationsUpdated(RegistrationUpdateEvent event)

Implements io.vertx.core.spi.cluster.NodeSelector.registrationsUpdated.

Doc from io.vertx.core.spi.cluster.NodeSelector.registrationsUpdated.

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

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

Implements io.vertx.core.spi.cluster.NodeSelector.selectForPublish.

Doc from io.vertx.core.spi.cluster.NodeSelector.selectForPublish.

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.

Annotations
@Override
selectForSendback to summary
public void selectForSend(Message<?> message, Promise<String> promise)

Implements io.vertx.core.spi.cluster.NodeSelector.selectForSend.

Doc from io.vertx.core.spi.cluster.NodeSelector.selectForSend.

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.

Annotations
@Override
wantsUpdatesForback to summary
public boolean wantsUpdatesFor(String address)

Overrides default io.vertx.core.spi.cluster.NodeSelector.wantsUpdatesFor.

Doc from io.vertx.core.spi.cluster.NodeSelector.wantsUpdatesFor.

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

Annotations
@Override