com.github.easilyuse.core.util.HttpClientServiceUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easily-http Show documentation
Show all versions of easily-http Show documentation
Easy implementation of http client remote calls through annotations
The newest version!
package com.github.easilyuse.core.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.easilyuse.core.proxy.HttpClientCglibProxy;
import com.github.easilyuse.core.proxy.HttpClientProxy;
/**
*
*
* Title:HttpClientServiceUtil
*
*
* Description: http接口服务实现工具类
*
*
* @author linyb
*/
public class HttpClientServiceUtil {
private static Logger logger = LoggerFactory.getLogger(HttpClientServiceUtil.class);
private HttpClientServiceUtil() {
}
public static HttpClientServiceUtil getInstance() {
return Singleton.INSTANCE.getInstance();
}
private static enum Singleton {
INSTANCE;
private HttpClientServiceUtil client;
private Singleton() {
client = new HttpClientServiceUtil();
}
public HttpClientServiceUtil getInstance() {
return client;
}
}
public T getService(Class clz) {
return (T) HttpClientCglibProxy.newInstance(clz);
}
public T getService(Class[] interfaces) {
return (T) HttpClientProxy.newInstance(interfaces);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy