This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit f282a957361b25005af4879e15f4a9f47f8488bd Author: James Netherton <jamesnether...@gmail.com> AuthorDate: Thu Apr 23 15:08:53 2020 +0100 Register required AHC classes for runtime initialization Fixes #1126 --- .../support/ahc/deployment/SupportAhcProcessor.java | 15 +++++++++++++++ .../component/ahc/ws/deployment/AhcWsProcessor.java | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/extensions-support/ahc/deployment/src/main/java/org/apache/camel/quarkus/component/support/ahc/deployment/SupportAhcProcessor.java b/extensions-support/ahc/deployment/src/main/java/org/apache/camel/quarkus/component/support/ahc/deployment/SupportAhcProcessor.java index 9ae0aa8..dc1c53f 100644 --- a/extensions-support/ahc/deployment/src/main/java/org/apache/camel/quarkus/component/support/ahc/deployment/SupportAhcProcessor.java +++ b/extensions-support/ahc/deployment/src/main/java/org/apache/camel/quarkus/component/support/ahc/deployment/SupportAhcProcessor.java @@ -16,14 +16,22 @@ */ package org.apache.camel.quarkus.component.support.ahc.deployment; +import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; +import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; class SupportAhcProcessor { private static final String FEATURE = "camel-support-ahc"; + private static final String[] RUNTIME_INITIALIZED_CLASSES = new String[] { + "org.asynchttpclient.netty.channel.ChannelManager", + "org.asynchttpclient.netty.request.NettyRequestSender", + "org.asynchttpclient.RequestBuilderBase", + "org.asynchttpclient.resolver.RequestHostnameResolver" + }; @BuildStep FeatureBuildItem feature() { @@ -42,4 +50,11 @@ class SupportAhcProcessor { return new ExtensionSslNativeSupportBuildItem(FEATURE); } + @BuildStep + void runtimeInitializedClasses(BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitializedClass) { + for (String className : RUNTIME_INITIALIZED_CLASSES) { + runtimeInitializedClass + .produce(new RuntimeInitializedClassBuildItem(className)); + } + } } diff --git a/extensions/ahc-ws/deployment/src/main/java/org/apache/camel/quarkus/component/ahc/ws/deployment/AhcWsProcessor.java b/extensions/ahc-ws/deployment/src/main/java/org/apache/camel/quarkus/component/ahc/ws/deployment/AhcWsProcessor.java index 09d5671..5171ec1 100644 --- a/extensions/ahc-ws/deployment/src/main/java/org/apache/camel/quarkus/component/ahc/ws/deployment/AhcWsProcessor.java +++ b/extensions/ahc-ws/deployment/src/main/java/org/apache/camel/quarkus/component/ahc/ws/deployment/AhcWsProcessor.java @@ -18,6 +18,7 @@ package org.apache.camel.quarkus.component.ahc.ws.deployment; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; class AhcWsProcessor { @@ -28,4 +29,8 @@ class AhcWsProcessor { return new FeatureBuildItem(FEATURE); } + @BuildStep + RuntimeInitializedClassBuildItem runtimeInitializedClasses() { + return new RuntimeInitializedClassBuildItem("org.asynchttpclient.netty.ws.NettyWebSocket"); + } }