Class ClassicToAsyncAdaptor
- java.lang.Object
-
- org.apache.hc.client5.http.impl.classic.CloseableHttpClient
-
- org.apache.hc.client5.http.impl.compat.ClassicToAsyncAdaptor
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,HttpClient,org.apache.hc.core5.io.ModalCloseable
@Experimental @Internal @Contract(threading=SAFE_CONDITIONAL) public class ClassicToAsyncAdaptor extends CloseableHttpClient
CloseableHttpClientimplementation backed byCloseableHttpAsyncClientacting as a compatibility bridge with the classic APIs based on the standardInputStream/OutputStreammodel.- Since:
- 5.5
-
-
Field Summary
Fields Modifier and Type Field Description private CloseableHttpAsyncClientclientprivate org.apache.hc.core5.util.TimeoutoperationTimeout
-
Constructor Summary
Constructors Constructor Description ClassicToAsyncAdaptor(CloseableHttpAsyncClient client, org.apache.hc.core5.util.Timeout operationTimeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidclose(org.apache.hc.core5.io.CloseMode closeMode)protected CloseableHttpResponsedoExecute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext 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
-
client
private final CloseableHttpAsyncClient client
-
operationTimeout
private final org.apache.hc.core5.util.Timeout operationTimeout
-
-
Constructor Detail
-
ClassicToAsyncAdaptor
public ClassicToAsyncAdaptor(CloseableHttpAsyncClient client, org.apache.hc.core5.util.Timeout operationTimeout)
-
-
Method Detail
-
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
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
close
public void close(org.apache.hc.core5.io.CloseMode closeMode)
-
-