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 Timeout
private final TlsStrategy
-
Constructor Summary
ConstructorsConstructorDescriptionHttpAsyncRequester
(IOReactorConfig ioReactorConfig, IOEventHandlerFactory eventHandlerFactory, Decorator<IOSession> ioSessionDecorator, Callback<Exception> exceptionCallback, IOSessionListener sessionListener, ManagedConnPool<HttpHost, IOSession> connPool) UseAsyncRequesterBootstrap
to 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) UseAsyncRequesterBootstrap
to create instances of this class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
connect
(HttpHost host, Timeout timeout, Object attachment, FutureCallback<AsyncClientEndpoint> callback) protected Future
<AsyncClientEndpoint> doConnect
(HttpHost host, Timeout timeout, Object attachment, FutureCallback<AsyncClientEndpoint> callback) protected void
doTlsUpgrade
(ProtocolIOSession ioSession, NamedEndpoint endpoint, FutureCallback<ProtocolIOSession> callback) void
execute
(AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, Timeout timeout, HttpContext executeContext) void
execute
(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) int
int
getMaxPerRoute
(HttpHost route) int
void
setDefaultMaxPerRoute
(int max) void
setMaxPerRoute
(HttpHost route, int max) void
setMaxTotal
(int max) Methods inherited from class org.apache.hc.core5.http.impl.bootstrap.AsyncRequester
awaitShutdown, close, close, getIOReactor, getStatus, initiateShutdown, requestSession, start
Methods 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) UseAsyncRequesterBootstrap
to 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) UseAsyncRequesterBootstrap
to create instances of this class.
-
-
Method Details
-
getTotalStats
- Specified by:
getTotalStats
in interfaceConnPoolStats<HttpHost>
-
getStats
- Specified by:
getStats
in interfaceConnPoolStats<HttpHost>
-
setMaxTotal
public void setMaxTotal(int max) - Specified by:
setMaxTotal
in interfaceConnPoolControl<HttpHost>
-
getMaxTotal
public int getMaxTotal()- Specified by:
getMaxTotal
in interfaceConnPoolControl<HttpHost>
-
setDefaultMaxPerRoute
public void setDefaultMaxPerRoute(int max) - Specified by:
setDefaultMaxPerRoute
in interfaceConnPoolControl<HttpHost>
-
getDefaultMaxPerRoute
public int getDefaultMaxPerRoute()- Specified by:
getDefaultMaxPerRoute
in interfaceConnPoolControl<HttpHost>
-
setMaxPerRoute
- Specified by:
setMaxPerRoute
in interfaceConnPoolControl<HttpHost>
-
getMaxPerRoute
- Specified by:
getMaxPerRoute
in interfaceConnPoolControl<HttpHost>
-
closeIdle
- Specified by:
closeIdle
in interfaceConnPoolControl<HttpHost>
-
closeExpired
public void closeExpired()- Specified by:
closeExpired
in interfaceConnPoolControl<HttpHost>
-
getRoutes
- Specified by:
getRoutes
in 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)
-