@Beta public interface TaskInternal<T> extends Task<T>
ExecutionManager
should implement this.
Users are strongly encouraged to use (or extend) BasicTask
, rather than
implementing a task from scratch.
The methods on this interface will change in subsequent releases. Because this is
marked as beta, the normal deprecation policy for these methods does not apply.Modifier and Type | Method and Description |
---|---|
void |
applyTagModifier(com.google.common.base.Function<java.util.Set<java.lang.Object>,java.lang.Void> modifier) |
boolean |
blockUntilStarted(Duration timeout) |
boolean |
cancel() |
java.lang.String |
getBlockingDetails()
returns a textual message giving details while the task is blocked
|
Task<?> |
getBlockingTask()
returns a task that this task is blocked on
|
java.lang.Object |
getExtraStatusText() |
java.util.concurrent.Future<T> |
getInternalFuture()
returns the underlying future where this task's results will come in; see
initInternalFuture(ListenableFuture) |
java.util.concurrent.Callable<T> |
getJob() |
com.google.common.util.concurrent.ExecutionList |
getListeners() |
java.util.Set<java.lang.Object> |
getMutableTags() |
Task<?> |
getProxyTarget()
if a task is a proxy for another one (used mainly for internal tasks),
this returns the "real" task represented by this one
|
long |
getQueuedTimeUtc()
if the job is queued for submission (e.g.
|
void |
initInternalFuture(com.google.common.util.concurrent.ListenableFuture<T> result)
sets the internal future object used to record the association to a job submitted to an
ExecutorService |
boolean |
isQueued() |
boolean |
isQueuedAndNotSubmitted() |
boolean |
isQueuedOrSubmitted() |
void |
markQueued()
marks the task as queued for execution
|
void |
resetBlockingDetails() |
void |
resetBlockingTask() |
void |
runListeners() |
java.lang.String |
setBlockingDetails(java.lang.String blockingDetails)
allows a task user to specify why a task is blocked; for use immediately before a blocking/wait,
and typically cleared immediately afterwards; referenced by management api to inspect a task
which is blocking
|
Task<?> |
setBlockingTask(Task<?> blockingTask)
as
setBlockingDetails(String) but records a task which is blocking,
for use e.g. |
void |
setEndTimeUtc(long val) |
void |
setExtraStatusText(java.lang.Object extraStatus) |
void |
setJob(java.util.concurrent.Callable<T> job) |
void |
setStartTimeUtc(long currentTimeMillis) |
void |
setSubmittedByTask(Task<?> task) |
void |
setSubmitTimeUtc(long currentTimeMillis) |
void |
setThread(java.lang.Thread thread) |
blockUntilEnded, blockUntilEnded, blockUntilStarted, cancel, get, getDescription, getDisplayName, getEndTimeUtc, getId, getStartTimeUtc, getStatusDetail, getStatusSummary, getSubmittedByTask, getSubmitTimeUtc, getTags, getThread, getUnchecked, getUnchecked, isBegun, isError, isSubmitted
asTask
void initInternalFuture(com.google.common.util.concurrent.ListenableFuture<T> result)
ExecutorService
java.util.concurrent.Future<T> getInternalFuture()
initInternalFuture(ListenableFuture)
long getQueuedTimeUtc()
boolean isQueuedOrSubmitted()
boolean isQueuedAndNotSubmitted()
boolean isQueued()
void markQueued()
boolean cancel()
boolean blockUntilStarted(Duration timeout)
java.lang.String setBlockingDetails(java.lang.String blockingDetails)
returns previous details, in case caller wishes to recall and restore it (e.g. if it is doing a sub-blocking)
Task<?> setBlockingTask(Task<?> blockingTask)
setBlockingDetails(String)
but records a task which is blocking,
for use e.g. in a gui to navigate to the current active subtask
returns previous blocking task, in case caller wishes to recall and restore it
void resetBlockingDetails()
void resetBlockingTask()
java.lang.String getBlockingDetails()
Task<?> getBlockingTask()
void setExtraStatusText(java.lang.Object extraStatus)
java.lang.Object getExtraStatusText()
void runListeners()
void setEndTimeUtc(long val)
void setThread(java.lang.Thread thread)
java.util.concurrent.Callable<T> getJob()
void setJob(java.util.concurrent.Callable<T> job)
com.google.common.util.concurrent.ExecutionList getListeners()
void setSubmitTimeUtc(long currentTimeMillis)
void setSubmittedByTask(Task<?> task)
java.util.Set<java.lang.Object> getMutableTags()
void setStartTimeUtc(long currentTimeMillis)
void applyTagModifier(com.google.common.base.Function<java.util.Set<java.lang.Object>,java.lang.Void> modifier)
Task<?> getProxyTarget()