Top Description Inners Fields Constructors Methods
org.apache.hc.core5.http.impl.bootstrap

public Class HttpAsyncRequester

extends AsyncRequester
implements ConnPoolControl<HttpHost>
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.pool.ConnPoolControl, org.apache.hc.core5.pool.ConnPoolStats
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.List, .Set, java.util.concurrent.Future, java.util.concurrent.atomic.AtomicReference, org.apache.hc.core5.annotation.Internal, org.apache.hc.core5.concurrent.BasicFuture, .CallbackContribution, .ComplexFuture, .FutureCallback, .FutureContribution, org.apache.hc.core5.function.Callback, .Decorator, org.apache.hc.core5.http.ConnectionClosedException, .EntityDetails, .Header, .HttpConnection, .HttpException, .HttpHost, .HttpResponse, .ProtocolException, org.apache.hc.core5.http.impl.DefaultAddressResolver, org.apache.hc.core5.http.nio.AsyncClientEndpoint, .AsyncClientExchangeHandler, .AsyncPushConsumer, .AsyncRequestProducer, .AsyncResponseConsumer, .CapacityChannel, .DataStreamChannel, .HandlerFactory, .RequestChannel, org.apache.hc.core5.http.nio.command.RequestExecutionCommand, .ShutdownCommand, org.apache.hc.core5.http.nio.ssl.TlsStrategy, .TlsUpgradeCapable, org.apache.hc.core5.http.nio.support.BasicClientExchangeHandler, org.apache.hc.core5.http.protocol.HttpContext, .HttpCoreContext, org.apache.hc.core5.io.CloseMode, org.apache.hc.core5.net.NamedEndpoint, .URIAuthority, org.apache.hc.core5.pool.ConnPoolControl, .ManagedConnPool, .PoolEntry, .PoolStats, org.apache.hc.core5.reactor.Command, .EndpointParameters, .IOEventHandler, .IOEventHandlerFactory, .IOReactorConfig, .IOSession, .IOSessionListener, .ProtocolIOSession, org.apache.hc.core5.reactor.ssl.TransportSecurityLayer, org.apache.hc.core5.util.Args, .TimeValue, .Timeout

HTTP/1.1 client side message exchange initiator.
Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final ManagedConnPool<HttpHost, IOSession>
private final Timeout
private final TlsStrategy

Constructor Summary

AccessConstructor and Description
public
HttpAsyncRequester(final IOReactorConfig ioReactorConfig, final IOEventHandlerFactory eventHandlerFactory, final Decorator<IOSession> ioSessionDecorator, final Callback<Exception> exceptionCallback, final IOSessionListener sessionListener, final ManagedConnPool<HttpHost, IOSession> connPool, final TlsStrategy tlsStrategy, final Timeout handshakeTimeout)

Use AsyncRequesterBootstrap to create instances of this class.

public
HttpAsyncRequester(final IOReactorConfig ioReactorConfig, final IOEventHandlerFactory eventHandlerFactory, final Decorator<IOSession> ioSessionDecorator, final Callback<Exception> exceptionCallback, final IOSessionListener sessionListener, final ManagedConnPool<HttpHost, IOSession> connPool)

Use AsyncRequesterBootstrap to create instances of this class.

Method Summary

Modifier and TypeMethod and Description
public void
public void
public Future<AsyncClientEndpoint>
connect(final HttpHost host, final Timeout timeout, final Object attachment, final FutureCallback<AsyncClientEndpoint> callback)

public Future<AsyncClientEndpoint>
connect(final HttpHost host, final Timeout timeout)

protected Future<AsyncClientEndpoint>
doConnect(final HttpHost host, final Timeout timeout, final Object attachment, final FutureCallback<AsyncClientEndpoint> callback)

protected void
doTlsUpgrade(final ProtocolIOSession ioSession, final NamedEndpoint endpoint, final FutureCallback<ProtocolIOSession> callback)

public void
execute(final AsyncClientExchangeHandler exchangeHandler, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final Timeout timeout, final HttpContext executeContext)

public void
execute(final AsyncClientExchangeHandler exchangeHandler, final Timeout timeout, final HttpContext executeContext)

