// Path: disconf-core/src/main/java/com/baidu/disconf/core/common/utils/http/impl/HttpResponseCallbackHandlerJsonHandler.java
// public class HttpResponseCallbackHandlerJsonHandler<T> implements HttpResponseCallbackHandler<T> {
// 
//     private Class<T> clazz = null;
// 
//     public HttpResponseCallbackHandlerJsonHandler(Class<T> clazz) {
//         this.clazz = clazz;
//     }
// 
//     @Override
//     public T handleResponse(String requestBody, HttpEntity entity) throws IOException {
// 
//         String json = EntityUtils.toString(entity, "UTF-8");
// 
//         com.google.gson.Gson gson = new com.google.gson.Gson();
//         T response = gson.fromJson(json, clazz);
// 
//         return response;
//     }
// }


import java.net.URL;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpRequestBase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.baidu.disconf.core.common.restful.core.UnreliableInterface;
import com.baidu.disconf.core.common.utils.http.impl.HttpResponseCallbackHandlerJsonHandler;
import com.baidu.disconf.core.common.utils.http.HttpClientUtil;
import com.baidu.disconf.core.common.utils.http.HttpResponseCallbackHandler;
package com.baidu.disconf.core.common.restful.type;




/**
 * RestFul get
 *
 * @author liaoqiqi
 * @version 2014-6-16
 */
public class RestfulGet<T> implements UnreliableInterface {

    protected static final Logger LOGGER = LoggerFactory.getLogger(RestfulGet.class);

    private HttpRequestBase request = null;
    private HttpResponseCallbackHandler<T> httpResponseCallbackHandler = null;

    public RestfulGet(Class<T> clazz, URL url) {

        HttpGet request = new HttpGet(url.toString());
        request.addHeader("content-type", "application/json");
        this.request = request;
        this.httpResponseCallbackHandler = new
// Path: disconf-core/src/main/java/com/baidu/disconf/core/common/utils/http/impl/HttpResponseCallbackHandlerJsonHandler.java
// public class HttpResponseCallbackHandlerJsonHandler<T> implements HttpResponseCallbackHandler<T> {
// 
//     private Class<T> clazz = null;
// 
//     public HttpResponseCallbackHandlerJsonHandler(Class<T> clazz) {
//         this.clazz = clazz;
//     }
// 
//     @Override
//     public T handleResponse(String requestBody, HttpEntity entity) throws IOException {
// 
//         String json = EntityUtils.toString(entity, "UTF-8");
// 
//         com.google.gson.Gson gson = new com.google.gson.Gson();
//         T response = gson.fromJson(json, clazz);
// 
//         return response;
//     }
// }


// Path: disconf-core/src/main/java/com/baidu/disconf/core/common/restful/type/RestfulGet.java
import java.net.URL;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpRequestBase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.baidu.disconf.core.common.restful.core.UnreliableInterface;
import com.baidu.disconf.core.common.utils.http.impl.HttpResponseCallbackHandlerJsonHandler;
import com.baidu.disconf.core.common.utils.http.HttpClientUtil;
import com.baidu.disconf.core.common.utils.http.HttpResponseCallbackHandler;

package com.baidu.disconf.core.common.restful.type;




/**
 * RestFul get
 *
 * @author liaoqiqi
 * @version 2014-6-16
 */
public class RestfulGet<T> implements UnreliableInterface {

    protected static final Logger LOGGER = LoggerFactory.getLogger(RestfulGet.class);

    private HttpRequestBase request = null;
    private HttpResponseCallbackHandler<T> httpResponseCallbackHandler = null;

    public RestfulGet(Class<T> clazz, URL url) {

        HttpGet request = new HttpGet(url.toString());
        request.addHeader("content-type", "application/json");
        this.request = request;
        this.httpResponseCallbackHandler = new
                HttpResponseCallbackHandlerJsonHandler<T>(clazz);