# DeferredTaskContext
Date: 2012-02-24

## com.google.appengine.api.taskqueue
Class DeferredTaskContext

    java.lang.Object
      com.google.appengine.api.taskqueue.DeferredTaskContext

    public class DeferredTaskContext

extends java.lang.Object

Resources for managing `DeferredTask`.

Field Summary
`static java.lang.String` `DEFAULT_DEFERRED_URL` The URL the DeferredTask servlet is mapped to by default.
`static java.lang.String` `RUNNABLE_TASK_CONTENT_TYPE` The content type of a serialized `DeferredTask`.

Method Summary
`static HttpServletRequest` `getCurrentRequest()` Returns the `HttpServletRequest` instance for the current running deferred task for the current thread or `null` if there is no current deferred task active for this thread.
`static HttpServletResponse` `getCurrentResponse()` Returns the `HttpServletResponse` instance for the current running deferred task for the current thread or `null` if there is no current deferred task active for this thread.
`static HttpServlet` `getCurrentServlet()` Returns the `HttpServlet` instance for the current running deferred task for the current thread or `null` if there is no current deferred task active for this thread.
`static void` `setDoNotRetry(boolean value)` Sets the action on task failure.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### RUNNABLE_TASK_CONTENT_TYPE

    public static final java.lang.String RUNNABLE_TASK_CONTENT_TYPE

  The content type of a serialized `DeferredTask`.

  See Also:
    Constant Field Values

### DEFAULT_DEFERRED_URL

    public static final java.lang.String DEFAULT_DEFERRED_URL

  The URL the DeferredTask servlet is mapped to by default.

  See Also:
    Constant Field Values

Method Detail

### getCurrentServlet

    public static HttpServlet getCurrentServlet()

  Returns the `HttpServlet` instance for the current running deferred task for the current thread or `null` if there is no current deferred task active for this thread.

### getCurrentRequest

    public static HttpServletRequest getCurrentRequest()

  Returns the `HttpServletRequest` instance for the current running deferred task for the current thread or `null` if there is no current deferred task active for this thread.

### getCurrentResponse

    public static HttpServletResponse getCurrentResponse()

  Returns the `HttpServletResponse` instance for the current running deferred task for the current thread or `null` if there is no current deferred task active for this thread.

### setDoNotRetry

    public static void setDoNotRetry(boolean value)

  Sets the action on task failure. Normally when an exception is thrown, the task will be retried, however if `setDoNotRetry(boolean)`(false) is set, the task will not be retried.