|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsr166y.forkjoin.ForkJoinTask<java.lang.Void>
jsr166y.forkjoin.AsyncAction
public abstract class AsyncAction
Resultless ForkJoinTasks with explicit completions. Unlike some other kinds of tasks, AsyncActions do not intrinisically complete upon exit from their compute methods, but instead require explicit invocation of their finish methods.
Unlike LinkedAsyncActions, AsyncActions do not establish links to parent tasks or count child tasks. This class can thus form a more flexible basis for classes creating custom linkages.
Constructor Summary | |
---|---|
AsyncAction()
|
Method Summary | |
---|---|
protected abstract void |
compute()
The asynchronous part of the computation performed by this task. |
java.lang.Throwable |
exec()
Immediately commences execution of this task by the current worker thread unless already cancelled, returning any exception thrown by its compute method. |
void |
finish()
Equivalent to finish(null). |
void |
finish(java.lang.Void result)
Completes this task, and if not already aborted or cancelled, returning the given result upon join and related operations. |
void |
finishExceptionally(java.lang.Throwable ex)
Completes this task abnormally, and if not already aborted or cancelled, causes it to throw the given exception upon join and related operations. |
java.lang.Void |
forkJoin()
Equivalent in effect to the sequence fork(); join(); but may be more efficient. |
java.lang.Void |
rawResult()
Always returns null. |
Methods inherited from class jsr166y.forkjoin.ForkJoinTask |
---|
cancel, fork, getException, isCancelled, isDone, isStolen, join, quietlyJoin, reinitialize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AsyncAction()
Method Detail |
---|
protected abstract void compute()
public final void finish()
public final void finish(java.lang.Void result)
ForkJoinTask
finish
in class ForkJoinTask<java.lang.Void>
result
- the result to returnpublic final void finishExceptionally(java.lang.Throwable ex)
ForkJoinTask
finishExceptionally
in class ForkJoinTask<java.lang.Void>
ex
- the exception to throw. While not necessarily
statically enforced, this must be a RuntimeException or Error.public final java.lang.Void rawResult()
rawResult
in class ForkJoinTask<java.lang.Void>
public final java.lang.Void forkJoin()
ForkJoinTask
forkJoin
in class ForkJoinTask<java.lang.Void>
public final java.lang.Throwable exec()
ForkJoinTask
exec
in class ForkJoinTask<java.lang.Void>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |