Package com.googlecode.objectify.cache
Class PendingFutures
- java.lang.Object
-
- com.googlecode.objectify.cache.PendingFutures
-
public class PendingFutures extends Object
This class maintains a thread local list of all the outstanding Future> objects that have pending triggers. When a Future> is done and its trigger is executed, it is removed from the list.
- Author:
- Jeff Schnitzer
-
-
Constructor Summary
Constructors Constructor Description PendingFutures()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addPending(Future<?> future)
Register a pending Future that has a callback.static void
completeAllPendingFutures()
Iterate through all pending futures and get() them, forcing any callbacks to be called.static void
removePending(Future<?> future)
Deregister a pending Future that had a callback.
-
-
-
Method Detail
-
addPending
public static void addPending(Future<?> future)
Register a pending Future that has a callback.- Parameters:
future
- must have at least one callback
-
removePending
public static void removePending(Future<?> future)
Deregister a pending Future that had a callback.
-
completeAllPendingFutures
public static void completeAllPendingFutures()
Iterate through all pending futures and get() them, forcing any callbacks to be called. This is used only by the AsyncCacheFilter (if using cache without Objectify) or ObjectifyFilter (if using Objectify normally) because we don't have a proper hook otherwise.
-
-