You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/03/11 09:51:32 UTC

[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #3609: 3579 Improve quartz test coverage

JiriOndrusek commented on a change in pull request #3609:
URL: https://github.com/apache/camel-quarkus/pull/3609#discussion_r824553810



##########
File path: extensions/quartz/deployment/src/main/java/org/apache/camel/quarkus/component/quartz/deployment/QuartzProcessor.java
##########
@@ -44,4 +61,43 @@ NativeImageResourceBuildItem nativeImageResources() {
     ReflectiveClassBuildItem registerForReflection() {
         return new ReflectiveClassBuildItem(false, false, QUARTZ_JOB_CLASSES);
     }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflectionWithMethods() {
+        return new ReflectiveClassBuildItem(true, false, QUARTZ_JOB_CLASSES_WITH_METHODS);
+    }
+
+    @BuildStep
+    void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+            CombinedIndexBuildItem combinedIndex, CurateOutcomeBuildItem curateOutcome) {
+        IndexView index = combinedIndex.getIndex();
+
+        ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+        boolean oracleBlobIsPresent = applicationModel.getDependencies().stream()
+                .anyMatch(d -> d.getGroupId().equals("com.oracle.database.jdbc"));
+
+        final String[] delegatesImpl = index
+                .getAllKnownSubclasses(SQL_JDBC_DELEGATE)
+                .stream()
+                .map(c -> c.name().toString())
+                .filter(n -> oracleBlobIsPresent || !n.contains("oracle"))
+                .toArray(String[]::new);
+
+        reflectiveClasses.produce(new ReflectiveClassBuildItem(false, true, delegatesImpl));
+
+    }
+
+    @BuildStep
+    void indexSaxonHe(BuildProducer<IndexDependencyBuildItem> deps) {
+        deps.produce(new IndexDependencyBuildItem("org.quartz-scheduler", "quartz"));
+        deps.produce(new IndexDependencyBuildItem("org.apache.camel.quarkus", "camel-quarkus-quartz"));

Review comment:
       I'm not sure, why it is behave that way, but:
   
   - If index to itself is removed, registration for reflection (by annotation) does not work, and I'm getting `Caused by: java.lang.ClassNotFoundException: org.apache.camel.quarkus.component.quartz.CamelQuarkusQuartzConnectionProvider`
   Therefore I kept index of ourselves




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org