This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch gs
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 80cc26517abe1f8a3b991cebae6d0278af684d12
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Jul 14 13:19:52 2025 +0200

    CAMEL-22214: camel-groovy - Allow to pre-load groovy source files for 
shared functions and DTOs
---
 .../camel/language/groovy/DefaultGroovyScriptCompiler.java   | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/DefaultGroovyScriptCompiler.java
 
b/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/DefaultGroovyScriptCompiler.java
index 23198c28a0f..51d09ad2aee 100644
--- 
a/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/DefaultGroovyScriptCompiler.java
+++ 
b/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/DefaultGroovyScriptCompiler.java
@@ -59,17 +59,17 @@ public class DefaultGroovyScriptCompiler extends 
ServiceSupport
         this.camelContext = camelContext;
     }
 
-    @ManagedAttribute(description = "Total compilation time in millis")
+    @ManagedAttribute(description = "Total Groovy compilation time in millis")
     public long getCompileTime() {
         return elapsed;
     }
 
-    @ManagedAttribute(description = "Number of groovy sources that has been 
compiled")
+    @ManagedAttribute(description = "Number of Groovy sources that has been 
compiled")
     public int getClassesSize() {
         return classLoader.size();
     }
 
-    @ManagedAttribute(description = "Directories to scan for groovy source to 
be pre-compiled")
+    @ManagedAttribute(description = "Directories to scan for Groovy source to 
be pre-compiled")
     @Override
     public String getScriptPattern() {
         return scriptPattern;
@@ -102,7 +102,7 @@ public class DefaultGroovyScriptCompiler extends 
ServiceSupport
         if (scriptPattern != null) {
             StopWatch watch = new StopWatch();
 
-            LOG.info("Pre compiling groovy scripts from: {}", scriptPattern);
+            LOG.info("Pre-compiling Groovy source from: {}", scriptPattern);
 
             ClassLoader cl = camelContext.getApplicationContextClassLoader();
             if (cl == null) {
@@ -143,8 +143,12 @@ public class DefaultGroovyScriptCompiler extends 
ServiceSupport
 
             // parse code into classes and add to classloader
             for (String code : codes) {
+                if (LOG.isTraceEnabled()) {
+                    LOG.trace("Pre-compiling Groovy source:\n{}", code);
+                }
                 Class<?> clazz = shell.getClassLoader().parseClass(code);
                 if (clazz != null) {
+                    LOG.debug("Pre-compiled Groovy class: {}", 
clazz.getName());
                     classLoader.addClass(clazz.getName(), clazz);
                 }
             }

Reply via email to