Package org.apache.hc.core5.http.nio
Class AsyncClientEndpoint
- java.lang.Object
-
- org.apache.hc.core5.http.nio.AsyncClientEndpoint
-
- Direct Known Subclasses:
HttpAsyncRequester.InternalAsyncClientEndpoint
@Contract(threading=SAFE) public abstract class AsyncClientEndpoint extends java.lang.Object
Client endpoint leased from a connection manager.Once the endpoint is no longer needed it MUST be released with
releaseAndReuse()
orreleaseAndDiscard()
.- Since:
- 5.0
-
-
Constructor Summary
Constructors Constructor Description AsyncClientEndpoint()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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.<T> java.util.concurrent.Future<T>
execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, FutureCallback<T> callback)
Initiates a message exchange using the given request producer and response consumer.<T> java.util.concurrent.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.<T> java.util.concurrent.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
isConnected()
Determines if the connection to the remote endpoint is still open and valid.abstract void
releaseAndDiscard()
Shuts down the underlying connection and removes it from the connection pool.abstract void
releaseAndReuse()
Releases the underlying connection back to the connection pool as re-usable.
-
-
-
Method Detail
-
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
public void execute(AsyncClientExchangeHandler exchangeHandler, HttpContext context)
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> java.util.concurrent.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> java.util.concurrent.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> java.util.concurrent.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()
.
-
-