Class ClassicToAsyncAdaptor
java.lang.Object
org.apache.hc.client5.http.impl.classic.CloseableHttpClient
org.apache.hc.client5.http.impl.compat.ClassicToAsyncAdaptor
- All Implemented Interfaces:
Closeable,AutoCloseable,HttpClient,org.apache.hc.core5.io.ModalCloseable
@Experimental
@Internal
@Contract(threading=SAFE_CONDITIONAL)
public class ClassicToAsyncAdaptor
extends CloseableHttpClient
CloseableHttpClient implementation backed by CloseableHttpAsyncClient
acting as a compatibility bridge with the classic APIs based on the standard
InputStream / OutputStream model.- Since:
- 5.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CloseableHttpAsyncClientprivate final org.apache.hc.core5.util.Timeout -
Constructor Summary
ConstructorsConstructorDescriptionClassicToAsyncAdaptor(CloseableHttpAsyncClient client, org.apache.hc.core5.util.Timeout operationTimeout) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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, executeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hc.client5.http.classic.HttpClient
executeOpen
-
Field Details
-
client
-
operationTimeout
private final org.apache.hc.core5.util.Timeout operationTimeout
-
-
Constructor Details
-
ClassicToAsyncAdaptor
public ClassicToAsyncAdaptor(CloseableHttpAsyncClient client, org.apache.hc.core5.util.Timeout operationTimeout)
-
-
Method Details
-
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 IOException - Specified by:
doExecutein classCloseableHttpClient- Throws:
IOException
-
close
- Throws:
IOException
-
close
public void close(org.apache.hc.core5.io.CloseMode closeMode)
-