response = sendMessage(constructMessage(buf, a), opts);
if (log.isTraceEnabled()) {
log.trace("Received response: " + response);
}
} catch (org.jgroups.TimeoutException e) {
throw new TimeoutException("Timeout!", e);
}
filter.isAcceptable(response, a);
if (!filter.needMoreResponses()) {
retval = new RspList(Collections.singleton(new Rsp(a, response)));
break;
}
}
} else if (mode == GroupRequest.GET_ALL) {
// A SYNC call that needs to go everywhere
Map<Address, Future<Object>> futures = new HashMap<Address, Future<Object>>(targets.size());
for (Address dest : targets) futures.put(dest, sendMessageWithFuture(constructMessage(buf, dest), opts));
retval = new RspList();
// a get() on each future will block till that call completes.
for (Map.Entry<Address, Future<Object>> entry : futures.entrySet()) {
try {
retval.addRsp(entry.getKey(), entry.getValue().get(timeout, MILLISECONDS));
} catch (java.util.concurrent.TimeoutException te) {
throw new TimeoutException(formatString("Timed out after {0} waiting for a response from {1}",
prettyPrintTime(timeout), entry.getKey()));
}
}
} else if (mode == GroupRequest.GET_NONE) {