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

pack-priv Class InternalExecRuntime

extends Object
implements ExecRuntime, Cancellable
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.concurrent.Cancellable, org.apache.hc.client5.http.classic.ExecRuntime
Imports
java.io.IOException, java.util.concurrent.ExecutionException, .TimeoutException, java.util.concurrent.atomic.AtomicReference, org.apache.hc.client5.http.HttpRoute, org.apache.hc.client5.http.classic.ExecRuntime, org.apache.hc.client5.http.config.RequestConfig, org.apache.hc.client5.http.impl.ConnPoolSupport, org.apache.hc.client5.http.io.ConnectionEndpoint, .HttpClientConnectionManager, .LeaseRequest, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.core5.concurrent.Cancellable, .CancellableDependency, org.apache.hc.core5.http.ClassicHttpRequest, .ClassicHttpResponse, .ConnectionRequestTimeoutException, .HttpException, org.apache.hc.core5.http.impl.io.HttpRequestExecutor, org.apache.hc.core5.io.CloseMode, org.apache.hc.core5.util.Args, .TimeValue, .Timeout, org.slf4j.Logger

Field Summary

Modifier and TypeField and Description
private final CancellableDependency
private final AtomicReference<ConnectionEndpoint>
private final Logger
private final HttpClientConnectionManager
private final HttpRequestExecutor
private volatile boolean
private volatile Object
private volatile TimeValue

Constructor Summary

AccessConstructor and Description
pack-priv
InternalExecRuntime(final Logger log, final HttpClientConnectionManager manager, final HttpRequestExecutor requestExecutor, final CancellableDependency cancellableDependency)

Method Summary

Modifier and TypeMethod and Description
public void
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
)

Implements org.apache.hc.client5.http.classic.ExecRuntime.acquireEndpoint.

Acquires a connection endpoint.
public boolean
cancel()

Implements org.apache.hc.core5.concurrent.Cancellable.cancel.

Cancels the ongoing operation or process.
private void
connectEndpoint(final ConnectionEndpoint endpoint, final HttpClientContext context)

public void
connectEndpoint(final HttpClientContext
the execution context.
context
)

Implements org.apache.hc.client5.http.classic.ExecRuntime.connectEndpoint.

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.classic.ExecRuntime.discardEndpoint.

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

Implements org.apache.hc.client5.http.classic.ExecRuntime.disconnectEndpoint.

Disconnects the local endpoint from the initial hop in the connection route.
pack-priv ConnectionEndpoint
public ClassicHttpResponse
execute(final String
unique operation ID or null.
id
,
final ClassicHttpRequest
the request message.
request
,
final HttpClientContext
the execution context.
context
)

Implements org.apache.hc.client5.http.classic.ExecRuntime.execute.

Executes HTTP request using the given context.
public ExecRuntime
fork(final CancellableDependency cancellableDependency)

Implements org.apache.hc.client5.http.classic.ExecRuntime.fork.

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

Implements org.apache.hc.client5.http.classic.ExecRuntime.isConnectionReusable.

Determines of the connection is considered re-usable.
public boolean
isEndpointAcquired()

Implements org.apache.hc.client5.http.classic.ExecRuntime.isEndpointAcquired.

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

Implements org.apache.hc.client5.http.classic.ExecRuntime.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 boolean
isExecutionAborted()

Implements org.apache.hc.client5.http.classic.ExecRuntime.isExecutionAborted.

Determines of the request execution has been aborted.
public void
public void
markConnectionReusable(final Object
the connection state representation or null if stateless.
state
,
final TimeValue
the period of time this connection is valid for.
validDuration
)

Implements org.apache.hc.client5.http.classic.ExecRuntime.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.classic.ExecRuntime.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.classic.ExecRuntime.upgradeTls.

Upgrades transport security of the active connection by using the TLS security protocol.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cancellableDependencyback to summary
private final CancellableDependency cancellableDependency
endpointRefback to summary
private final AtomicReference<ConnectionEndpoint> endpointRef
logback to summary
private final Logger log
managerback to summary
private final HttpClientConnectionManager manager
requestExecutorback to summary
private final HttpRequestExecutor requestExecutor
reusableback to summary
private volatile boolean reusable
stateback to summary
private volatile Object state
validDurationback to summary
private volatile TimeValue validDuration

Constructor Detail

InternalExecRuntimeback to summary
pack-priv InternalExecRuntime(final Logger log, final HttpClientConnectionManager manager, final HttpRequestExecutor requestExecutor, final CancellableDependency cancellableDependency)

Method Detail

acquireEndpointback to summary
public void acquireEndpoint(final String id, final HttpRoute route, final Object object, final HttpClientContext context) throws IOException

Implements org.apache.hc.client5.http.classic.ExecRuntime.acquireEndpoint.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.acquireEndpoint.

Acquires 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.

Annotations
@Override
cancelback to summary
public boolean cancel()

Implements org.apache.hc.core5.concurrent.Cancellable.cancel.

Doc from org.apache.hc.core5.concurrent.Cancellable.cancel.

Cancels the ongoing operation or process.

Returns:boolean

true if the operation or process has been cancelled as a result of this method call or false if it has already been cancelled or not started.

Annotations
@Override
connectEndpointback to summary
private void connectEndpoint(final ConnectionEndpoint endpoint, final HttpClientContext context) throws IOException
connectEndpointback to summary
public void connectEndpoint(final HttpClientContext context) throws IOException

Implements org.apache.hc.client5.http.classic.ExecRuntime.connectEndpoint.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.connectEndpoint.

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.

Annotations
@Override
discardEndpointback to summary
private void discardEndpoint(final ConnectionEndpoint endpoint)
discardEndpointback to summary
public void discardEndpoint()

Implements org.apache.hc.client5.http.classic.ExecRuntime.discardEndpoint.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.discardEndpoint.

Shuts down and discards the acquired endpoint.

Annotations
@Override
disconnectEndpointback to summary
public void disconnectEndpoint() throws IOException

Implements org.apache.hc.client5.http.classic.ExecRuntime.disconnectEndpoint.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.disconnectEndpoint.

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

Annotations
@Override
ensureValidback to summary
pack-priv ConnectionEndpoint ensureValid()
executeback to summary
public ClassicHttpResponse execute(final String id, final ClassicHttpRequest request, final HttpClientContext context) throws IOException, HttpException

Implements org.apache.hc.client5.http.classic.ExecRuntime.execute.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.execute.

Executes HTTP request using the given context.

Parameters
id:String

unique operation ID or null.

request:ClassicHttpRequest

the request message.

context:HttpClientContext

the execution context.

Annotations
@Override
forkback to summary
public ExecRuntime fork(final CancellableDependency cancellableDependency)

Implements org.apache.hc.client5.http.classic.ExecRuntime.fork.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.fork.

Forks this runtime for parallel execution.

Returns:ExecRuntime

another runtime with the same configuration.

Annotations
@Override
isConnectionReusableback to summary
public boolean isConnectionReusable()

Implements org.apache.hc.client5.http.classic.ExecRuntime.isConnectionReusable.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.isConnectionReusable.

Determines of the connection is considered re-usable.

Returns:boolean

true if the connection is re-usable, false otherwise.

Annotations
@Override
isEndpointAcquiredback to summary
public boolean isEndpointAcquired()

Implements org.apache.hc.client5.http.classic.ExecRuntime.isEndpointAcquired.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.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.classic.ExecRuntime.isEndpointConnected.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.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
isExecutionAbortedback to summary
public boolean isExecutionAborted()

Implements org.apache.hc.client5.http.classic.ExecRuntime.isExecutionAborted.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.isExecutionAborted.

Determines of the request execution has been aborted.

Returns:boolean

true if the request execution has been acquired, false otherwise.

Annotations
@Override
markConnectionNonReusableback to summary
public void markConnectionNonReusable()

Implements org.apache.hc.client5.http.classic.ExecRuntime.markConnectionNonReusable.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.markConnectionNonReusable.

Marks the connection as non re-usable.

Annotations
@Override
markConnectionReusableback to summary
public void markConnectionReusable(final Object state, final TimeValue validDuration)

Implements org.apache.hc.client5.http.classic.ExecRuntime.markConnectionReusable.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.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
state:Object

the connection state representation or null if stateless.

validDuration:TimeValue

the period of time this connection is valid for.

Annotations
@Override
releaseEndpointback to summary
public void releaseEndpoint()

Implements org.apache.hc.client5.http.classic.ExecRuntime.releaseEndpoint.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.releaseEndpoint.

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

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

Implements org.apache.hc.client5.http.classic.ExecRuntime.upgradeTls.

Doc from org.apache.hc.client5.http.classic.ExecRuntime.upgradeTls.

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

Parameters
context:HttpClientContext

the execution context.

Annotations
@Override