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

pack-priv Class InternalHttpAsyncExecRuntime

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, .TlsConfig, org.apache.hc.client5.http.impl.ConnPoolSupport, .Operations, org.apache.hc.client5.http.nio.AsyncClientConnectionManager, .AsyncConnectionEndpoint, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.core5.concurrent.CallbackContribution, .Cancellable, .FutureCallback, org.apache.hc.core5.http.nio.AsyncClientExchangeHandler, .AsyncPushConsumer, .HandlerFactory, org.apache.hc.core5.io.CloseMode, org.apache.hc.core5.reactor.ConnectionInitiator, org.apache.hc.core5.util.TimeValue, .Timeout, org.slf4j.Logger

Field Summary

Modifier and TypeField and Description
private final ConnectionInitiator
private final AtomicReference<AsyncConnectionEndpoint>
private final Logger
private final AsyncClientConnectionManager
private final HandlerFactory<AsyncPushConsumer>
private volatile boolean
private volatile Object
private final TlsConfig
tlsConfig

Deprecated TLS should be configured by the connection manager
private volatile TimeValue

Constructor Summary

AccessConstructor and Description
pack-priv
InternalHttpAsyncExecRuntime(final Logger log, final AsyncClientConnectionManager manager, final ConnectionInitiator connectionInitiator, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final TlsConfig tlsConfig)

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.
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).
private void
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 AsyncConnectionEndpoint
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

connectionInitiatorback to summary
private final ConnectionInitiator connectionInitiator
endpointRefback to summary
private final AtomicReference<AsyncConnectionEndpoint> endpointRef
logback to summary
private final Logger log
managerback to summary
private final AsyncClientConnectionManager manager
pushHandlerFactoryback to summary
private final HandlerFactory<AsyncPushConsumer> pushHandlerFactory
reusableback to summary
private volatile boolean reusable
stateback to summary
private volatile Object state
tlsConfigback to summary
private final TlsConfig tlsConfig

Deprecated

TLS should be configured by the connection manager

Annotations
@Deprecated
validDurationback to summary
private volatile TimeValue validDuration

Constructor Detail

InternalHttpAsyncExecRuntimeback to summary
pack-priv InternalHttpAsyncExecRuntime(final Logger log, final AsyncClientConnectionManager manager, final ConnectionInitiator connectionInitiator, final HandlerFactory<AsyncPushConsumer> pushHandlerFactory, final TlsConfig tlsConfig)

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
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
private void discardEndpoint(final AsyncConnectionEndpoint endpoint)
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 AsyncConnectionEndpoint 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