类 AbstractHttpClientFactory
- java.lang.Object
-
- com.alibaba.nacos.common.http.AbstractHttpClientFactory
-
- 所有已实现的接口:
HttpClientFactory
public abstract class AbstractHttpClientFactory extends java.lang.Object implements HttpClientFactory
AbstractHttpClientFactory Let the creator only specify the http client config.- 作者:
- mai.jh
-
-
字段概要
字段 修饰符和类型 字段 说明 private static java.lang.StringASYNC_THREAD_NAMEprivate static java.lang.StringAYNC_IO_REACTOR_NAME
-
构造器概要
构造器 构造器 说明 AbstractHttpClientFactory()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected abstract org.slf4j.LoggerassignLogger()assign Logger.protected abstract HttpClientConfigbuildHttpClientConfig()build http client config.NacosAsyncRestTemplatecreateNacosAsyncRestTemplate()create new nacos async rest.NacosRestTemplatecreateNacosRestTemplate()create new nacost rest.private org.apache.http.nio.conn.NHttpClientConnectionManagergetConnectionManager(HttpClientConfig originalRequestConfig, org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor ioreactor)create theNHttpClientConnectionManager, the code mainly fromHttpAsyncClientBuilder.build(). we add theIOReactorExceptionHandlerto handle theIOExceptionandRuntimeExceptionthrown by theBaseIOReactorwhen process the event of Network.private org.apache.http.impl.nio.reactor.DefaultConnectingIOReactorgetIoReactor(java.lang.String threadName)protected org.apache.http.impl.nio.reactor.IOReactorConfiggetIoReactorConfig()protected org.apache.http.client.config.RequestConfiggetRequestConfig()protected voidinitTls(java.util.function.BiConsumer<javax.net.ssl.SSLContext,javax.net.ssl.HostnameVerifier> initTlsBiFunc, TlsFileWatcher.FileChangeListener tlsChangeListener)protected javax.net.ssl.SSLContextloadSSLContext()
-
-
-
方法详细资料
-
createNacosRestTemplate
public NacosRestTemplate createNacosRestTemplate()
从接口复制的说明:HttpClientFactorycreate new nacost rest.- 指定者:
createNacosRestTemplate在接口中HttpClientFactory- 返回:
- NacosRestTemplate
-
createNacosAsyncRestTemplate
public NacosAsyncRestTemplate createNacosAsyncRestTemplate()
从接口复制的说明:HttpClientFactorycreate new nacos async rest.- 指定者:
createNacosAsyncRestTemplate在接口中HttpClientFactory- 返回:
- NacosAsyncRestTemplate
-
getIoReactor
private org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor getIoReactor(java.lang.String threadName)
-
getConnectionManager
private org.apache.http.nio.conn.NHttpClientConnectionManager getConnectionManager(HttpClientConfig originalRequestConfig, org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor ioreactor)
create theNHttpClientConnectionManager, the code mainly fromHttpAsyncClientBuilder.build(). we add theIOReactorExceptionHandlerto handle theIOExceptionandRuntimeExceptionthrown by theBaseIOReactorwhen process the event of Network. Using this way to avoid theDefaultConnectingIOReactorkilled by unknown error of network.- 参数:
originalRequestConfig- request config.ioreactor- I/O reactor.- 返回:
NHttpClientConnectionManager.
-
getIoReactorConfig
protected org.apache.http.impl.nio.reactor.IOReactorConfig getIoReactorConfig()
-
getRequestConfig
protected org.apache.http.client.config.RequestConfig getRequestConfig()
-
initTls
protected void initTls(java.util.function.BiConsumer<javax.net.ssl.SSLContext,javax.net.ssl.HostnameVerifier> initTlsBiFunc, TlsFileWatcher.FileChangeListener tlsChangeListener)
-
loadSSLContext
protected javax.net.ssl.SSLContext loadSSLContext()
-
buildHttpClientConfig
protected abstract HttpClientConfig buildHttpClientConfig()
build http client config.- 返回:
- HttpClientConfig
-
assignLogger
protected abstract org.slf4j.Logger assignLogger()
assign Logger.- 返回:
- Logger
-
-