Package com.google.api.core
Class AbstractApiFuture<V>
- java.lang.Object
-
- com.google.api.core.AbstractApiFuture<V>
-
- Direct Known Subclasses:
SettableApiFuture
public abstract class AbstractApiFuture<V> extends Object implements ApiFuture<V>
Abstract implementation of ApiFuture that mirrorsAbstractFuture
in Guava.
-
-
Constructor Summary
Constructors Constructor Description AbstractApiFuture()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(Runnable listener, Executor executor)
boolean
cancel(boolean mayInterruptIfRunning)
V
get()
V
get(long timeout, TimeUnit unit)
protected void
interruptTask()
boolean
isCancelled()
boolean
isDone()
protected boolean
set(V value)
protected boolean
setException(Throwable throwable)
-
-
-
Method Detail
-
addListener
public void addListener(Runnable listener, Executor executor)
- Specified by:
addListener
in interfaceApiFuture<V>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
get
public V get() throws InterruptedException, ExecutionException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceFuture<V>
-
set
protected boolean set(V value)
-
setException
protected boolean setException(Throwable throwable)
-
interruptTask
protected void interruptTask()
-
-