com.google.appengine.tools.development.testing
Class LocalTaskQueueTestConfig.DeferredTaskCallback
- java.lang.Object
-
- com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig.DeferredTaskCallback
-
- All Implemented Interfaces:
- LocalTaskQueueCallback, java.io.Serializable
- Direct Known Subclasses:
- LocalTaskQueueTestConfig.ServletInvokingTaskCallback
- Enclosing class:
- LocalTaskQueueTestConfig
public static class LocalTaskQueueTestConfig.DeferredTaskCallback extends java.lang.Object implements LocalTaskQueueCallback
ALocalTaskQueueCallback
implementation that automatically detects and runs tasks with aDeferredTask
payload. Requests with a payload that is not aDeferredTask
are dispatched toexecuteNonDeferredRequest(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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DeferredTaskCallback()
-
Method Summary
All Methods Instance Methods Concrete Methods 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 aDeferredTask
.void
initialize(java.util.Map<java.lang.String,java.lang.String> properties)
This method will be invoked fromLocalTaskQueue#init(com.google.appengine.tools.development.LocalServiceContext, Map)
forwarding theproperties
parameter.
-
-
-
Method Detail
-
initialize
public void initialize(java.util.Map<java.lang.String,java.lang.String> properties)
Description copied from interface:LocalTaskQueueCallback
This method will be invoked fromLocalTaskQueue#init(com.google.appengine.tools.development.LocalServiceContext, Map)
forwarding theproperties
parameter.- Specified by:
initialize
in interfaceLocalTaskQueueCallback
-
execute
public int execute(URLFetchServicePb.URLFetchRequest req)
Description copied from interface:LocalTaskQueueCallback
Execute the provided url fetch request.- Specified by:
execute
in interfaceLocalTaskQueueCallback
- Parameters:
req
- The url fetch request- Returns:
- The HTTP status code of the fetch.
-
executeNonDeferredRequest
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 aDeferredTask
.
-
-