Class GroovyShellDecorator

  • All Implemented Interfaces:
    ExtensionPoint

    public abstract class GroovyShellDecorator
    extends Object
    implements ExtensionPoint
    Hook to customize the behaviour of GroovyShell used to run workflow scripts.
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • GroovyShellDecorator

        public GroovyShellDecorator()
    • Method Detail

      • customizeImports

        public void customizeImports​(@CheckForNull
                                     CpsFlowExecution context,
                                     org.codehaus.groovy.control.customizers.ImportCustomizer ic)
        Called with ImportCustomizer to auto-import more packages, etc.
        Parameters:
        context - null if GroovyShell is created just to test the parsing of the script.
      • configureCompiler

        public void configureCompiler​(@CheckForNull
                                      CpsFlowExecution context,
                                      org.codehaus.groovy.control.CompilerConfiguration cc)
        Called with CompilerConfiguration to provide opportunity to tweak the runtime environment further.
        Parameters:
        context - null if GroovyShell is created just to test the parsing of the script.
      • configureShell

        public void configureShell​(@CheckForNull
                                   CpsFlowExecution context,
                                   groovy.lang.GroovyShell shell)
        Called with a configured GroovyShell to further tweak its behaviours.
        Parameters:
        context - null if GroovyShell is created just to test the parsing of the script.
      • forTrusted

        public GroovyShellDecorator forTrusted()
        Obtains a contextualized GroovyShellDecorator used to decorate the trusted shell.

        By default, this method returns null decorator that doesn't do anything.

        See classloader.md for details.