Class Continuable

java.lang.Object
com.cloudbees.groovy.cps.Continuable
All Implemented Interfaces:
Serializable

public class Continuable extends Object implements Serializable
Mutable representation of the program. This is the primary API of the groovy-cps library to the outside.
Author:
Kohsuke Kawaguchi
See Also:
  • Field Details

    • categories

      public static final List<Class> categories
      Users of this library must pass (at least) these to GroovyCategorySupport.use(List, Closure) during all operations.
    • SEPARATOR_STACK_ELEMENT

      public static final StackTraceElement SEPARATOR_STACK_ELEMENT
      The artificial StackTraceElement that appears in the stack trace when the CPS library fixes up the stack trace. This separator separates the regular call stack that tracks the actual call stack JVM executes and the synthesized CPS call stack that CPS-transformed program is logically executing.
  • Constructor Details

    • Continuable

      public Continuable(Continuable src)
    • Continuable

      public Continuable(Next n)
    • Continuable

      public Continuable(Block block)
      Creates a Continuable that executes the block of code in a fresh empty environment.
    • Continuable

      public Continuable(Block block, Env e)
      Creates a Continuable that executes the block in the specified environment.
    • Continuable

      public Continuable(groovy.lang.Script cpsTransformedScript)
      Takes a Script compiled from CPS-transforming GroovyShell and wraps that into a Continuable.
    • Continuable

      public Continuable(groovy.lang.Script cpsTransformedScript, Env env)
      Takes a Script compiled from CPS-transforming GroovyShell and wraps that into a Continuable, in the context of the given Env. The added 'env' parameter can be used to control the execution flow in case of exceptions, and/or providing custom Invoker
    • Continuable

      public Continuable(groovy.lang.Script cpsTransformedScript, Env env, Continuation k)
      Takes a Script compiled from CPS-transforming GroovyShell and wraps that into a Continuable. The added 'k' parameter can be used to pass the control to somewhere else when the script has finished executing.
  • Method Details