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.
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.
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.
Request a retry of this task, even if an exception was not thrown. If an exception was thrown
and #setDoNotRetry is set to true the request will not be retried.
setDoNotRetry(boolean value)
publicstaticvoidsetDoNotRetry(booleanvalue)
Sets the action on task failure. Normally when an exception is thrown, the task will be
retried, however if setDoNotRetry is set to true, the task will not be retried.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003e\u003ccode\u003eDeferredTaskContext\u003c/code\u003e provides resources for managing \u003ccode\u003eDeferredTask\u003c/code\u003e within the Java App Engine environment.\u003c/p\u003e\n"],["\u003cp\u003eIt includes static fields \u003ccode\u003eDEFAULT_DEFERRED_URL\u003c/code\u003e and \u003ccode\u003eRUNNABLE_TASK_CONTENT_TYPE\u003c/code\u003e, defining the default URL and content type for deferred tasks, respectively.\u003c/p\u003e\n"],["\u003cp\u003eStatic methods like \u003ccode\u003egetCurrentRequest()\u003c/code\u003e, \u003ccode\u003egetCurrentResponse()\u003c/code\u003e, and \u003ccode\u003egetCurrentServlet()\u003c/code\u003e allow access to the current HTTP request, response, and servlet instances during a deferred task's execution.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003emarkForRetry()\u003c/code\u003e method can be used to request a task retry, while \u003ccode\u003esetDoNotRetry(boolean value)\u003c/code\u003e allows control over whether a task should be retried upon failure.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDeferredTaskContext\u003c/code\u003e class inherits methods from the \u003ccode\u003ejava.lang.Object\u003c/code\u003e class such as \u003ccode\u003eclone()\u003c/code\u003e, \u003ccode\u003eequals(Object)\u003c/code\u003e, \u003ccode\u003efinalize()\u003c/code\u003e, and \u003ccode\u003egetClass()\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]