|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.objectify.cache.TriggerFutureHook
public class TriggerFutureHook
This bit of appengine magic hooks into the ApiProxy and does the heavy lifting of making the TriggerFuture> work.
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. 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 triggers 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 | |
---|---|
TriggerFutureHook(com.google.apphosting.api.ApiProxy.Delegate<com.google.apphosting.api.ApiProxy.Environment> parent)
|
Method Summary | |
---|---|
static void |
addPending(java.util.concurrent.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. |
void |
flushLogs(com.google.apphosting.api.ApiProxy.Environment paramE)
|
java.util.List<java.lang.Thread> |
getRequestThreads(com.google.apphosting.api.ApiProxy.Environment paramE)
|
static void |
install()
Install our hook in the delegate system. |
void |
log(com.google.apphosting.api.ApiProxy.Environment arg0,
com.google.apphosting.api.ApiProxy.LogRecord arg1)
|
java.util.concurrent.Future<byte[]> |
makeAsyncCall(com.google.apphosting.api.ApiProxy.Environment arg0,
java.lang.String arg1,
java.lang.String arg2,
byte[] arg3,
com.google.apphosting.api.ApiProxy.ApiConfig arg4)
|
byte[] |
makeSyncCall(com.google.apphosting.api.ApiProxy.Environment arg0,
java.lang.String arg1,
java.lang.String arg2,
byte[] arg3)
|
static void |
removePending(java.util.concurrent.Future<?> future)
Deregister a pending Future that had a callback. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TriggerFutureHook(com.google.apphosting.api.ApiProxy.Delegate<com.google.apphosting.api.ApiProxy.Environment> parent)
Method Detail |
---|
public static void install()
public static void addPending(java.util.concurrent.Future<?> future)
future
- must have at least one callbackpublic static void removePending(java.util.concurrent.Future<?> future)
public void log(com.google.apphosting.api.ApiProxy.Environment arg0, com.google.apphosting.api.ApiProxy.LogRecord arg1)
log
in interface com.google.apphosting.api.ApiProxy.Delegate<com.google.apphosting.api.ApiProxy.Environment>
public java.util.concurrent.Future<byte[]> makeAsyncCall(com.google.apphosting.api.ApiProxy.Environment arg0, java.lang.String arg1, java.lang.String arg2, byte[] arg3, com.google.apphosting.api.ApiProxy.ApiConfig arg4)
makeAsyncCall
in interface com.google.apphosting.api.ApiProxy.Delegate<com.google.apphosting.api.ApiProxy.Environment>
public byte[] makeSyncCall(com.google.apphosting.api.ApiProxy.Environment arg0, java.lang.String arg1, java.lang.String arg2, byte[] arg3) throws com.google.apphosting.api.ApiProxy.ApiProxyException
makeSyncCall
in interface com.google.apphosting.api.ApiProxy.Delegate<com.google.apphosting.api.ApiProxy.Environment>
com.google.apphosting.api.ApiProxy.ApiProxyException
public static void completeAllPendingFutures()
public void flushLogs(com.google.apphosting.api.ApiProxy.Environment paramE)
flushLogs
in interface com.google.apphosting.api.ApiProxy.Delegate<com.google.apphosting.api.ApiProxy.Environment>
public java.util.List<java.lang.Thread> getRequestThreads(com.google.apphosting.api.ApiProxy.Environment paramE)
getRequestThreads
in interface com.google.apphosting.api.ApiProxy.Delegate<com.google.apphosting.api.ApiProxy.Environment>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |