use of org.infinispan.notifications.cachemanagerlistener.annotation.Merged in project wildfly by wildfly.
the class CacheGroup method viewChanged.
@Merged
@ViewChanged
public CompletionStage<Void> viewChanged(ViewChangedEvent event) {
if (this.cache.getAdvancedCache().getDistributionManager() != null) {
// Record view status for use by @TopologyChanged event
this.views.put(event.getViewId(), event.isMergeView());
} else {
Membership previousMembership = new CacheMembership(event.getLocalAddress(), event.getOldMembers(), this);
Membership membership = new CacheMembership(event.getLocalAddress(), event.getNewMembers(), this);
for (Map.Entry<GroupListener, ExecutorService> entry : this.listeners.entrySet()) {
GroupListener listener = entry.getKey();
ExecutorService executor = entry.getValue();
Runnable listenerTask = new Runnable() {
@Override
public void run() {
try {
listener.membershipChanged(previousMembership, membership, event.isMergeView());
} catch (Throwable e) {
ClusteringServerLogger.ROOT_LOGGER.warn(e.getLocalizedMessage(), e);
}
}
};
try {
executor.submit(listenerTask);
} catch (RejectedExecutionException e) {
// Listener was unregistered
}
}
}
return CompletableFutures.completedNull();
}
Aggregations