Class TransformerConfiguration

java.lang.Object
com.cloudbees.groovy.cps.TransformerConfiguration

public class TransformerConfiguration extends Object
Switches that affect the behaviour of CpsTransformer
Author:
Kohsuke Kawaguchi
See Also:
  • Constructor Details

    • TransformerConfiguration

      public TransformerConfiguration()
  • Method Details

    • getClosureType

      public org.codehaus.groovy.ast.ClassNode getClosureType()
    • withClosureType

      public TransformerConfiguration withClosureType(org.codehaus.groovy.ast.ClassNode closureType)
    • withClosureType

      public TransformerConfiguration withClosureType(Class<? extends groovy.lang.Closure> c)
    • withSafepoint

      public TransformerConfiguration withSafepoint(Class clazz, String methodName)
      Inserts a safepoint into transformed program.

      At every loop head and at the entry of a function, CPS-transformed program will call the specified no-arg static public method that returns void. This is useful to pause the execution of un-cooperative CPS transformed programs.

      A safepoint method can run some computation and return normally to keep the CPS interpreter going, or it can suspend the execution of a program.