public final <T> Future<T>
execute(final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final Timeout timeout, final HttpContext context, final FutureCallback<T> callback)

public final <T> Future<T>
execute(final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final Timeout timeout, final HttpContext context, final FutureCallback<T> callback)

public final <T> Future<T>
execute(final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final Timeout timeout, final FutureCallback<T> callback)

public int
public int
public int
public Set<HttpHost>
public PoolStats
public PoolStats
public void
public void
public void
Inherited from org.apache.hc.core5.http.impl.bootstrap.AsyncRequester:
awaitShutdowncloseclosegetIOReactorgetStatusinitiateShutdownrequestSessionstart

Field Detail

connPoolback to summary
private final ManagedConnPool<HttpHost, IOSession> connPool
handshakeTimeoutback to summary
private final Timeout handshakeTimeout
tlsStrategyback to summary
private final TlsStrategy tlsStrategy

Constructor Detail

HttpAsyncRequesterback to summary
public HttpAsyncRequester(final IOReactorConfig ioReactorConfig, final IOEventHandlerFactory eventHandlerFactory, final Decorator<IOSession> ioSessionDecorator, final Callback<Exception> exceptionCallback, final IOSessionListener sessionListener, final ManagedConnPool<HttpHost, IOSession> connPool, final TlsStrategy tlsStrategy, final Timeout handshakeTimeout)

Use AsyncRequesterBootstrap to create instances of this class.

Annotations
@Internal
Since
5.2
HttpAsyncRequesterback to summary
public HttpAsyncRequester(final IOReactorConfig ioReactorConfig, final IOEventHandlerFactory eventHandlerFactory, final Decorator<IOSession> ioSessionDecorator, final Callback<Exception> exceptionCallback, final IOSessionListener sessionListener, final ManagedConnPool<HttpHost, IOSession> connPool)

Use AsyncRequesterBootstrap to create instances of this class.

Annotations
@Internal

Method Detail

closeExpiredback to summary
public void closeExpired()

Implements org.apache.hc.core5.pool.ConnPoolControl.closeExpired.

Annotations
@Override
closeIdleback to summary
public void closeIdle(final TimeValue idleTime)

Implements org.apache.hc.core5.pool.ConnPoolControl.closeIdle.

Annotations
@Override
connectback to summary
public Future<AsyncClientEndpoint> connect(final HttpHost host, final Timeout timeout, final Object attachment, final FutureCallback<AsyncClientEndpoint> callback)
connectback to summary
public Future<AsyncClientEndpoint> connect(final HttpHost host, final Timeout timeout)
doConnectback to summary
protected Future<AsyncClientEndpoint> doConnect(final HttpHost host, final Timeout timeout, final Object attachment, final FutureCallback<AsyncClientEndpoint> callback)
doTlsUpgradeback to summary
protected void doTlsUpgrade(final ProtocolIOSession ioSession, final NamedEndpoint endpoint, final FutureCallback<ProtocolIOSession> callback)
executeback to summary
public void execute(final AsyncClientExchangeHandler exchangeHandler, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final Timeout timeout, final HttpContext executeContext)
executeback to summary
public void execute(final AsyncClientExchangeHandler exchangeHandler, final Timeout timeout, final HttpContext executeContext)
executeback to summary
public final <T> Future<T> execute(final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final Timeout timeout, final HttpContext context, final FutureCallback<T> callback)
executeback to summary
public final <T> Future<T> execute(final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final Timeout timeout, final HttpContext context, final FutureCallback<T> callback)
executeback to summary
public final <T> Future<T> execute(final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final Timeout timeout, final FutureCallback<T> callback)
getDefaultMaxPerRouteback to summary
public int getDefaultMaxPerRoute()

Implements org.apache.hc.core5.pool.ConnPoolControl.getDefaultMaxPerRoute.

Annotations
@Override
getMaxPerRouteback to summary
public int getMaxPerRoute(final HttpHost route)

Implements org.apache.hc.core5.pool.ConnPoolControl.getMaxPerRoute.

Annotations
@Override
getMaxTotalback to summary
public int getMaxTotal()

