protected final boolean parseResponseAndAddToResponseList(Object responseObject, Throwable exception, Map<Address, Response> responseListToAddTo, boolean wasSuspected,
boolean wasReceived, Address sender, boolean usedResponseFilter, boolean ignoreLeavers)
throws Exception
{
Log log = getLog();
boolean invalidResponse = true;
if (!wasSuspected && wasReceived) {
invalidResponse = false;
if (exception != null) {
log.tracef(exception, "Unexpected exception from %s", sender);
throw new CacheException("Remote (" + sender + ") failed unexpectedly", exception);
}
if (checkResponse(responseObject, sender)) responseListToAddTo.put(sender, (Response) responseObject);
} else if (wasSuspected) {
if (!ignoreLeavers) {
throw new SuspectException("Suspected member: " + sender, sender);
} else {
log.tracef("Target node %s left during remote call, ignoring", sender);
}
} else {
// if we have a response filter then we may not have waited for some nodes!
if (!usedResponseFilter) throw new TimeoutException("Replication timeout for " + sender);
}