Class InternalHttpClient
- java.lang.Object
-
- org.apache.hc.client5.http.impl.classic.CloseableHttpClient
-
- org.apache.hc.client5.http.impl.classic.InternalHttpClient
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,HttpClient,Configurable,org.apache.hc.core5.io.ModalCloseable
@Contract(threading=SAFE_CONDITIONAL) @Internal class InternalHttpClient extends CloseableHttpClient implements Configurable
Internal implementation ofCloseableHttpClient.Concurrent message exchanges executed by this client will get assigned to separate connections leased from the connection pool.
- Since:
- 4.3
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory>authSchemeRegistryprivate java.util.concurrent.ConcurrentLinkedQueue<java.io.Closeable>closeablesprivate HttpClientConnectionManagerconnManagerprivate org.apache.hc.core5.http.config.Lookup<CookieSpecFactory>cookieSpecRegistryprivate CookieStorecookieStoreprivate CredentialsProvidercredentialsProviderprivate RequestConfigdefaultConfigprivate ExecChainElementexecChainprivate static org.slf4j.LoggerLOGprivate org.apache.hc.core5.http.impl.io.HttpRequestExecutorrequestExecutorprivate HttpRoutePlannerroutePlanner
-
Constructor Summary
Constructors Constructor Description InternalHttpClient(HttpClientConnectionManager connManager, org.apache.hc.core5.http.impl.io.HttpRequestExecutor requestExecutor, ExecChainElement execChain, HttpRoutePlanner routePlanner, org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> cookieSpecRegistry, org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> authSchemeRegistry, CookieStore cookieStore, CredentialsProvider credentialsProvider, RequestConfig defaultConfig, java.util.List<java.io.Closeable> closeables)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidclose(org.apache.hc.core5.io.CloseMode closeMode)private HttpRoutedetermineRoute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.protocol.HttpContext context)protected CloseableHttpResponsedoExecute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context)RequestConfiggetConfig()Returns actual request configuration.private voidsetupContext(HttpClientContext context)-
Methods inherited from class org.apache.hc.client5.http.impl.classic.CloseableHttpClient
execute, execute, execute, execute, execute, execute, execute, execute
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.hc.client5.http.classic.HttpClient
executeOpen
-
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
connManager
private final HttpClientConnectionManager connManager
-
requestExecutor
private final org.apache.hc.core5.http.impl.io.HttpRequestExecutor requestExecutor
-
execChain
private final ExecChainElement execChain
-
routePlanner
private final HttpRoutePlanner routePlanner
-
cookieSpecRegistry
private final org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> cookieSpecRegistry
-
authSchemeRegistry
private final org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> authSchemeRegistry
-
cookieStore
private final CookieStore cookieStore
-
credentialsProvider
private final CredentialsProvider credentialsProvider
-
defaultConfig
private final RequestConfig defaultConfig
-
closeables
private final java.util.concurrent.ConcurrentLinkedQueue<java.io.Closeable> closeables
-
-
Constructor Detail
-
InternalHttpClient
public InternalHttpClient(HttpClientConnectionManager connManager, org.apache.hc.core5.http.impl.io.HttpRequestExecutor requestExecutor, ExecChainElement execChain, HttpRoutePlanner routePlanner, org.apache.hc.core5.http.config.Lookup<CookieSpecFactory> cookieSpecRegistry, org.apache.hc.core5.http.config.Lookup<AuthSchemeFactory> authSchemeRegistry, CookieStore cookieStore, CredentialsProvider credentialsProvider, RequestConfig defaultConfig, java.util.List<java.io.Closeable> closeables)
-
-
Method Detail
-
determineRoute
private HttpRoute determineRoute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException
- Throws:
org.apache.hc.core5.http.HttpException
-
setupContext
private void setupContext(HttpClientContext context)
-
doExecute
protected CloseableHttpResponse doExecute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context) throws java.io.IOException
- Specified by:
doExecutein classCloseableHttpClient- Throws:
java.io.IOException
-
getConfig
public RequestConfig getConfig()
Description copied from interface:ConfigurableReturns actual request configuration.- Specified by:
getConfigin interfaceConfigurable
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
close
public void close(org.apache.hc.core5.io.CloseMode closeMode)
- Specified by:
closein interfaceorg.apache.hc.core5.io.ModalCloseable
-
-