Implements org.apache.hc.core5.pool.ConnPoolControl.getMaxTotal.

Annotations
@Override
getRoutesback to summary
public Set<HttpHost> getRoutes()

Implements org.apache.hc.core5.pool.ConnPoolControl.getRoutes.

Annotations
@Override
getStatsback to summary
public PoolStats getStats(final HttpHost route)

Implements org.apache.hc.core5.pool.ConnPoolStats.getStats.

Annotations
@Override
getTotalStatsback to summary
public PoolStats getTotalStats()

Implements org.apache.hc.core5.pool.ConnPoolStats.getTotalStats.

Annotations
@Override
setDefaultMaxPerRouteback to summary
public void setDefaultMaxPerRoute(final int max)

Implements org.apache.hc.core5.pool.ConnPoolControl.setDefaultMaxPerRoute.

Annotations
@Override
setMaxPerRouteback to summary
public void setMaxPerRoute(final HttpHost route, final int max)

Implements org.apache.hc.core5.pool.ConnPoolControl.setMaxPerRoute.

Annotations
@Override
setMaxTotalback to summary
public void setMaxTotal(final int max)

Implements org.apache.hc.core5.pool.ConnPoolControl.setMaxTotal.

Annotations
@Override
org.apache.hc.core5.http.impl.bootstrap back to summary

private Class HttpAsyncRequester.InternalAsyncClientEndpoint

extends AsyncClientEndpoint
implements TlsUpgradeCapable
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.nio.ssl.TlsUpgradeCapable

Field Summary

Modifier and TypeField and Description
pack-priv final AtomicReference<PoolEntry<HttpHost, IOSession>>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
execute(final AsyncClientExchangeHandler exchangeHandler, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final HttpContext context)

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.execute.

Initiates a message exchange using the given handler.
private IOSession
public boolean
isConnected()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.isConnected.

Determines if the connection to the remote endpoint is still open and valid.
public void
releaseAndDiscard()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndDiscard.

Shuts down the underlying connection and removes it from the connection pool.
public void
releaseAndReuse()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndReuse.

Releases the underlying connection back to the connection pool as re-usable.
public void
Inherited from org.apache.hc.core5.http.nio.AsyncClientEndpoint:
executeexecuteexecuteexecute

Field Detail

poolEntryRefback to summary
pack-priv final AtomicReference<PoolEntry<HttpHost, IOSession>> poolEntryRef

Constructor Detail

InternalAsyncClientEndpointback to summary
pack-priv InternalAsyncClientEndpoint(final PoolEntry<HttpHost, IOSession> poolEntry)

Method Detail

executeback to summary
public void execute(final AsyncClientExchangeHandler exchangeHandler, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final HttpContext context)

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.execute.

Doc from org.apache.hc.core5.http.nio.AsyncClientEndpoint.execute.

Initiates a message exchange using the given handler.

Once the endpoint is no longer needed it MUST be released with releaseAndReuse() or releaseAndDiscard().

Annotations
@Override
getIOSessionback to summary
private IOSession getIOSession()
isConnectedback to summary
public boolean isConnected()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.isConnected.

Doc from org.apache.hc.core5.http.nio.AsyncClientEndpoint.isConnected.

Determines if the connection to the remote endpoint is still open and valid.

Annotations
@Override
releaseAndDiscardback to summary
public void releaseAndDiscard()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndDiscard.

Doc from org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndDiscard.

Shuts down the underlying connection and removes it from the connection pool.

Annotations
@Override
releaseAndReuseback to summary
public void releaseAndReuse()

Implements abstract org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndReuse.

Doc from org.apache.hc.core5.http.nio.AsyncClientEndpoint.releaseAndReuse.

Releases the underlying connection back to the connection pool as re-usable.

Annotations
@Override
tlsUpgradeback to summary
public void tlsUpgrade(final NamedEndpoint endpoint, final FutureCallback<ProtocolIOSession> callback)

Implements org.apache.hc.core5.http.nio.ssl.TlsUpgradeCapable.tlsUpgrade.

Annotations
@Override