You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2020/04/20 09:30:18 UTC

[camel-quarkus] branch master updated: Remove unneccessary reflective class registration for camel configuration

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


The following commit(s) were added to refs/heads/master by this push:
     new 116da7f  Remove unneccessary reflective class registration for camel configuration
116da7f is described below

commit 116da7fa7714c399dcafe30c9e3f6dfbba86955c
Author: James Netherton <ja...@gmail.com>
AuthorDate: Mon Apr 20 08:18:25 2020 +0100

    Remove unneccessary reflective class registration for camel configuration
    
    Fixes #843
---
 .../component/azure/deployment/AzureProcessor.java   | 20 --------------------
 .../component/jira/deployment/JiraProcessor.java     | 13 -------------
 .../component/paho/deployment/PahoProcessor.java     | 10 +---------
 .../servicenow/deployment/ServicenowProcessor.java   | 14 ++------------
 .../azure/src/main/resources/application.properties  |  6 ++++--
 .../jira/src/main/resources/application.properties   |  7 +++----
 .../component/messaging/it/ActiveMQTestResource.java |  4 ++--
 .../src/main/resources/application.properties        |  6 ++----
 8 files changed, 14 insertions(+), 66 deletions(-)

diff --git a/extensions/azure/deployment/src/main/java/org/apache/camel/quarkus/component/azure/deployment/AzureProcessor.java b/extensions/azure/deployment/src/main/java/org/apache/camel/quarkus/component/azure/deployment/AzureProcessor.java
index b4a9d68..4faa7bc 100644
--- a/extensions/azure/deployment/src/main/java/org/apache/camel/quarkus/component/azure/deployment/AzureProcessor.java
+++ b/extensions/azure/deployment/src/main/java/org/apache/camel/quarkus/component/azure/deployment/AzureProcessor.java
@@ -16,14 +16,8 @@
  */
 package org.apache.camel.quarkus.component.azure.deployment;
 
