Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
public class CustomGroovyShellFactory implements GroovyShellFactory {
 
  GroovyShell createGroovyShell(Exchange exchange) {
    ImportCustomizer importCustomizer = new ImportCustomizer()
    importCustomizer.addStaticStars 'com.example.Utils'
    CompilerConfiguration configuration = new CompilerConfiguration()
    configuration.addCompilationCustomizers(importCustomizer)
    return new GroovyShell(configuration)
  }


}

...Camel will use your custom GroovyShell instance (containing your custom static imports), instead of the default one.

...