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:
- java.lang.Runnable, java.util.concurrent.Future<V>, java.util.concurrent.RunnableFuture<V>
public class HttpRequestFutureTask<V>
- extends java.util.concurrent.FutureTask<V>
FutureTask implementation that wraps a HttpAsyncClientCallable and exposes various task
specific metrics.
Constructor Summary |
HttpRequestFutureTask(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.impl.client.HttpRequestTaskCallable<V> httpCallable)
|
Methods inherited from class java.util.concurrent.FutureTask |
done, get, get, isCancelled, isDone, run, runAndReset, set, setException |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
HttpRequestFutureTask
public HttpRequestFutureTask(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.impl.client.HttpRequestTaskCallable<V> httpCallable)
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface java.util.concurrent.Future<V>
- Overrides:
cancel
in class java.util.concurrent.FutureTask<V>
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 java.lang.String toString()
- Overrides:
toString
in class java.lang.Object