From 02f95c6a9d9aa94896e56e1e20e3cfb1dce5447e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Galder=20Zamarren=CC=83o?= Date: Fri, 1 Oct 2021 19:44:33 +0200 Subject: [PATCH] Make KieModuleMarshaller run time initialized --- .../runtime/graal/OptaPlannerFeature.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 optaplanner-quarkus-integration/optaplanner-quarkus/runtime/src/main/java/org/optaplanner/quarkus/runtime/graal/OptaPlannerFeature.java diff --git a/optaplanner-quarkus-integration/optaplanner-quarkus/runtime/src/main/java/org/optaplanner/quarkus/runtime/graal/OptaPlannerFeature.java b/optaplanner-quarkus-integration/optaplanner-quarkus/runtime/src/main/java/org/optaplanner/quarkus/runtime/graal/OptaPlannerFeature.java new file mode 100644 index 00000000000..72d566a9809 --- /dev/null +++ b/optaplanner-quarkus-integration/optaplanner-quarkus/runtime/src/main/java/org/optaplanner/quarkus/runtime/graal/OptaPlannerFeature.java @@ -0,0 +1,17 @@ +package org.optaplanner.quarkus.runtime.graal; + +import org.graalvm.nativeimage.ImageSingletons; +import org.graalvm.nativeimage.hosted.Feature; +import org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport; + +import com.oracle.svm.core.annotate.AutomaticFeature; + +@AutomaticFeature +public class OptaPlannerFeature implements Feature { + @Override + public void afterRegistration(AfterRegistrationAccess access) { + final RuntimeClassInitializationSupport runtimeInit = ImageSingletons.lookup(RuntimeClassInitializationSupport.class); + final String reason = "Quarkus run time init for OptaPlanner"; + runtimeInit.initializeAtRunTime("org.drools.compiler.kproject.models.KieModuleMarshaller", reason); + } +}