Package com.googlecode.objectify.util
Class FutureWrapper<K,V>
java.lang.Object
com.googlecode.objectify.util.FutureWrapper<K,V>
- All Implemented Interfaces:
Future<V>
- Direct Known Subclasses:
SimpleFutureWrapper
JMS: Copied verbatum from the original GAE SDK. Probably something we can eliminate.
FutureWrapper
is a simple Future
that wraps a
parent Future
. This class is thread-safe.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected V
absorbParentException
(Throwable cause) Override this method if you want to suppress an exception thrown by the parent and return a value instead.boolean
cancel
(boolean mayInterruptIfRunning) protected abstract Throwable
convertException
(Throwable cause) final boolean
get()
final int
hashCode()
boolean
boolean
isDone()
protected abstract V
-
Constructor Details
-
FutureWrapper
-
-
Method Details
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<K>
-
isDone
public boolean isDone() -
get
- Specified by:
get
in interfaceFuture<K>
- Throws:
ExecutionException
InterruptedException
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException - Specified by:
get
in interfaceFuture<K>
- Throws:
InterruptedException
TimeoutException
ExecutionException
-
hashCode
public final int hashCode() -
equals
-
wrap
- Throws:
Exception
-
absorbParentException
Override this method if you want to suppress an exception thrown by the parent and return a value instead.- Throws:
Throwable
-
convertException
-