Class HttpAsyncRequester
java.lang.Object
org.apache.hc.core5.http.impl.bootstrap.AbstractConnectionInitiatorBase
org.apache.hc.core5.http.impl.bootstrap.AsyncRequester
org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester
- All Implemented Interfaces:
Closeable,AutoCloseable,ModalCloseable,ConnPoolControl<HttpHost>,ConnPoolStats<HttpHost>,ConnectionInitiator,IOReactor,IOReactorService
- Direct Known Subclasses:
H2AsyncRequester
HTTP/1.1 client side message exchange initiator.
- Since:
- 5.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ManagedConnPool<HttpHost, IOSession> private final Timeoutprivate final TlsStrategy -
Constructor Summary
ConstructorsConstructorDescriptionHttpAsyncRequester(IOReactorConfig ioReactorConfig, IOEventHandlerFactory eventHandlerFactory, Decorator<IOSession> ioSessionDecorator, Callback<Exception> exceptionCallback, IOSessionListener sessionListener, ManagedConnPool<HttpHost, IOSession> connPool) UseAsyncRequesterBootstrapto create instances of this class.HttpAsyncRequester(IOReactorConfig ioReactorConfig, IOEventHandlerFactory eventHandlerFactory, Decorator<IOSession> ioSessionDecorator, Callback<Exception> exceptionCallback, IOSessionListener sessionListener, ManagedConnPool<HttpHost, IOSession> connPool, TlsStrategy tlsStrategy, Timeout handshakeTimeout) UseAsyncRequesterBootstrapto create instances of this class. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidconnect(HttpHost host, Timeout timeout, Object attachment, FutureCallback<AsyncClientEndpoint> callback) protected Future<AsyncClientEndpoint> doConnect(HttpHost host, Timeout timeout, Object attachment, FutureCallback<AsyncClientEndpoint> callback) protected voiddoTlsUpgrade(ProtocolIOSession ioSession, NamedEndpoint endpoint, FutureCallback<ProtocolIOSession> callback) voidexecute(AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext executeContext) voidexecute(AsyncClientExchangeHandler exchangeHandler, Timeout timeout, HttpContext executeContext) final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context, FutureCallback<T> callback) final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, FutureCallback<T> callback) final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, HttpContext context, FutureCallback<T> callback) intintgetMaxPerRoute(HttpHost route) intvoidsetDefaultMaxPerRoute(int max) voidsetMaxPerRoute(HttpHost route, int max) voidsetMaxTotal(int max) Methods inherited from class org.apache.hc.core5.http.impl.bootstrap.AsyncRequester
awaitShutdown, close, close, getIOReactor, getStatus, initiateShutdown, requestSession, startMethods inherited from class org.apache.hc.core5.http.impl.bootstrap.AbstractConnectionInitiatorBase
connect
-
Field Details
-
connPool
-
tlsStrategy
-
handshakeTimeout
-
-
Constructor Details
-
HttpAsyncRequester
@Internal public HttpAsyncRequester(IOReactorConfig ioReactorConfig, IOEventHandlerFactory eventHandlerFactory, Decorator<IOSession> ioSessionDecorator, Callback<Exception> exceptionCallback, IOSessionListener sessionListener, ManagedConnPool<HttpHost, IOSession> connPool, TlsStrategy tlsStrategy, Timeout handshakeTimeout) UseAsyncRequesterBootstrapto create instances of this class.- Since:
- 5.2
-
HttpAsyncRequester
@Internal public HttpAsyncRequester(IOReactorConfig ioReactorConfig, IOEventHandlerFactory eventHandlerFactory, Decorator<IOSession> ioSessionDecorator, Callback<Exception> exceptionCallback, IOSessionListener sessionListener, ManagedConnPool<HttpHost, IOSession> connPool) UseAsyncRequesterBootstrapto create instances of this class.
-
-
Method Details
-
getTotalStats
- Specified by:
getTotalStatsin interfaceConnPoolStats<HttpHost>
-
getStats
- Specified by:
getStatsin interfaceConnPoolStats<HttpHost>
-
setMaxTotal
public void setMaxTotal(int max) - Specified by:
setMaxTotalin interfaceConnPoolControl<HttpHost>
-
getMaxTotal
public int getMaxTotal()- Specified by:
getMaxTotalin interfaceConnPoolControl<HttpHost>
-
setDefaultMaxPerRoute
public void setDefaultMaxPerRoute(int max) - Specified by:
setDefaultMaxPerRoutein interfaceConnPoolControl<HttpHost>
-
getDefaultMaxPerRoute
public int getDefaultMaxPerRoute()- Specified by:
getDefaultMaxPerRoutein interfaceConnPoolControl<HttpHost>
-
setMaxPerRoute
- Specified by:
setMaxPerRoutein interfaceConnPoolControl<HttpHost>
-
getMaxPerRoute
- Specified by:
getMaxPerRoutein interfaceConnPoolControl<HttpHost>
-
closeIdle
- Specified by:
closeIdlein interfaceConnPoolControl<HttpHost>
-
closeExpired
public void closeExpired()- Specified by:
closeExpiredin interfaceConnPoolControl<HttpHost>
-
getRoutes
- Specified by:
getRoutesin interfaceConnPoolControl<HttpHost>
-
connect
public Future<AsyncClientEndpoint> connect(HttpHost host, Timeout timeout, Object attachment, FutureCallback<AsyncClientEndpoint> callback) -
doConnect
protected Future<AsyncClientEndpoint> doConnect(HttpHost host, Timeout timeout, Object attachment, FutureCallback<AsyncClientEndpoint> callback) -
connect
-
execute
public void execute(AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext executeContext) -
execute
public void execute(AsyncClientExchangeHandler exchangeHandler, Timeout timeout, HttpContext executeContext) -
execute
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext context, FutureCallback<T> callback) -
execute
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, HttpContext context, FutureCallback<T> callback) -
execute
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, Timeout timeout, FutureCallback<T> callback) -
doTlsUpgrade
protected void doTlsUpgrade(ProtocolIOSession ioSession, NamedEndpoint endpoint, FutureCallback<ProtocolIOSession> callback)
-