This specialized callback is used when breaking up an asynchronous task into smaller asynchronous tasks. A typical pattern is that a successful callback is used to schedule the next sub task, but if that task completes quickly and uses the calling thread to callback the success notification, this can result in a growing stack depth.
To avoid this issue, this callback uses an AtomicBoolean to note if the success callback has been called during the processing of a sub task, and if so then the processing iterates rather than recurses.
This callback is passed to the asynchronous handling of each sub
task and a call the succeeded() on this call back represents
completion of the subtask. Only once all the subtasks are completed is
the Callback#succeeded() method called on the Callback instance
passed the the IteratingNestedCallback(Callback) constructor.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Invocable. | |
| protected void | onCompleteFailure(Throwable
the throwable to indicate cause of failure x)Overrides org. |
| protected void | onCompleteSuccess()
Overrides org. |
| public String | toString()
Overrides org. |
| _callback | back to summary |
|---|---|
| pack-priv final Callback _callback | |
| IteratingNestedCallback | back to summary |
|---|---|
| public IteratingNestedCallback(Callback callback) | |
| getInvocationType | back to summary |
|---|---|
| public Invocable. Overrides default org.
| |
| onCompleteFailure | back to summary |
|---|---|
| protected void onCompleteFailure(Throwable x) Overrides org. Doc from org. Invoked when the overall task has completed with a failure. | |
| onCompleteSuccess | back to summary |
|---|---|
| protected void onCompleteSuccess() Overrides org. Doc from org. Invoked when the overall task has completed successfully.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object. | |