Package com.googlecode.objectify.cache
Class MergeFuture<K,V>
java.lang.Object
com.googlecode.objectify.cache.MergeFuture<K,V>
public class MergeFuture<K,V> extends Object implements Future<Map<K,V>>
A Future which merges some previously loaded values with the results of another
Future that is in progress. It can apply to any key/value pair type; typically
it will be for Key/Entity or Key/T
- Author:
- Jeff Schnitzer
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
MergeFuture
- Parameters:
preloaded
- is a collection of entities that have already been obtained, say from the memcache. TAKES OWNERSHIP OF THE MAP OBJECT - it will be modified later.pending
- is a future of entities that will be obtained sometime later, or null if merging is unnecessary and the preloaded values complete the result.
-
-
Method Details
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<K>
-
isDone
public boolean isDone()- Specified by:
isDone
in interfaceFuture<K>
- See Also:
Future.isDone()
-
get
- Specified by:
get
in interfaceFuture<K>
- Throws:
InterruptedException
ExecutionException
-
get
public Map<K,V> get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException- Specified by:
get
in interfaceFuture<K>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-