|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.objectify.cache.Pending
public class Pending
This is the state maintained on a per-thread basis for all of the oustanding Future> objects that have pending callbacks. When a Future> is done and its callbacks are executed, it is removed from the list. At various times (anytime an API call is made) the registered futures are checked for doneness and processed.
The AsyncCacheFilter is necessary to guarantee that any pending callbacks are processed at the end of the request. A future GAE SDK which allows us to hook into the Future> creation process might make this extra Filter unnecessary.
Constructor Summary | |
---|---|
Pending()
|
Method Summary | |
---|---|
void |
add(java.util.concurrent.Future<?> future)
Register a pending Future that has a callback. |
void |
checkPendingFutures()
If any futures are pending, check if they are done. |
void |
completeAllPendingFutures()
Iterate through all pending futures and get() them, forcing any callbacks to be called. |
boolean |
isEmpty()
|
void |
remove(java.util.concurrent.Future<?> future)
De-register a pending Future. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Pending()
Method Detail |
---|
public void add(java.util.concurrent.Future<?> future)
future
- must have at least one callbackpublic void remove(java.util.concurrent.Future<?> future)
public boolean isEmpty()
public void checkPendingFutures()
public void completeAllPendingFutures()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |