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

pack-priv final Class HttpRequestFutureTask<V>

extends FutureTask<V>
Class Inheritance
Imports
java.util.concurrent.FutureTask, org.apache.hc.core5.concurrent.Cancellable, org.apache.hc.core5.http.ClassicHttpRequest

Field Summary

Modifier and TypeField and Description
private final HttpRequestTaskCallable<V>
private final ClassicHttpRequest

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
cancel(final boolean
true if the thread executing this task should be interrupted (if the thread is known to the implementation); otherwise, in-progress tasks are allowed to complete
mayInterruptIfRunning
)

Overrides java.util.concurrent.FutureTask.cancel.

Implements java.util.concurrent.Future.cancel.

Attempts to cancel execution of this task.
public long

Returns:

the time in millis the task was finished/cancelled.
endedTime
()

public long

Returns:

the time in millis it took to make the request (excluding the time it was scheduled to be executed).
requestDuration
()

public long

Returns:

the time in millis the task was scheduled.
scheduledTime
()

public long

Returns:

the time in millis the task was started.
startedTime
()

public long

Returns:

the time in millis it took to execute the task from the moment it was scheduled.
taskDuration
()

public String
toString()

Overrides java.util.concurrent.FutureTask.toString.

Returns a string representation of this FutureTask.
Inherited from java.util.concurrent.FutureTask:
doneexceptionNowgetgetisCancelledisDoneresultNowrunrunAndResetsetsetExceptionstate

Field Detail

callableback to summary
private final HttpRequestTaskCallable<V> callable

Hides java.util.concurrent.FutureTask.callable.

requestback to summary
private final ClassicHttpRequest request

Constructor Detail

HttpRequestFutureTaskback to summary
pack-priv HttpRequestFutureTask(final ClassicHttpRequest request, final HttpRequestTaskCallable<V> httpCallable)

Method Detail

cancelback to summary
public boolean cancel(final boolean mayInterruptIfRunning)

Overrides java.util.concurrent.FutureTask.cancel.

Implements java.util.concurrent.Future.cancel.

Doc from java.util.concurrent.Future.cancel.

Attempts to cancel execution of this task. This method has no effect if the task is already completed or cancelled, or could not be cancelled for some other reason. Otherwise, if this task has not started when cancel is called, this task should never run. If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task (when known by the implementation) is interrupted in an attempt to stop the task.

The return value from this method does not necessarily indicate whether the task is now cancelled; use isCancelled.

Parameters
mayInterruptIfRunning:boolean

true if the thread executing this task should be interrupted (if the thread is known to the implementation); otherwise, in-progress tasks are allowed to complete

Returns:boolean

false if the task could not be cancelled, typically because it has already completed; true otherwise. If two or more threads cause a task to be cancelled, then at least one of them returns true. Implementations may provide stronger guarantees.

Annotations
@Override
endedTimeback to summary
public long endedTime()
Returns:long

the time in millis the task was finished/cancelled.

requestDurationback to summary
public long requestDuration()
Returns:long

the time in millis it took to make the request (excluding the time it was scheduled to be executed).

scheduledTimeback to summary
public long scheduledTime()
Returns:long

the time in millis the task was scheduled.

startedTimeback to summary
public long startedTime()
Returns:long

the time in millis the task was started.

taskDurationback to summary
public long taskDuration()
Returns:long

the time in millis it took to execute the task from the moment it was scheduled.

toStringback to summary
public String toString()

Overrides java.util.concurrent.FutureTask.toString.

Doc from java.util.concurrent.FutureTask.toString.

Returns a string representation of this FutureTask.

Returns:String

a string representation of this FutureTask

Annotations
@Override