use of org.jgroups.MergeView in project wildfly by wildfly.
the class ChannelCommandDispatcherFactory method viewAccepted.
@Override
public void viewAccepted(View view) {
View oldView = this.view.getAndSet(view);
if (oldView != null) {
List<Node> oldNodes = this.getNodes(oldView);
List<Node> newNodes = this.getNodes(view);
List<Address> leftMembers = View.leftMembers(oldView, view);
if (leftMembers != null) {
this.nodeFactory.invalidate(leftMembers);
}
for (Map.Entry<Listener, ExecutorService> entry : this.listeners.entrySet()) {
try {
Listener listener = entry.getKey();
ExecutorService executor = entry.getValue();
executor.submit(() -> {
try {
listener.membershipChanged(oldNodes, newNodes, view instanceof MergeView);
} catch (Throwable e) {
ClusteringLogger.ROOT_LOGGER.warn(e.getLocalizedMessage(), e);
}
});
} catch (RejectedExecutionException e) {
// Executor was shutdown
}
}
}
}
Aggregations