Class JDKHttpFuture<V>
- java.lang.Object
-
- com.github.scribejava.core.httpclient.jdk.JDKHttpFuture<V>
-
- All Implemented Interfaces:
Future<V>
public class JDKHttpFuture<V> extends Object implements Future<V>
Fake Future. Just to have Future API for the default JDK Http client. It's NOT Async in any way. Just facade.
That's it. Sync execution with Async methods. This class does NOT provide any async executions.
-
-
Constructor Summary
Constructors Constructor Description JDKHttpFuture(Exception exception)JDKHttpFuture(V response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)Vget()Vget(long timeout, TimeUnit unit)booleanisCancelled()booleanisDone()
-
-
-
Method Detail
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<V>
-
get
public V get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<V>- Throws:
InterruptedExceptionExecutionException
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<V>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
-