public class DeferredTaskContext
extends java.lang.Object
DeferredTask
.Modifier and Type | Field and Description |
---|---|
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 . |
Modifier and Type | Method and Description |
---|---|
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 |
markForRetry()
Request a retry of this task, even if an exception was not thrown.
|
static void |
setDoNotRetry(boolean value)
Sets the action on task failure.
|
public static final java.lang.String RUNNABLE_TASK_CONTENT_TYPE
DeferredTask
.public static final java.lang.String DEFAULT_DEFERRED_URL
public static HttpServlet getCurrentServlet()
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.public static HttpServletRequest getCurrentRequest()
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.public static HttpServletResponse getCurrentResponse()
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.public static void setDoNotRetry(boolean value)
setDoNotRetry
is set to true
, the task will not be retried.public static void markForRetry()
setDoNotRetry(boolean)
is set to true
the request will not be retried.