|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.runtime.TaskID<E>
E
- The task's return typepublic class TaskID<E>
A future object representing a task invocation. As well as containing the return result for non-void
tasks,
the TaskID
may also be used with dependsOn
, cancel attempts, and other various functions.
Field Summary | |
---|---|
protected boolean |
cancelled
|
protected static int |
CANCELLED
|
protected java.util.concurrent.atomic.AtomicBoolean |
cancelRequested
|
protected static int |
CREATED
|
protected TaskID<?> |
enclosingTask
|
protected int |
globalID
|
protected TaskIDGroup |
group
|
protected java.util.concurrent.atomic.AtomicBoolean |
hasCompleted
|
protected boolean |
hasSlots
|
protected java.util.concurrent.atomic.AtomicBoolean |
hasUserError
|
protected static java.util.concurrent.atomic.AtomicInteger |
nextGlobalID
|
protected int |
relativeID
|
protected static int |
STARTED
|
protected java.util.concurrent.atomic.AtomicInteger |
status
|
protected TaskInfo |
taskInfo
|
Method Summary | |
---|---|
boolean |
cancelAttempt()
Attempts to cancel the task. |
protected void |
cancelChildTasks()
For internal use only. |
boolean |
cancelledSuccessfully()
Checks to see if this task has successfully cancelled. |
boolean |
cancelRequested()
Checks to see if this task has been requested to cancel. |
protected boolean |
currentThreadIsTheRegisteredThread()
|
protected int |
executeIntermediateSlots()
|
protected int |
executeSlots()
|
protected int |
getCount()
|
java.lang.Throwable |
getException()
Returns the exception that occurred while this task executed. |
protected Slot |
getExceptionHandler(java.lang.Class occurredException)
|
TaskIDGroup |
getGroup()
Returns the group that this task is part of (assuming it is a multi-task). |
java.util.concurrent.BlockingQueue<E> |
getOutputQueue()
If this is a pipeline stage, get a queue from which all future results can be retrieved. |
protected java.util.concurrent.BlockingQueue<E> |
getOutputQueue(TaskID requester)
If this is a pipeline stage, get a queue from which all future results can be retrieved. |
int |
getProgress()
Returns the current progress of this task |
E |
getReturnResult()
Returns the result of the task. |
java.lang.Object[] |
getTaskArguments()
Returns the arguments that were passed to this task when it was invoked. |
java.lang.String |
getTaskName()
Returns the (method) name of the task. |
int |
globalID()
Returns the task's globally-unique ID. |
boolean |
hasCompleted()
Checks to see whether the task has completed. |
boolean |
hasUserError()
Checks to see whether the task had any errors. |
boolean |
isInteractive()
Checks to see if this task is an interactibe task. |
boolean |
isMultiTask()
Checks to see if this task is part of a multi-task group. |
boolean |
isPipeline()
Checks to see if this task if a part of a pipeline. |
protected boolean |
isSubTask()
|
int |
multiTaskSize()
Returns the size of the multi-task this task is part of. |
int |
relativeID()
Returns the sub-task's relative ID in the multi-task. |
protected void |
setCount(int count)
|
protected void |
setGlobalID(int globalID)
|
protected void |
setPipelineThread(PipelineThread pt)
Assigns the thread for this stage of the pipeline. |
protected void |
setSubTask(boolean isSubTask)
|
protected void |
unregisterOutputQueue(
Unregisters a queue from a pipeline stage so that new results are no longer written to it. |
void |
waitTillFinished()
Blocks the current thread until the task finishes. |
protected void |
writeToOutputQueues(E value)
Write something into the output queue(s) handled by this TaskID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.concurrent.atomic.AtomicInteger nextGlobalID
protected int globalID
protected int relativeID
protected TaskID<?> enclosingTask
protected TaskInfo taskInfo
protected java.util.concurrent.atomic.AtomicBoolean hasCompleted
protected boolean cancelled
protected java.util.concurrent.atomic.AtomicBoolean cancelRequested
protected java.util.concurrent.atomic.AtomicBoolean hasUserError
protected TaskIDGroup group
protected boolean hasSlots
protected static final int CREATED
protected static final int CANCELLED
protected static final int STARTED
protected java.util.concurrent.atomic.AtomicInteger status
Method Detail |
---|
protected int getCount()
protected void setCount(int count)
protected boolean isSubTask()
protected void setSubTask(boolean isSubTask)
public boolean cancelledSuccessfully()
true
if it has cancelled successfully, false
otherwise.public boolean isInteractive()
true
if this is an interactive task, false
otherwise.public boolean isPipeline()
protected void setPipelineThread(PipelineThread pt)
public java.util.concurrent.BlockingQueue<E> getOutputQueue()
protected java.util.concurrent.BlockingQueue<E> getOutputQueue(TaskID requester)
protected void unregisterOutputQueue(queue)
protected void writeToOutputQueues(E value)
protected void cancelChildTasks()
public int getProgress()
CurrentTask.getProgress()
,
CurrentTask.setProgress(int)
,
setProgress(int)
public boolean cancelRequested()
true
if it has been requested to cancel, false
otherwise.CurrentTask.cancelRequested()
,
cancelAttempt()
,
cancelledSuccessfully()
public boolean cancelAttempt()
true
if it has cancelled successfully, false
otherwise.cancelRequested()
,
CurrentTask.cancelRequested()
,
cancelledSuccessfully()
public TaskIDGroup getGroup()
null
.public java.lang.String getTaskName()
public int globalID()
CurrentTask.globalID()
,
CurrentTask.relativeID()
,
relativeID()
public int relativeID()
CurrentTask.globalID()
,
CurrentTask.relativeID()
,
globalID()
public E getReturnResult() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public void waitTillFinished() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
protected boolean currentThreadIsTheRegisteredThread()
public java.lang.Throwable getException()
public boolean hasCompleted()
true
if it has completed, false
otherwisegetProgress()
,
CurrentTask.getProgress()
public boolean hasUserError()
true
if there was an error, false
otherwiseprotected Slot getExceptionHandler(java.lang.Class occurredException)
protected int executeIntermediateSlots()
protected int executeSlots()
public java.lang.Object[] getTaskArguments()
public boolean isMultiTask()
true
if this task is part of a multi-task, false
otherwisepublic int multiTaskSize()
protected void setGlobalID(int globalID)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |