}
return call(client);
} catch (IOException ioe) {
exceptions.add(ioe);
if(abort) {
throw new ServiceException(ioe.getMessage(), ioe);
}
if (tries == numRetries - 1) {
throw new ServiceException("Giving up after tries=" + tries, ioe);
}
} catch (Throwable t) {
throw new ServiceException(t);
} finally {
afterCall();
if(closeConn) {
connPool.closeConnection(client);
} else {
connPool.releaseConnection(client);
}
}
try {
Thread.sleep(pause * (tries + 1));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ServiceException("Giving up after tries=" + tries, e);
}
}
return null;
}