public static class LocalTaskQueueTestConfig.DeferredTaskCallback extends java.lang.Object implements LocalTaskQueueCallback
LocalTaskQueueCallback
implementation that automatically detects
and runs tasks with a DeferredTask
payload.
Requests with a payload that is not a DeferredTask
are dispatched
to executeNonDeferredRequest(URLFetchServicePb.URLFetchRequest)
, which by default does nothing.
If you need to handle a payload like this you can extend the class and
override this method to do what you need.Constructor and Description |
---|
DeferredTaskCallback() |
Modifier and Type | Method and Description |
---|---|
int |
execute(URLFetchServicePb.URLFetchRequest req)
Execute the provided url fetch request.
|
protected int |
executeNonDeferredRequest(URLFetchServicePb.URLFetchRequest req)
Broken out to make it easy for subclasses to provide their own behavior
when the request payload is not a
DeferredTask . |
void |
initialize(java.util.Map<java.lang.String,java.lang.String> properties)
This method will be invoked from
LocalTaskQueue#init(com.google.appengine.tools.development.LocalServiceContext, Map)
forwarding the properties parameter. |
public void initialize(java.util.Map<java.lang.String,java.lang.String> properties)
LocalTaskQueueCallback
LocalTaskQueue#init(com.google.appengine.tools.development.LocalServiceContext, Map)
forwarding the properties
parameter.initialize
in interface LocalTaskQueueCallback
public int execute(URLFetchServicePb.URLFetchRequest req)
LocalTaskQueueCallback
execute
in interface LocalTaskQueueCallback
req
- The url fetch requestprotected int executeNonDeferredRequest(URLFetchServicePb.URLFetchRequest req)
DeferredTask
.