-import com.microsoft.azure.storage.StorageCredentialsAccountAndKey;
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
-import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
-import org.apache.camel.component.azure.blob.BlobServiceConfiguration;
-import org.apache.camel.component.azure.common.AbstractConfiguration;
-import org.apache.camel.component.azure.queue.QueueServiceConfiguration;
-import org.apache.camel.quarkus.core.deployment.UnbannedReflectiveBuildItem;
 
 class AzureProcessor {
 
@@ -33,18 +27,4 @@ class AzureProcessor {
     FeatureBuildItem feature() {
         return new FeatureBuildItem(FEATURE);
     }
-
-    @BuildStep
-    UnbannedReflectiveBuildItem whitelistConfigurationClasses() {
-        return new UnbannedReflectiveBuildItem(BlobServiceConfiguration.class.getName(),
-                QueueServiceConfiguration.class.getName());
-    }
-
-    @BuildStep
-    ReflectiveClassBuildItem registerForReflection() {
-        return new ReflectiveClassBuildItem(true, true, AbstractConfiguration.class, BlobServiceConfiguration.class,
-                QueueServiceConfiguration.class,
-                StorageCredentialsAccountAndKey.class);
-    }
-
 }
diff --git a/extensions/jira/deployment/src/main/java/org/apache/camel/quarkus/component/jira/deployment/JiraProcessor.java b/extensions/jira/deployment/src/main/java/org/apache/camel/quarkus/component/jira/deployment/JiraProcessor.java
index f1634f3..dd964af 100644
--- a/extensions/jira/deployment/src/main/java/org/apache/camel/quarkus/component/jira/deployment/JiraProcessor.java
+++ b/extensions/jira/deployment/src/main/java/org/apache/camel/quarkus/component/jira/deployment/JiraProcessor.java
@@ -23,9 +23,6 @@ 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.ReflectiveClassBuildItem;
-import org.apache.camel.component.jira.JiraConfiguration;
-import org.apache.camel.quarkus.core.deployment.UnbannedReflectiveBuildItem;
 import org.joda.time.DateTimeZone;
 
 class JiraProcessor {
@@ -43,16 +40,6 @@ class JiraProcessor {
     }
 
     @BuildStep
-    ReflectiveClassBuildItem registerForReflection() {
-        return new ReflectiveClassBuildItem(true, true, JiraConfiguration.class);
-    }
-
-    @BuildStep()
-    UnbannedReflectiveBuildItem unbannedReflectiveItems() {
-        return new UnbannedReflectiveBuildItem(JiraConfiguration.class.getName());
-    }
-
-    @BuildStep
     NativeImageResourceBuildItem nativeImageResources() {
         // Add Joda timezone resources into the native image as it is required by com.atlassian.jira.rest.client.internal.json.JsonParseUtil
         List<String> timezones = new ArrayList<>();
diff --git a/extensions/paho/deployment/src/main/java/org/apache/camel/quarkus/component/paho/deployment/PahoProcessor.java b/extensions/paho/deployment/src/main/java/org/apache/camel/quarkus/component/paho/deployment/PahoProcessor.java
index 8d7f7b1..2e03afe 100644
--- a/extensions/paho/deployment/src/main/java/org/apache/camel/quarkus/component/paho/deployment/PahoProcessor.java
+++ b/extensions/paho/deployment/src/main/java/org/apache/camel/quarkus/component/paho/deployment/PahoProcessor.java
@@ -27,8 +27,6 @@ import io.quarkus.deployment.builditem.FeatureBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
-import org.apache.camel.component.paho.PahoConfiguration;
-import org.apache.camel.quarkus.core.deployment.UnbannedReflectiveBuildItem;
 import org.eclipse.paho.client.mqttv3.internal.SSLNetworkModuleFactory;
 import org.eclipse.paho.client.mqttv3.internal.TCPNetworkModuleFactory;
 import org.eclipse.paho.client.mqttv3.logging.JSR47Logger;
@@ -41,8 +39,7 @@ class PahoProcessor {
     private static final List<Class<?>> PAHO_REFLECTIVE_CLASSES = Arrays.asList(
             JSR47Logger.class,
             TCPNetworkModuleFactory.class,
-            SSLNetworkModuleFactory.class,
-            PahoConfiguration.class);
+            SSLNetworkModuleFactory.class);
 
     @Inject
     BuildProducer<NativeImageResourceBuildItem> resource;
@@ -64,11 +61,6 @@ class PahoProcessor {
     }
 
     @BuildStep
-    UnbannedReflectiveBuildItem whitelistConfigurationClasses() {
-        return new UnbannedReflectiveBuildItem(PahoConfiguration.class.getName());
-    }
-
-    @BuildStep
     void registerBundleResource() {
         resource.produce(new NativeImageResourceBuildItem("META-INF/services/" + NetworkModuleFactory.class.getName()));
         resourceBundle.produce(new NativeImageResourceBundleBuildItem("org.eclipse.paho.client.mqttv3.internal.nls.logcat"));
diff --git a/extensions/servicenow/deployment/src/main/java/org/apache/camel/quarkus/component/servicenow/deployment/ServicenowProcessor.java b/extensions/servicenow/deployment/src/main/java/org/apache/camel/quarkus/component/servicenow/deployment/ServicenowProcessor.java
index 7618732..df13af1 100644
--- a/extensions/servicenow/deployment/src/main/java/org/apache/camel/quarkus/component/servicenow/deployment/ServicenowProcessor.java
+++ b/extensions/servicenow/deployment/src/main/java/org/apache/camel/quarkus/component/servicenow/deployment/ServicenowProcessor.java
@@ -18,23 +18,15 @@ package org.apache.camel.quarkus.component.servicenow.deployment;
 
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
 import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
-import org.apache.camel.component.servicenow.ServiceNowConfiguration;
-import org.apache.camel.quarkus.core.deployment.UnbannedReflectiveBuildItem;
 import org.apache.cxf.transport.http.HTTPTransportFactory;
 
 class ServicenowProcessor {
 
     private static final String FEATURE = "camel-servicenow";
 
-    private static final String[] reflectionClasses = new String[] {
-            ServiceNowConfiguration.class.getCanonicalName(),
-            HTTPTransportFactory.class.getCanonicalName()
-    };
-
     @BuildStep
     FeatureBuildItem feature() {
         return new FeatureBuildItem(FEATURE);
@@ -46,9 +38,7 @@ class ServicenowProcessor {
     }
 
     @BuildStep
-    void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
-            BuildProducer<UnbannedReflectiveBuildItem> unbannedClass, CombinedIndexBuildItem combinedIndex) {
-        reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, reflectionClasses));
-        unbannedClass.produce(new UnbannedReflectiveBuildItem(reflectionClasses));
+    void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
+        reflectiveClass.produce(new ReflectiveClassBuildItem(false, true, HTTPTransportFactory.class.getCanonicalName()));
     }
 }
diff --git a/integration-tests/azure/src/main/resources/application.properties b/integration-tests/azure/src/main/resources/application.properties
index da15838..fa2d35c 100644
--- a/integration-tests/azure/src/main/resources/application.properties
+++ b/integration-tests/azure/src/main/resources/application.properties
@@ -19,5 +19,7 @@
 #
 # Camel :: Azure
 #
-camel.component.azure-blob.configuration.credentials = #class:com.microsoft.azure.storage.StorageCredentialsAccountAndKey("'{{env:AZURE_STORAGE_ACCOUNT}}'", "'{{env:AZURE_STORAGE_KEY}}'")
-camel.component.azure-queue.configuration.credentials = #class:com.microsoft.azure.storage.StorageCredentialsAccountAndKey("'{{env:AZURE_STORAGE_ACCOUNT}}'", "'{{env:AZURE_STORAGE_KEY}}'")
+camel.component.azure-blob.credentialsAccountName = {{env:AZURE_STORAGE_ACCOUNT}}
+camel.component.azure-blob.credentialsAccountKey = {{env:AZURE_STORAGE_KEY}}
+camel.component.azure-queue.credentialsAccountName = {{env:AZURE_STORAGE_ACCOUNT}}
+camel.component.azure-queue.credentialsAccountKey = {{env:AZURE_STORAGE_KEY}}
diff --git a/integration-tests/jira/src/main/resources/application.properties b/integration-tests/jira/src/main/resources/application.properties
index 51f18fe..b6825c5 100644
--- a/integration-tests/jira/src/main/resources/application.properties
+++ b/integration-tests/jira/src/main/resources/application.properties
@@ -20,7 +20,6 @@
 #
 jira.issues.project-key={{env:JIRA_ISSUES_PROJECT_KEY}}
 
-camel.component.jira.configuration = #class:org.apache.camel.component.jira.JiraConfiguration
-camel.component.jira.configuration.jira-url={{env:JIRA_URL}}
-camel.component.jira.configuration.username={{env:JIRA_USERNAME}}
-camel.component.jira.configuration.password={{env:JIRA_PASSWORD}}
+camel.component.jira.jira-url={{env:JIRA_URL}}
+camel.component.jira.username={{env:JIRA_USERNAME}}
+camel.component.jira.password={{env:JIRA_PASSWORD}}
diff --git a/integration-tests/messaging/src/test/java/org/apache/camel/quarkus/component/messaging/it/ActiveMQTestResource.java b/integration-tests/messaging/src/test/java/org/apache/camel/quarkus/component/messaging/it/ActiveMQTestResource.java
index b6f3f08..e72c00f 100644
--- a/integration-tests/messaging/src/test/java/org/apache/camel/quarkus/component/messaging/it/ActiveMQTestResource.java
+++ b/integration-tests/messaging/src/test/java/org/apache/camel/quarkus/component/messaging/it/ActiveMQTestResource.java
@@ -57,8 +57,8 @@ public class ActiveMQTestResource implements QuarkusTestResourceLifecycleManager
                     "quarkus.artemis.username", ACTIVEMQ_USERNAME,
                     "quarkus.artemis.password", ACTIVEMQ_PASSWORD,
                     "camel.component.paho.brokerUrl", brokerUrl,
-                    "camel.component.paho.configuration.username", ACTIVEMQ_USERNAME,
-                    "camel.component.paho.configuration.password", ACTIVEMQ_PASSWORD);
+                    "camel.component.paho.username", ACTIVEMQ_USERNAME,
+                    "camel.component.paho.password", ACTIVEMQ_PASSWORD);
 
         } catch (Exception e) {
             throw new RuntimeException(e);
diff --git a/integration-tests/servicenow/src/main/resources/application.properties b/integration-tests/servicenow/src/main/resources/application.properties
index bfdee1e..1950833 100644
--- a/integration-tests/servicenow/src/main/resources/application.properties
+++ b/integration-tests/servicenow/src/main/resources/application.properties
@@ -19,7 +19,5 @@
 # Camel :: ServiceNow
 #
 servicenow.instance={{env:SERVICENOW_INSTANCE}}
-
-camel.component.servicenow.configuration = #class:org.apache.camel.component.servicenow.ServiceNowConfiguration
-camel.component.servicenow.configuration.username={{env:SERVICENOW_USERNAME}}
-camel.component.servicenow.configuration.password={{env:SERVICENOW_PASSWORD}}
+camel.component.servicenow.username={{env:SERVICENOW_USERNAME}}
+camel.component.servicenow.password={{env:SERVICENOW_PASSWORD}}