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

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


The following commit(s) were added to refs/heads/master by this push:
     new e2bda73  CAMEL-16353: camel-main - Add @EagerClassloaded to mark 
classes which should be eager loaded via camel-main. This optimize to load 
these classes before Camel is started and otherwise would load these classes on 
first message processed. A maven plugin scans the code and updates the source 
code to keep the list of classes to eager loaded automatic up-to-date.
e2bda73 is described below

commit e2bda73c4f80b98fea4a19b7ca5fcc04224ff70e
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Mar 31 13:54:44 2021 +0200

    CAMEL-16353: camel-main - Add @EagerClassloaded to mark classes which 
should be eager loaded via camel-main. This optimize to load these classes 
before Camel is started and otherwise would load these classes on first message 
processed. A maven plugin scans the code and updates the source code to keep 
the list of classes to eager loaded automatic up-to-date.
---
 .../java/org/apache/camel/spi/annotations/EagerClassloaded.java  | 9 +++++++++
 .../java/org/apache/camel/spi/annotations/EagerClassloaded.java  | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git 
a/core/camel-api/src/generated/java/org/apache/camel/spi/annotations/EagerClassloaded.java
 
b/core/camel-api/src/generated/java/org/apache/camel/spi/annotations/EagerClassloaded.java
index 65246b1..99817ac 100644
--- 
a/core/camel-api/src/generated/java/org/apache/camel/spi/annotations/EagerClassloaded.java
+++ 
b/core/camel-api/src/generated/java/org/apache/camel/spi/annotations/EagerClassloaded.java
@@ -25,6 +25,15 @@ import java.lang.annotation.Target;
  * Marks this class to be eager loaded by the JDK classloader so the class is 
already loaded when Camel is started.
  *
  * This is intended to assist required classes that Camel always uses.
+ *
+ * <b>Important:</b> The class must have the following static method which 
will be invoked to force loading the class.
+ * 
+ * <pre>
+ * public static void onClassloaded(org.slf4j.Logger log) {
+ *     .. do warmup here such as logging the class name or create inner 
classes to force loading them
+ *     log.trace("Loaded {}", this.getClass().getName());
+ * }
+ * </pre>
  */
 @Target(ElementType.TYPE)
 @Retention(RetentionPolicy.RUNTIME)
diff --git 
a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/EagerClassloaded.java
 
b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/EagerClassloaded.java
index 65246b1..99817ac 100644
--- 
a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/EagerClassloaded.java
+++ 
b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/EagerClassloaded.java
@@ -25,6 +25,15 @@ import java.lang.annotation.Target;
  * Marks this class to be eager loaded by the JDK classloader so the class is 
already loaded when Camel is started.
  *
  * This is intended to assist required classes that Camel always uses.
+ *
+ * <b>Important:</b> The class must have the following static method which 
will be invoked to force loading the class.
+ * 
+ * <pre>
+ * public static void onClassloaded(org.slf4j.Logger log) {
+ *     .. do warmup here such as logging the class name or create inner 
classes to force loading them
+ *     log.trace("Loaded {}", this.getClass().getName());
+ * }
+ * </pre>
  */
 @Target(ElementType.TYPE)
 @Retention(RetentionPolicy.RUNTIME)

Reply via email to