Top Description Fields Constructors Methods
org.eclipse.jetty.util

public abstract Class IteratingNestedCallback

extends IteratingCallback
Class Inheritance

Iterating Nested Callback.

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.

Field Summary

Modifier and TypeField and Description
pack-priv final Callback

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Invocable.InvocationType
protected void
onCompleteFailure(Throwable
the throwable to indicate cause of failure
x
)

Overrides org.eclipse.jetty.util.IteratingCallback.onCompleteFailure.

Invoked when the overall task has completed with a failure.
protected void
onCompleteSuccess()

Overrides org.eclipse.jetty.util.IteratingCallback.onCompleteSuccess.

Invoked when the overall task has completed successfully.
public String
toString()

Overrides org.eclipse.jetty.util.IteratingCallback.toString.

Returns a string representation of the object.
Inherited from org.eclipse.jetty.util.IteratingCallback:
abortclosefailedisAbortedisClosedisFailedisIdleisSucceedediterateprocessresetsucceeded

Field Detail

_callbackback to summary
pack-priv final Callback _callback

Constructor Detail

IteratingNestedCallbackback to summary
public IteratingNestedCallback(Callback callback)

Method Detail

getInvocationTypeback to summary
public Invocable.InvocationType getInvocationType()

Overrides default org.eclipse.jetty.util.thread.Invocable.getInvocationType.

Returns:Invocable.InvocationType

Doc from org.eclipse.jetty.util.thread.Invocable.getInvocationType.

The InvocationType of this object

Annotations
@Override
onCompleteFailureback to summary
protected void onCompleteFailure(Throwable x)

Overrides org.eclipse.jetty.util.IteratingCallback.onCompleteFailure.

Doc from org.eclipse.jetty.util.IteratingCallback.onCompleteFailure.

Invoked when the overall task has completed with a failure.

Parameters
x:Throwable

the throwable to indicate cause of failure

Annotations
@Override
onCompleteSuccessback to summary
protected void onCompleteSuccess()

Overrides org.eclipse.jetty.util.IteratingCallback.onCompleteSuccess.

Doc from org.eclipse.jetty.util.IteratingCallback.onCompleteSuccess.

Invoked when the overall task has completed successfully.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.util.IteratingCallback.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override