Interface GroovyScriptCompiler


public interface GroovyScriptCompiler
To let camel-groovy pre-compile script files during bootstrap.
  • Field Details

  • Method Details

    • setScriptPattern

      void setScriptPattern(String scriptPattern)
      Directories to scan for groovy source to be pre-compiled. The directories are using Ant-path style pattern, and multiple directories can be specified separated by comma.
    • getScriptPattern

      String getScriptPattern()
      Directories to scan for groovy source to be pre-compiled. The directories are using Ant-path style pattern, and multiple directories can be specified separated by comma.
    • setPreloadCompiled

      void setPreloadCompiled(boolean preloadCompiled)
      Whether to preload existing compiled Groovy sources from classpath and the CompileStrategy.getWorkDir(), on startup. This can be enabled to avoid compiling sources that already has been compiled during a build phase.
    • isPreloadCompiled

      boolean isPreloadCompiled()
      Whether to preload existing compiled Groovy sources from the CompileStrategy.getWorkDir(), on startup. This can be enabled to avoid compiling sources that already has been compiled during a build phase.
    • recompile

      void recompile(Resource resource) throws Exception
      Compiles or re-compiles the given groovy source
      Parameters:
      resource - the groovy source
      Throws:
      Exception - is thrown if compilation error
    • existsSourceFiles

      static boolean existsSourceFiles(CamelContext context, String scriptPattern) throws Exception
      Checks whether any groovy sources exists?
      Parameters:
      context - the camel context
      scriptPattern - directories to scan
      Returns:
      true if any resources exists, false otherwise
      Throws:
      Exception