Top Inners Fields Constructors Methods
org.apache.hc.client5.http.impl.async

pack-priv Class InternalH2AsyncExecRuntime

extends Object
implements AsyncExecRuntime
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.async.AsyncExecRuntime
Imports
java.io.InterruptedIOException, java.util.concurrent.atomic.AtomicReference, org.apache.hc.client5.http.HttpRoute, org.apache.hc.client5.http.async.AsyncExecRuntime, org.apache.hc.client5.http.config.RequestConfig, org.apache.hc.client5.http.impl.ConnPoolSupport, .Operations, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.core5.concurrent.Cancellable, .ComplexCancellable, .FutureCallback, org.apache.hc.core5.http.HttpHost, .HttpVersion, org.apache.hc.core5.http.nio.AsyncClientExchangeHandler, .AsyncPushConsumer, .HandlerFactory, org.apache.hc.core5.http.nio.command.RequestExecutionCommand, org.apache.hc.core5.io.CloseMode, org.apache.hc.core5.reactor.Command, .IOSession, org.apache.hc.core5.util.Identifiable, .TimeValue, .Timeout, org.slf4j.Logger

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final InternalH2ConnPool
private final Logger
private final HandlerFactory<AsyncPushConsumer>
private volatile boolean
private final AtomicReference<InternalH2AsyncExecRuntime.Endpoint>

Constructor Summary

AccessConstructor and Description
pack-priv
InternalH2AsyncExecRuntime(final Logger log, final InternalH2ConnPool connPool, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory)

Method Summary

Modifier and TypeMethod and Description
public Cancellable
acquireEndpoint(final String
unique operation ID or null.
id
,
final HttpRoute
the connection route.
route
,
final Object
the expected connection state. May be null if connection can be state-less or its state is irrelevant.
object
,
final HttpClientContext
the execution context.
context
,
final FutureCallback<AsyncExecRuntime>
the result callback.
callback
)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.acquireEndpoint.

Initiates operation to acquire a connection endpoint.
private void
public Cancellable
connectEndpoint(final HttpClientContext
the execution context.
context
,
final FutureCallback<AsyncExecRuntime>
the result callback.
callback
)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.connectEndpoint.

Initiates operation to connect the local endpoint to the initial hop (connection target in case of a direct route or to the first proxy hop in case of a route via a proxy or multiple proxies).
public void
discardEndpoint()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.discardEndpoint.

Shuts down and discards the acquired endpoint.
public void
disconnectEndpoint()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.disconnectEndpoint.

Disconnects the local endpoint from the initial hop in the connection route.
pack-priv InternalH2AsyncExecRuntime.Endpoint
public Cancellable
execute(final String
unique operation ID or null.
id
,
final AsyncClientExchangeHandler
the client message handler.
exchangeHandler
,
final HttpClientContext
the execution context.
context
)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.execute.

Initiates a message exchange using the given handler.
public AsyncExecRuntime
fork()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.fork.

Forks this runtime for parallel execution.
public boolean
isEndpointAcquired()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.isEndpointAcquired.

Determines of a connection endpoint has been acquired.
public boolean
isEndpointConnected()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.isEndpointConnected.

Determines of there the endpoint is connected to the initial hop (connection target in case of a direct route or to the first proxy hop in case of a route via a proxy or multiple proxies).
public void
public void
markConnectionReusable(final Object
the connection state representation or null if stateless.
newState
,
final TimeValue
the period of time this connection is valid for.
newValidDuration
)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.markConnectionReusable.

Marks the connection as potentially re-usable for the given period of time and also marks it as stateful if the state representation is given.
public void
releaseEndpoint()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.releaseEndpoint.

Releases the acquired endpoint potentially making it available for re-use.
public void
upgradeTls(final HttpClientContext
the execution context.
context
)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.upgradeTls.

Upgrades transport security of the active connection by using the TLS security protocol.
public void
upgradeTls(final HttpClientContext
the execution context.
context
,
final FutureCallback<AsyncExecRuntime> callback)

Overrides default org.apache.hc.client5.http.async.AsyncExecRuntime.upgradeTls.

Upgrades transport security of the active connection by using the TLS security protocol.
public boolean
validateConnection()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.validateConnection.

Validates the connection making sure it can be used to execute requests.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connPoolback to summary
private final InternalH2ConnPool connPool
logback to summary
private final Logger log
pushHandlerFactoryback to summary
private final HandlerFactory<AsyncPushConsumer> pushHandlerFactory
reusableback to summary
private volatile boolean reusable
sessionRefback to summary
private final AtomicReference<InternalH2AsyncExecRuntime.Endpoint> sessionRef

Constructor Detail

InternalH2AsyncExecRuntimeback to summary
pack-priv InternalH2AsyncExecRuntime(final Logger log, final InternalH2ConnPool connPool, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory)

Method Detail

acquireEndpointback to summary
public Cancellable acquireEndpoint(final String id, final HttpRoute route, final Object object, final HttpClientContext context, final FutureCallback<AsyncExecRuntime> callback)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.acquireEndpoint.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.acquireEndpoint.

Initiates operation to acquire a connection endpoint. Endpoints can leased from a pool or unconnected new endpoint can be created.

Parameters
id:String

unique operation ID or null.

route:HttpRoute

the connection route.

object:Object

the expected connection state. May be null if connection can be state-less or its state is irrelevant.

