You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/09/09 06:51:34 UTC

[camel-quarkus] branch master updated (618475a -> cc4df64)

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

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git.


    from 618475a  Freemarker JVM support
     new 9542abe  AWS2-Lambda Extension: Adding interceptors and align to the other extensions
     new cc4df64  Fixed CS

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../lambda/deployment/Aws2LambdaProcessor.java     | 38 ++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)


[camel-quarkus] 01/02: AWS2-Lambda Extension: Adding interceptors and align to the other extensions

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9542abe465c18f113214febcce71cdbf692d88e3
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Sep 9 07:32:33 2020 +0200

    AWS2-Lambda Extension: Adding interceptors and align to the other extensions
---
 .../lambda/deployment/Aws2LambdaProcessor.java     | 39 ++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

diff --git a/extensions/aws2-lambda/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/lambda/deployment/Aws2LambdaProcessor.java b/extensions/aws2-lambda/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/lambda/deployment/Aws2LambdaProcessor.java
index ebc7197..474545e 100644
--- a/extensions/aws2-lambda/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/lambda/deployment/Aws2LambdaProcessor.java
+++ b/extensions/aws2-lambda/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/lambda/deployment/Aws2LambdaProcessor.java
@@ -16,17 +16,52 @@
  */
 package org.apache.camel.quarkus.component.aws2.lambda.deployment;
 
+import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
-import org.jboss.logging.Logger;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.jboss.jandex.DotName;
 
 class Aws2LambdaProcessor {
 
-    private static final Logger LOG = Logger.getLogger(Aws2LambdaProcessor.class);
     private static final String FEATURE = "camel-aws2-lambda";
 
+    public static final String AWS_SDK_APPLICATION_ARCHIVE_MARKERS = "software/amazon/awssdk";
+
+    private static final List<String> INTERCEPTOR_PATHS = Arrays.asList(
+            "software/amazon/awssdk/global/handlers/execution.interceptors");
+
+    private static final DotName EXECUTION_INTERCEPTOR_NAME = DotName.createSimple(ExecutionInterceptor.class.getName());
+
     @BuildStep
     FeatureBuildItem feature() {
         return new FeatureBuildItem(FEATURE);
     }
+
+    @BuildStep(applicationArchiveMarkers = { AWS_SDK_APPLICATION_ARCHIVE_MARKERS })
+    void process(CombinedIndexBuildItem combinedIndexBuildItem,
+            BuildProducer<ReflectiveClassBuildItem> reflectiveClasses,
+            BuildProducer<NativeImageResourceBuildItem> resource) {
+
+        INTERCEPTOR_PATHS.forEach(path -> resource.produce(new NativeImageResourceBuildItem(path)));
+
+        List<String> knownInterceptorImpls = combinedIndexBuildItem.getIndex()
+                .getAllKnownImplementors(EXECUTION_INTERCEPTOR_NAME)
+                .stream()
+                .map(c -> c.name().toString()).collect(Collectors.toList());
+
+        reflectiveClasses.produce(new ReflectiveClassBuildItem(false, false,
+                knownInterceptorImpls.toArray(new String[knownInterceptorImpls.size()])));
+
+        reflectiveClasses.produce(new ReflectiveClassBuildItem(true, false,
+                String.class.getCanonicalName()));
+    }
 }


[camel-quarkus] 02/02: Fixed CS

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit cc4df648bdbedd028e64c516041dc972d1d0e5a5
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Sep 9 07:39:20 2020 +0200

    Fixed CS
---
 .../component/aws2/lambda/deployment/Aws2LambdaProcessor.java | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/extensions/aws2-lambda/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/lambda/deployment/Aws2LambdaProcessor.java b/extensions/aws2-lambda/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/lambda/deployment/Aws2LambdaProcessor.java
index 474545e..9f76e9e 100644
--- a/extensions/aws2-lambda/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/lambda/deployment/Aws2LambdaProcessor.java
+++ b/extensions/aws2-lambda/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/lambda/deployment/Aws2LambdaProcessor.java
@@ -16,19 +16,18 @@
  */
 package org.apache.camel.quarkus.component.aws2.lambda.deployment;
 
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
-import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-
 import org.jboss.jandex.DotName;
+import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
 
 class Aws2LambdaProcessor {