com.google.appengine.api.labs.taskqueue.dev
Class LocalTaskQueue

java.lang.Object
  extended by com.google.appengine.api.labs.taskqueue.dev.LocalTaskQueue

@ServiceProvider(value=)
public final class LocalTaskQueue
extends java.lang.Object

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.


Field Summary
static java.lang.String CALLBACK_CLASS_PROP
          Overrides the LocalTaskQueueCallback class that is used to service async task execution.
static java.lang.String DISABLE_AUTO_TASK_EXEC_PROP
          The name of a property that disables automatic task execution.
static java.lang.String PACKAGE
          The package name for this service.
static java.lang.String QUEUE_XML_PATH_PROP
          Overrides the path of queue.xml.
 
Constructor Summary
LocalTaskQueue()
           
 
Method Summary
 TaskQueueAddResponse add(Status status, TaskQueueAddRequest addRequest)
           
 TaskQueueBulkAddResponse bulkAdd(Status status, TaskQueueBulkAddRequest bulkAddRequest)
           
 boolean deleteTask(java.lang.String queueName, java.lang.String taskName)
          Delete a task by name.
 void flushQueue(java.lang.String queueName)
          Remove all entries from a queue.
 java.lang.String getPackage()
           
 java.util.Map<java.lang.String,QueueStateInfo> getQueueStateInfo()
          Returns a map of QueueStateInfo objects keyed by queue name.
 void init(LocalServiceContext context, java.util.Map<java.lang.String,java.lang.String> properties)
           
 boolean runTask(java.lang.String queueName, java.lang.String taskName)
          Run a task by name.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE

public static final java.lang.String PACKAGE
The package name for this service.

See Also:
Constant Field Values

DISABLE_AUTO_TASK_EXEC_PROP

public static final java.lang.String 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 the properties argument to init(LocalServiceContext, java.util.Map) then the schedule will not automatically run any tasks. Manual task execution will still work as normal.

See Also:
Constant Field Values

QUEUE_XML_PATH_PROP

public static final java.lang.String 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:
Constant Field Values

CALLBACK_CLASS_PROP

public static final java.lang.String CALLBACK_CLASS_PROP
Overrides the LocalTaskQueueCallback class 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 the LocalTaskQueueCallback interface.

See Also:
Constant Field Values
Constructor Detail

LocalTaskQueue

public LocalTaskQueue()
Method Detail

init

public void init(LocalServiceContext context,
                 java.util.Map<java.lang.String,java.lang.String> properties)

start

public void start()

stop

public void stop()

getPackage

public java.lang.String getPackage()

add

public TaskQueueAddResponse add(Status status,
                                TaskQueueAddRequest addRequest)

bulkAdd

public TaskQueueBulkAddResponse bulkAdd(Status status,
                                        TaskQueueBulkAddRequest bulkAddRequest)

getQueueStateInfo

public java.util.Map<java.lang.String,QueueStateInfo> 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

public void flushQueue(java.lang.String queueName)
Remove all entries from a queue.


deleteTask

public boolean deleteTask(java.lang.String queueName,
                          java.lang.String taskName)
Delete a task by name.

Returns:
False if the task name was not found.

runTask

public boolean runTask(java.lang.String queueName,
                       java.lang.String taskName)
Run a task by name.

Returns:
False if the task name was not found.