Package org.mozilla.javascript
Class ContinuationPending
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.mozilla.javascript.ContinuationPending
- All Implemented Interfaces:
Serializable
Exception thrown by
Context.executeScriptWithContinuations(Script, Scriptable)
and Context.callFunctionWithContinuations(Callable, Scriptable, Object[])
when execution encounters a continuation captured by
Context.captureContinuation().
Exception will contain the captured state needed to restart the continuation
with Context.resumeContinuation(Object, Scriptable, Object).- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Objectprivate NativeContinuationprivate static final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContinuationPending(NativeContinuation continuationState) Construct a ContinuationPending exception. -
Method Summary
Modifier and TypeMethodDescriptionGet continuation object.(package private) NativeContinuationvoidsetApplicationState(Object applicationState) Store an arbitrary object that applications can use to associate their state with the continuation.voidsetContinuation(NativeContinuation continuation) Set continuation object.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
continuationState
-
applicationState
-
-
Constructor Details
-
ContinuationPending
Construct a ContinuationPending exception. Internal call only; users of the API should get continuations created on their behalf by callingContext.executeScriptWithContinuations(Script, Scriptable)andContext.callFunctionWithContinuations(Callable, Scriptable, Object[])Creating subclasses allowed.- Parameters:
continuationState- Internal Continuation object
-
-
Method Details
-
getContinuation
Get continuation object. The only use for this object is to be passed toContext.resumeContinuation(Object, Scriptable, Object).- Returns:
- continuation object
-
setContinuation
Set continuation object. Allows subclasses to modify the internal state.- Parameters:
continuation- object
-
getContinuationState
NativeContinuation getContinuationState()- Returns:
- internal continuation state
-
setApplicationState
Store an arbitrary object that applications can use to associate their state with the continuation.- Parameters:
applicationState- arbitrary application state
-
getApplicationState
- Returns:
- arbitrary application state
-