context:HttpClientContext

the execution context.

callback:FutureCallback<AsyncExecRuntime>

the result callback.

Returns:Cancellable

handle that can be used to cancel the operation.

Annotations
@Override
closeEndpointback to summary
private void closeEndpoint(final InternalH2AsyncExecRuntime.Endpoint endpoint)
connectEndpointback to summary
public Cancellable connectEndpoint(final HttpClientContext context, final FutureCallback<AsyncExecRuntime> callback)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.connectEndpoint.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.connectEndpoint.

Initiates operation to connect the local endpoint to the initial hop (connection target in case of a direct route or to the first proxy hop in case of a route via a proxy or multiple proxies).

Parameters
context:HttpClientContext

the execution context.

callback:FutureCallback<AsyncExecRuntime>

the result callback.

Returns:Cancellable

handle that can be used to cancel the operation.

Annotations
@Override
discardEndpointback to summary
public void discardEndpoint()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.discardEndpoint.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.discardEndpoint.

Shuts down and discards the acquired endpoint.

Annotations
@Override
disconnectEndpointback to summary
public void disconnectEndpoint()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.disconnectEndpoint.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.disconnectEndpoint.

Disconnects the local endpoint from the initial hop in the connection route.

Annotations
@Override
ensureValidback to summary
pack-priv InternalH2AsyncExecRuntime.Endpoint ensureValid()
executeback to summary
public Cancellable execute(final String id, final AsyncClientExchangeHandler exchangeHandler, final HttpClientContext context)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.execute.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.execute.

Initiates a message exchange using the given handler.

Parameters
id:String

unique operation ID or null.

exchangeHandler:AsyncClientExchangeHandler

the client message handler.

context:HttpClientContext

the execution context.

Annotations
@Override
forkback to summary
public AsyncExecRuntime fork()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.fork.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.fork.

Forks this runtime for parallel execution.

Returns:AsyncExecRuntime

another runtime with the same configuration.

Annotations
@Override
isEndpointAcquiredback to summary
public boolean isEndpointAcquired()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.isEndpointAcquired.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.isEndpointAcquired.

Determines of a connection endpoint has been acquired.

Returns:boolean

true if an endpoint has been acquired, false otherwise.

Annotations
@Override
isEndpointConnectedback to summary
public boolean isEndpointConnected()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.isEndpointConnected.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.isEndpointConnected.

Determines of there the endpoint is connected to the initial hop (connection target in case of a direct route or to the first proxy hop in case of a route via a proxy or multiple proxies).

Returns:boolean

true if the endpoint is connected, false otherwise.

Annotations
@Override
markConnectionNonReusableback to summary
public void markConnectionNonReusable()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.markConnectionNonReusable.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.markConnectionNonReusable.

Marks the connection as non re-usable.

Annotations
@Override
markConnectionReusableback to summary
public void markConnectionReusable(final Object newState, final TimeValue newValidDuration)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.markConnectionReusable.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.markConnectionReusable.

Marks the connection as potentially re-usable for the given period of time and also marks it as stateful if the state representation is given.

Parameters
newState:Object

the connection state representation or null if stateless.

newValidDuration:TimeValue

the period of time this connection is valid for.

Annotations
@Override
releaseEndpointback to summary
public void releaseEndpoint()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.releaseEndpoint.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.releaseEndpoint.

Releases the acquired endpoint potentially making it available for re-use.

Annotations
@Override
upgradeTlsback to summary
public void upgradeTls(final HttpClientContext context)

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.upgradeTls.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.upgradeTls.

Upgrades transport security of the active connection by using the TLS security protocol.

Parameters
context:HttpClientContext

the execution context.

Annotations
@Override
upgradeTlsback to summary
public void upgradeTls(final HttpClientContext context, final FutureCallback<AsyncExecRuntime> callback)

Overrides default org.apache.hc.client5.http.async.AsyncExecRuntime.upgradeTls.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.upgradeTls.

Upgrades transport security of the active connection by using the TLS security protocol.

Parameters
context:HttpClientContext

the execution context.

Annotations
@Override
validateConnectionback to summary
public boolean validateConnection()

Implements org.apache.hc.client5.http.async.AsyncExecRuntime.validateConnection.

Doc from org.apache.hc.client5.http.async.AsyncExecRuntime.validateConnection.

Validates the connection making sure it can be used to execute requests.

Returns:boolean

true if the connection is valid, false.

Annotations
@Override
org.apache.hc.client5.http.impl.async back to summary

pack-priv Class InternalH2AsyncExecRuntime.Endpoint

extends Object
implements Identifiable
Class Inheritance
  • java.lang.Object
  • org.apache.hc.client5.http.impl.async.InternalH2AsyncExecRuntime.Endpoint
All Implemented Interfaces
org.apache.hc.core5.util.Identifiable

Field Summary

Modifier and TypeField and Description
pack-priv final IOSession
pack-priv final HttpHost

Constructor Summary

AccessConstructor and Description
pack-priv
Endpoint(final HttpHost target, final IOSession session)

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sessionback to summary
pack-priv final IOSession session
targetback to summary
pack-priv final HttpHost target

Constructor Detail

Endpointback to summary
pack-priv Endpoint(final HttpHost target, final IOSession session)

Method Detail

getIdback to summary
public String getId()

Implements org.apache.hc.core5.util.Identifiable.getId.

Annotations
@Override