Class DeferredTaskContext
java.lang.Object
com.google.appengine.api.taskqueue.DeferredTaskContext
Resources for managing
DeferredTask
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The URL the DeferredTask servlet is mapped to by default.static final String
The content type of a serializedDeferredTask
. -
Method Summary
Modifier and TypeMethodDescriptionstatic javax.servlet.http.HttpServletRequest
Returns theHttpServletRequest
instance for the current running deferred task for the current thread ornull
if there is no current deferred task active for this thread.static javax.servlet.http.HttpServletResponse
Returns theHttpServletResponse
instance for the current running deferred task for the current thread ornull
if there is no current deferred task active for this thread.static javax.servlet.http.HttpServlet
Returns theHttpServlet
instance for the current running deferred task for the current thread ornull
if there is no current deferred task active for this thread.static void
Request a retry of this task, even if an exception was not thrown.static void
setDoNotRetry
(boolean value) Sets the action on task failure.
-
Field Details
-
RUNNABLE_TASK_CONTENT_TYPE
The content type of a serializedDeferredTask
.- See Also:
-
DEFAULT_DEFERRED_URL
The URL the DeferredTask servlet is mapped to by default.- See Also:
-
-
Method Details
-
getCurrentServlet
public static javax.servlet.http.HttpServlet getCurrentServlet()Returns theHttpServlet
instance for the current running deferred task for the current thread ornull
if there is no current deferred task active for this thread. -
getCurrentRequest
public static javax.servlet.http.HttpServletRequest getCurrentRequest()Returns theHttpServletRequest
instance for the current running deferred task for the current thread ornull
if there is no current deferred task active for this thread. -
getCurrentResponse
public static javax.servlet.http.HttpServletResponse getCurrentResponse()Returns theHttpServletResponse
instance for the current running deferred task for the current thread ornull
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 ifsetDoNotRetry
is 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 totrue
the request will not be retried.
-