com.ning.http.client.providers.jdk
Class JDKFuture<V>
java.lang.Object
com.ning.http.client.providers.jdk.JDKFuture<V>
- All Implemented Interfaces:
- FutureImpl<V>, Future<V>
public class JDKFuture<V>
- extends Object
- implements FutureImpl<V>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JDKFuture
public JDKFuture(AsyncHandler<V> asyncHandler,
int responseTimeoutInMs)
setInnerFuture
protected void setInnerFuture(Future<V> innerFuture)
done
public void done(Callable callable)
- Description copied from interface:
FutureImpl
- Execute a
Callable
and if there is no exception, mark this Future as done and release the internal lock.
- Specified by:
done
in interface FutureImpl<V>
abort
public void abort(Throwable t)
- Specified by:
abort
in interface FutureImpl<V>
cancel
public boolean cancel(boolean mayInterruptIfRunning)
- Specified by:
cancel
in interface Future<V>
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface Future<V>
isDone
public boolean isDone()
- Specified by:
isDone
in interface Future<V>
get
public V get()
throws InterruptedException,
ExecutionException
- Specified by:
get
in interface Future<V>
- Throws:
InterruptedException
ExecutionException
get
public V get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
- Specified by:
get
in interface Future<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
hasExpired
public boolean hasExpired()
- Is the Future still valid
- Returns:
true
if response has expired and should be terminated.
touch
protected void touch()
Copyright © 2010. All Rights Reserved.