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 -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addPending(Future<?> future)
Register a pending Future that has a callback.static void
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.
-
Constructor Details
-
PendingFutures
public PendingFutures()
-
-
Method Details
-
addPending
Register a pending Future that has a callback.- Parameters:
future
- must have at least one callback
-
removePending
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.
-