Package org.apache.hc.core5.http.nio
Class AsyncClientEndpoint
java.lang.Object
org.apache.hc.core5.http.nio.AsyncClientEndpoint
- Direct Known Subclasses:
HttpAsyncRequester.InternalAsyncClientEndpoint
Client endpoint leased from a connection manager.
Once the endpoint is no longer needed it MUST be released with releaseAndReuse()
or releaseAndDiscard()
.
- Since:
- 5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
execute
(AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context) Initiates a message exchange using the given handler.void
execute
(AsyncClientExchangeHandler exchangeHandler, HttpContext context) Initiates a message exchange using the given handler.final <T> Future
<T> execute
(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, FutureCallback<T> callback) Initiates a message exchange using the given request producer and response consumer.final <T> Future
<T> execute
(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context, FutureCallback<T> callback) Initiates message exchange using the given request producer and response consumer.final <T> Future
<T> execute
(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HttpContext context, FutureCallback<T> callback) Initiates message exchange using the given request producer and response consumer.abstract boolean
Determines if the connection to the remote endpoint is still open and valid.abstract void
Shuts down the underlying connection and removes it from the connection pool.abstract void
Releases the underlying connection back to the connection pool as re-usable.
-
Constructor Details
-
AsyncClientEndpoint
public AsyncClientEndpoint()
-
-
Method Details
-
execute
public abstract void execute(AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context) Initiates a message exchange using the given handler.Once the endpoint is no longer needed it MUST be released with
releaseAndReuse()
orreleaseAndDiscard()
. -
execute
Initiates a message exchange using the given handler.Once the endpoint is no longer needed it MUST be released with
releaseAndReuse()
orreleaseAndDiscard()
. -
releaseAndReuse
public abstract void releaseAndReuse()Releases the underlying connection back to the connection pool as re-usable. -
releaseAndDiscard
public abstract void releaseAndDiscard()Shuts down the underlying connection and removes it from the connection pool. -
isConnected
public abstract boolean isConnected()Determines if the connection to the remote endpoint is still open and valid. -
execute
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context, FutureCallback<T> callback) Initiates message exchange using the given request producer and response consumer.Once the endpoint is no longer needed it MUST be released with
releaseAndReuse()
orreleaseAndDiscard()
. -
execute
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HttpContext context, FutureCallback<T> callback) Initiates message exchange using the given request producer and response consumer.Once the endpoint is no longer needed it MUST be released with
releaseAndReuse()
orreleaseAndDiscard()
. -
execute
public final <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, FutureCallback<T> callback) Initiates a message exchange using the given request producer and response consumer.Once the endpoint is no longer needed it MUST be released with
releaseAndReuse()
orreleaseAndDiscard()
.
-