Package org.apache.http.impl.client
Class HttpRequestFutureTask<V>
- java.lang.Object
-
- java.util.concurrent.FutureTask<V>
-
- org.apache.http.impl.client.HttpRequestFutureTask<V>
-
- Type Parameters:
V
-
- All Implemented Interfaces:
Runnable
,Future<V>
,RunnableFuture<V>
public class HttpRequestFutureTask<V> extends FutureTask<V>
FutureTask implementation that wraps a HttpAsyncClientCallable and exposes various task specific metrics.
-
-
Constructor Summary
Constructors Constructor Description HttpRequestFutureTask(HttpUriRequest request, org.apache.http.impl.client.HttpRequestTaskCallable<V> httpCallable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel(boolean mayInterruptIfRunning)
long
endedTime()
long
requestDuration()
long
scheduledTime()
long
startedTime()
long
taskDuration()
String
toString()
-
Methods inherited from class java.util.concurrent.FutureTask
get, get, isCancelled, isDone, run
-
-
-
-
Constructor Detail
-
HttpRequestFutureTask
public HttpRequestFutureTask(HttpUriRequest request, org.apache.http.impl.client.HttpRequestTaskCallable<V> httpCallable)
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
scheduledTime
public long scheduledTime()
- Returns:
- the time in millis the task was scheduled.
-
startedTime
public long startedTime()
- Returns:
- the time in millis the task was started.
-
endedTime
public long endedTime()
- Returns:
- the time in millis the task was finished/cancelled.
-
requestDuration
public long requestDuration()
- Returns:
- the time in millis it took to make the request (excluding the time it was scheduled to be executed).
-
taskDuration
public long taskDuration()
- Returns:
- the time in millis it took to execute the task from the moment it was scheduled.
-
toString
public String toString()
- Overrides:
toString
in classFutureTask<V>
-
-