for (int i = 0; i < members.size() - 1; ++i) {
try {
decs.take().get();
} catch (InterruptedException e) {
throw new CacheListenerException(e);
} catch (ExecutionException e) {
throw new CacheListenerException(e);
}
}
int extraCount = 0;
// If anyone else joined since we sent these we have to send the listeners again, since they may have queried
// before the other nodes got the new listener
List<Address> membersAfter = manager.getMembers();
for (Address member : membersAfter) {
if (!members.contains(member) && !member.equals(ourAddress)) {
if (log.isTraceEnabled()) {
log.tracef("Found additional node %s that joined during replication of cluster listener with id %s",
member, generatedId);
}
extraCount++;
decs.submit(member, callable);
}
}
for (int i = 0; i < extraCount; ++i) {
try {
decs.take().get();
} catch (InterruptedException e) {
throw new CacheListenerException(e);
} catch (ExecutionException e) {
throw new CacheListenerException(e);
}
}
}
}
}