类 HttpClientBeanHolder
- java.lang.Object
-
- com.alibaba.nacos.common.http.HttpClientBeanHolder
-
public final class HttpClientBeanHolder extends java.lang.ObjectCreate a rest template to ensure that each custom client config and rest template are in one-to-one correspondence.- 作者:
- mai.jh
-
-
字段概要
字段 修饰符和类型 字段 说明 private static java.util.concurrent.atomic.AtomicBooleanALREADY_SHUTDOWNprivate static org.slf4j.LoggerLOGGERprivate static java.util.Map<java.lang.String,NacosAsyncRestTemplate>SINGLETON_ASYNC_RESTprivate static java.util.Map<java.lang.String,NacosRestTemplate>SINGLETON_REST
-
构造器概要
构造器 构造器 说明 HttpClientBeanHolder()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static NacosAsyncRestTemplategetNacosAsyncRestTemplate(HttpClientFactory httpClientFactory)static NacosAsyncRestTemplategetNacosAsyncRestTemplate(org.slf4j.Logger logger)static NacosRestTemplategetNacosRestTemplate(HttpClientFactory httpClientFactory)static NacosRestTemplategetNacosRestTemplate(org.slf4j.Logger logger)private static voidshutdown()Shutdown common http client.static voidshutdown(java.lang.String className)Shutdown http client holder and close remove template.static voidshutdownNacosAsyncRest(java.lang.String className)Shutdown async http client holder and remove template.static voidshutdownNacostSyncRest(java.lang.String className)Shutdown sync http client holder and remove template.
-
-
-
字段详细资料
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
SINGLETON_REST
private static final java.util.Map<java.lang.String,NacosRestTemplate> SINGLETON_REST
-
SINGLETON_ASYNC_REST
private static final java.util.Map<java.lang.String,NacosAsyncRestTemplate> SINGLETON_ASYNC_REST
-
ALREADY_SHUTDOWN
private static final java.util.concurrent.atomic.AtomicBoolean ALREADY_SHUTDOWN
-
-
方法详细资料
-
getNacosRestTemplate
public static NacosRestTemplate getNacosRestTemplate(org.slf4j.Logger logger)
-
getNacosRestTemplate
public static NacosRestTemplate getNacosRestTemplate(HttpClientFactory httpClientFactory)
-
getNacosAsyncRestTemplate
public static NacosAsyncRestTemplate getNacosAsyncRestTemplate(org.slf4j.Logger logger)
-
getNacosAsyncRestTemplate
public static NacosAsyncRestTemplate getNacosAsyncRestTemplate(HttpClientFactory httpClientFactory)
-
shutdown
private static void shutdown()
Shutdown common http client.
-
shutdown
public static void shutdown(java.lang.String className) throws java.lang.ExceptionShutdown http client holder and close remove template.- 参数:
className- HttpClientFactory implement class name- 抛出:
java.lang.Exception- ex
-
shutdownNacostSyncRest
public static void shutdownNacostSyncRest(java.lang.String className) throws java.lang.ExceptionShutdown sync http client holder and remove template.- 参数:
className- HttpClientFactory implement class name- 抛出:
java.lang.Exception- ex
-
shutdownNacosAsyncRest
public static void shutdownNacosAsyncRest(java.lang.String className) throws java.lang.ExceptionShutdown async http client holder and remove template.- 参数:
className- HttpClientFactory implement class name- 抛出:
java.lang.Exception- ex
-
-