jsr166y.forkjoin
public abstract class AsyncAction extends ForkJoinTask<java.lang.Void>
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 and Description |
---|
AsyncAction() |
Modifier and Type | Method and Description |
---|---|
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.
|
cancel, fork, getException, isCancelled, isDone, isStolen, join, quietlyJoin, reinitialize
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>