Package org.apache.camel.spi
Interface GroovyScriptCompiler
public interface GroovyScriptCompiler
To let camel-groovy pre-compile script files during bootstrap.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
existsSourceFiles
(CamelContext context, String scriptPattern) Checks whether any groovy sources exists?Directories to scan for groovy source to be pre-compiled.boolean
Whether to preload existing compiled Groovy sources from theCompileStrategy.getWorkDir()
, on startup.void
Compiles or re-compiles the given groovy sourcevoid
setPreloadCompiled
(boolean preloadCompiled) Whether to preload existing compiled Groovy sources from classpath and theCompileStrategy.getWorkDir()
, on startup.void
setScriptPattern
(String scriptPattern) Directories to scan for groovy source to be pre-compiled.
-
Field Details
-
FACTORY
Service factory key.- See Also:
-
-
Method Details
-
setScriptPattern
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 theCompileStrategy.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 theCompileStrategy.getWorkDir()
, on startup. This can be enabled to avoid compiling sources that already has been compiled during a build phase. -
recompile
Compiles or re-compiles the given groovy source- Parameters:
resource
- the groovy source- Throws:
Exception
- is thrown if compilation error
-
existsSourceFiles
Checks whether any groovy sources exists?- Parameters:
context
- the camel contextscriptPattern
- directories to scan- Returns:
- true if any resources exists, false otherwise
- Throws:
Exception
-