use of io.vertx.core.spi.cluster.RegistrationInfo in project vert.x by eclipse.
the class Selectors method computeAccessible.
private List<String> computeAccessible(List<RegistrationInfo> registrations) {
if (registrations == null || registrations.isEmpty()) {
return Collections.emptyList();
}
ArrayList<String> list = new ArrayList<>(registrations.size());
for (RegistrationInfo registration : registrations) {
if (isAccessible(registration)) {
String nodeId = registration.nodeId();
list.add(nodeId);
}
}
list.trimToSize();
return list;
}
use of io.vertx.core.spi.cluster.RegistrationInfo in project vert.x by eclipse.
the class ClusteredEventBus method onLocalUnregistration.
@Override
protected <T> void onLocalUnregistration(HandlerHolder<T> handlerHolder, Promise<Void> completionHandler) {
if (!handlerHolder.isReplyHandler()) {
RegistrationInfo registrationInfo = new RegistrationInfo(nodeId, handlerHolder.getSeq(), handlerHolder.isLocalOnly());
Promise<Void> promise = Promise.promise();
clusterManager.removeRegistration(handlerHolder.getHandler().address, registrationInfo, promise);
promise.future().onComplete(completionHandler);
} else {
completionHandler.complete();
}
}
use of io.vertx.core.spi.cluster.RegistrationInfo in project vert.x by eclipse.
the class ClusteredEventBus method onLocalRegistration.
@Override
protected <T> void onLocalRegistration(HandlerHolder<T> handlerHolder, Promise<Void> promise) {
if (!handlerHolder.isReplyHandler()) {
RegistrationInfo registrationInfo = new RegistrationInfo(nodeId, handlerHolder.getSeq(), handlerHolder.isLocalOnly());
clusterManager.addRegistration(handlerHolder.getHandler().address, registrationInfo, Objects.requireNonNull(promise));
} else if (promise != null) {
promise.complete();
}
}
Aggregations