Class DeferredTaskContext
- java.lang.Object
-
- com.google.appengine.api.taskqueue.DeferredTaskContext
-
public class DeferredTaskContext extends Object
Resources for managingDeferredTask.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_DEFERRED_URLThe URL the DeferredTask servlet is mapped to by default.static StringRUNNABLE_TASK_CONTENT_TYPEThe content type of a serializedDeferredTask.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.servlet.http.HttpServletRequestgetCurrentRequest()Returns theHttpServletRequestinstance for the current running deferred task for the current thread ornullif there is no current deferred task active for this thread.static javax.servlet.http.HttpServletResponsegetCurrentResponse()Returns theHttpServletResponseinstance for the current running deferred task for the current thread ornullif there is no current deferred task active for this thread.static javax.servlet.http.HttpServletgetCurrentServlet()Returns theHttpServletinstance for the current running deferred task for the current thread ornullif there is no current deferred task active for this thread.static voidmarkForRetry()Request a retry of this task, even if an exception was not thrown.static voidsetDoNotRetry(boolean value)Sets the action on task failure.
-
-
-
Field Detail
-
RUNNABLE_TASK_CONTENT_TYPE
public static final String RUNNABLE_TASK_CONTENT_TYPE
The content type of a serializedDeferredTask.- See Also:
- Constant Field Values
-
DEFAULT_DEFERRED_URL
public static final String DEFAULT_DEFERRED_URL
The URL the DeferredTask servlet is mapped to by default.- See Also:
- Constant Field Values
-
-
Method Detail
-
getCurrentServlet
public static javax.servlet.http.HttpServlet getCurrentServlet()
Returns theHttpServletinstance for the current running deferred task for the current thread ornullif there is no current deferred task active for this thread.
-
getCurrentRequest
public static javax.servlet.http.HttpServletRequest getCurrentRequest()
Returns theHttpServletRequestinstance for the current running deferred task for the current thread ornullif there is no current deferred task active for this thread.
-
getCurrentResponse
public static javax.servlet.http.HttpServletResponse getCurrentResponse()
Returns theHttpServletResponseinstance for the current running deferred task for the current thread ornullif 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 ifsetDoNotRetryis set totrue, the task will not be retried.
-
markForRetry
public static void markForRetry()
Request a retry of this task, even if an exception was not thrown. If an exception was thrown andsetDoNotRetry(boolean)is set totruethe request will not be retried.
-
-