@Override
    public void execute(HttpClient hc, HttpMethod hm, int maxRetryAm) throws IOException {
        if (maxRetryAm <= 0) {
            maxRetryAm = Integer.MAX_VALUE;
        }
        int curAttempt = 0;
        while (true) {
            try {
                if (logger.isEnabled(Level.DEBUG)) {
                    logger.log(Level.DEBUG, "Attempting to call " + hm + " for attempt " + (curAttempt + 1) + " of " + maxRetryAm);
                }
                handleRedirects(hc, hm, 0, maxRedirAm);
                // it worked if we got here..
                if (logger.isEnabled(Level.DEBUG)) {
                    logger.log(Level.DEBUG, "Attempting to call " + hm + " worked at attempt " + (curAttempt + 1) + " of " + maxRetryAm);
                }
                // stop
                break;
            }
            catch (IOException e) {
                if (logger.isEnabled(Level.WARN)) {
                    logger.log(Level.WARN, e, "Failed calling " + hm + " during attempt " + (curAttempt + 1) + " of " + maxRetryAm);
                }
                if ((curAttempt + 1) < maxRetryAm) {
                    curAttempt += 1;
                }
                else {
                    // retries ran out...
                    throw e;
                }
            }
        }
    }