Class LocalTaskQueue
java.lang.Object
com.google.appengine.tools.development.AbstractLocalRpcService
com.google.appengine.api.taskqueue.dev.LocalTaskQueue
- All Implemented Interfaces:
LocalRpcService
@AutoService(LocalRpcService.class)
public final class LocalTaskQueue
extends AbstractLocalRpcService
A local implementation of the Task Queue service interface backed by Quartz
(http://www.opensymphony.com/quartz). This class is responsible for managing the lifecycle of the
Quartz
Scheduler but otherwise delegates to DevQueue for all the scheduling
intelligence.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.appengine.tools.development.LocalRpcService
LocalRpcService.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOverrides theLocalTaskQueueCallbackclass that is used to service async task execution.static final StringThe name of a property that disables automatic task execution.static final StringThe package name for this service.static final StringOverrides the path of queue.xml.static final StringOverrides the path of queue.yaml. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueAddResponseadd(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueAddRequest addRequest) com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueBulkAddResponsebulkAdd(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueBulkAddRequest bulkAddRequest) BulkAdd RPC implementation.com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueDeleteResponsedelete(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueDeleteRequest request) Delete RPC implementation.booleandeleteTask(String queueName, String taskName) Delete a task by name.com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueFetchQueueStatsResponsefetchQueueStats(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueFetchQueueStatsRequest fetchQueueStatsRequest) FetchQueueStats RPC implementation.voidflushQueue(String queueName) Remove all entries from a queue.getMaximumDeadline(boolean isOfflineRequest) Return the maximum number of seconds that is allowed as a deadline for each API call.Returns the package for the service, for example, "datastore_v3".Returns a map of QueueStateInfo objects keyed by queue name.voidinit(LocalServiceContext context, Map<String, String> properties) Initializes the service with a set of configuration properties.com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueModifyTaskLeaseResponsemodifyTaskLease(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueModifyTaskLeaseRequest request) com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueuePurgeQueueResponsepurgeQueue(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueuePurgeQueueRequest purgeQueueRequest) PurgeQueue RPC implementation.com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueQueryAndOwnTasksResponsequeryAndOwnTasks(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueQueryAndOwnTasksRequest request) booleanRun a task by name.voidstart()Puts a new service into "serving" mode.voidstop()Stops the service, releasing all of its resources.Methods inherited from class com.google.appengine.tools.development.AbstractLocalRpcService
getDefaultDeadline, getMaxApiRequestSize
-
Field Details
-
PACKAGE
The package name for this service.- See Also:
-
DISABLE_AUTO_TASK_EXEC_PROP
The name of a property that disables automatic task execution. If this property exists and is set to true in thepropertiesargument toinit(com.google.appengine.tools.development.LocalServiceContext, java.util.Map<java.lang.String, java.lang.String>)then the schedule will not automatically run any tasks. Manual task execution will still work as normal.- See Also:
-
QUEUE_XML_PATH_PROP
Overrides the path of queue.xml. Must be a full path, e.g. /usr/local/dev/myapp/tests/queue.xml- See Also:
-
QUEUE_YAML_PATH_PROP
Overrides the path of queue.yaml. Must be a full path, e.g. /usr/local/dev/myapp/tests/queue.yaml- See Also:
-
CALLBACK_CLASS_PROP
Overrides theLocalTaskQueueCallbackclass that is used to service async task execution. The value of this property must be the fully-qualified name of a class with a public, no-arg constructor that implements theLocalTaskQueueCallbackinterface.- See Also:
-
-
Constructor Details
-
LocalTaskQueue
public LocalTaskQueue()
-
-
Method Details
-
init
Description copied from interface:LocalRpcServiceInitializes the service with a set of configuration properties. Must be called before a service isstarted.- Specified by:
initin interfaceLocalRpcService- Overrides:
initin classAbstractLocalRpcService- Parameters:
context- A context object for the applicationproperties- A read-onlyMapof properties.
-
start
public void start()Description copied from interface:LocalRpcServicePuts a new service into "serving" mode. Aside from setting properties, the service is not functional until after having been started.- Specified by:
startin interfaceLocalRpcService- Overrides:
startin classAbstractLocalRpcService
-
stop
public void stop()Description copied from interface:LocalRpcServiceStops the service, releasing all of its resources.- Specified by:
stopin interfaceLocalRpcService- Overrides:
stopin classAbstractLocalRpcService
-
getPackage
Description copied from interface:LocalRpcServiceReturns the package for the service, for example, "datastore_v3".- Returns:
- a not
nullpackage name.
-
add
public com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueAddResponse add(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueAddRequest addRequest) -
fetchQueueStats
public com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueFetchQueueStatsResponse fetchQueueStats(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueFetchQueueStatsRequest fetchQueueStatsRequest) FetchQueueStats RPC implementation. -
purgeQueue
public com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueuePurgeQueueResponse purgeQueue(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueuePurgeQueueRequest purgeQueueRequest) PurgeQueue RPC implementation. -
bulkAdd
public com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueBulkAddResponse bulkAdd(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueBulkAddRequest bulkAddRequest) BulkAdd RPC implementation. -
delete
public com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueDeleteResponse delete(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueDeleteRequest request) Delete RPC implementation. -
queryAndOwnTasks
public com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueQueryAndOwnTasksResponse queryAndOwnTasks(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueQueryAndOwnTasksRequest request) -
modifyTaskLease
public com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueModifyTaskLeaseResponse modifyTaskLease(LocalRpcService.Status status, com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueModifyTaskLeaseRequest request) -
getQueueStateInfo
Returns a map of QueueStateInfo objects keyed by queue name.This is not part of the public interface. It is used by the dev server admin console Task Queue Viewer function.
-
flushQueue
Remove all entries from a queue. -
deleteTask
Delete a task by name.- Returns:
- False if the task name was not found.
-
runTask
Run a task by name.- Returns:
- False if the task name was not found.
-
getMaximumDeadline
Description copied from interface:LocalRpcServiceReturn the maximum number of seconds that is allowed as a deadline for each API call. The user cannot request a deadline higher than this value. This method may returnnullif the service has no opinion about the maximum deadline, in which case a global maximum deadline will be used instead.- Specified by:
getMaximumDeadlinein interfaceLocalRpcService- Overrides:
getMaximumDeadlinein classAbstractLocalRpcService
-