// Get the ICPs suitable for the given TransportAddress.
List list = (List) icps.get(ta.getProto().toLowerCase());
if (list == null) {
throw new UnreachableException("no ICP suitable for protocol "+ta.getProto()+".");
}
ICPException lastException = null;
for (int i = 0; i < list.size(); i++) {
try {
return ((ICP) list.get(i)).deliverCommand(ta, commandPayload, requireFreshConnection);
}
catch (ICPException icpe) {
lastException = icpe;
// DEBUG
// Print a warning and try next address
//System.out.println("Warning: can't deliver command to "+ta+". "+icpe.getMessage());
}
}
throw new UnreachableException("ICPException delivering command to address "+ta+".", lastException);
}