Package com.google.api.core
Class AbstractApiFuture<V>
java.lang.Object
com.google.api.core.AbstractApiFuture<V>
- Direct Known Subclasses:
SettableApiFuture
Abstract implementation of ApiFuture that mirrors
AbstractFuture in Guava.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(Runnable listener, Executor executor) booleancancel(boolean mayInterruptIfRunning) get()protected voidbooleanbooleanisDone()protected booleanprotected booleansetException(Throwable throwable)
-
Constructor Details
-
AbstractApiFuture
public AbstractApiFuture()
-
-
Method Details
-
addListener
- Specified by:
addListenerin interfaceApiFuture<V>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
get
- 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
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<V>
-
isDone
public boolean isDone() -
set
-
setException
-
interruptTask
protected void interruptTask()
-