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:
    `java.io.Serializable`

      public class ContinuationPending
      extends java.lang.RuntimeException

  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)`.
  Author:
    Norris Boyd
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `ContinuationPending​(NativeContinuation continuationState)` | Construct a ContinuationPending exception.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.Object` | `getApplicationState()` |
    `java.lang.Object` | `getContinuation()` | Get continuation object.
    `void` | `setApplicationState​(java.lang.Object applicationState)` | Store an arbitrary object that applications can use to associate their state with the continuation.
    `void` | `setContinuation​(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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ContinuationPending

          protected ContinuationPending​(NativeContinuation continuationState)

      Construct a ContinuationPending exception. Internal call only; users of the API should get continuations created on their behalf by calling `Context.executeScriptWithContinuations(Script, Scriptable)` and `Context.callFunctionWithContinuations(Callable, Scriptable, Object[])` Creating subclasses allowed.
      Parameters:
        `continuationState` - Internal Continuation object

  - ### Method Detail

    - #### getContinuation

          public java.lang.Object getContinuation()

      Get continuation object. The only use for this object is to be passed to `Context.resumeContinuation(Object, Scriptable, Object)`.
      Returns:
        continuation object

    - #### setContinuation

          public void setContinuation​(NativeContinuation continuation)

      Set continuation object. Allows subclasses to modify the internal state.
      Parameters:
        `continuation` - object

    - #### setApplicationState

          public void setApplicationState​(java.lang.Object applicationState)

      Store an arbitrary object that applications can use to associate their state with the continuation.
      Parameters:
        `applicationState` - arbitrary application state

    - #### getApplicationState

          public java.lang.Object getApplicationState()

      Returns:
        arbitrary application state