public class DefaultNodeSelector extends Object implements NodeSelector
| Constructor and Description |
|---|
DefaultNodeSelector() |
| Modifier and Type | Method and Description |
|---|---|
void |
eventBusStarted()
Invoked after the clustered
EventBus has started. |
void |
init(Vertx vertx,
ClusterManager clusterManager)
Invoked before the
vertx instance tries to join the cluster. |
void |
registrationsLost()
Invoked by the
ClusterManager when some handler registrations have been lost. |
void |
registrationsUpdated(RegistrationUpdateEvent event)
Invoked by the
ClusterManager when messaging handler registrations are added or removed. |
void |
selectForPublish(Message<?> message,
Promise<Iterable<String>> promise)
Select a node for publishing the given
message. |
void |
selectForSend(Message<?> message,
Promise<String> promise)
Select a node for sending the given
message. |
boolean |
wantsUpdatesFor(String address)
Invoked by the
ClusterManager to determine if the node selector wants updates for the given address. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitpublic void init(Vertx vertx, ClusterManager clusterManager)
NodeSelectorvertx instance tries to join the cluster.init in interface NodeSelectorpublic void eventBusStarted()
NodeSelectorEventBus has started.eventBusStarted in interface NodeSelectorpublic void selectForSend(Message<?> message, Promise<String> promise)
NodeSelectormessage.
The provided promise needs to be completed with Promise.tryComplete(T) and Promise.tryFail(java.lang.Throwable)
as it might completed outside the selector.
selectForSend in interface NodeSelectorpublic void selectForPublish(Message<?> message, Promise<Iterable<String>> promise)
NodeSelectormessage.
The provided promise needs to be completed with Promise.tryComplete(T) and Promise.tryFail(java.lang.Throwable)
as it might completed outside the selector.
selectForPublish in interface NodeSelectorpublic void registrationsUpdated(RegistrationUpdateEvent event)
NodeSelectorClusterManager when messaging handler registrations are added or removed.registrationsUpdated in interface NodeSelectorpublic void registrationsLost()
NodeSelectorClusterManager when some handler registrations have been lost.registrationsLost in interface NodeSelectorpublic boolean wantsUpdatesFor(String address)
NodeSelectorClusterManager to determine if the node selector wants updates for the given address.wantsUpdatesFor in interface NodeSelectoraddress - the event bus addresstrue if the node selector wants updates for the given address, false otherwiseCopyright © 2021. All rights reserved.