public <T> T getJsonData(Class<T> clazz, RemoteUrl remoteUrl, int retryTimes, int retrySleepSeconds)
            throws Exception {
        Exception ex = null;
        for (URL url : remoteUrl.getUrls()) {

            // 可重试的下载
            UnreliableInterface unreliableImpl = new RestfulGet<T>(clazz, url);

            try {

                T t = retryStrategy.retry(unreliableImpl, retryTimes, retrySleepSeconds);

                return t;

            } catch (Exception e) {
                ex = e;
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e1) {
                    LOGGER.info("pass");
                }
            }
        }

        throw new Exception("cannot get: " + remoteUrl, ex);
    }
public < T > T getJsonData ( Class < T > clazz , RemoteUrl remoteUrl , int retryTimes , int retrySleepSeconds ) throws Exception { Exception ex = null ; for ( URL url : remoteUrl . getUrls ( ) ) { UnreliableInterface unreliableImpl = new RestfulGet < T > ( clazz , url ) ; try { T t = retryStrategy . retry ( unreliableImpl , retryTimes , retrySleepSeconds ) ; return t ; } catch ( Exception e ) { ex = e ; try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e1 ) { LOGGER . info ( "pass" ) ; } } } throw new Exception ( "cannot get: " + remoteUrl , ex ) ; }
获取JSON数据

@param clazz
@param remoteUrl

@return

@throws Exception