From d9d2d37269ac11a079624aa6a06e8812c9dc1eaf Mon Sep 17 00:00:00 2001 From: Timothy Power Date: Thu, 19 Mar 2020 22:47:37 +0800 Subject: [PATCH] Alexa SkillStreamHandler subclass check for RequestStreamHandler --- bom/runtime/pom.xml | 1 + .../amazon/lambda/deployment/AmazonLambdaProcessor.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bom/runtime/pom.xml b/bom/runtime/pom.xml index fc609bc88155f..8905c9555d385 100644 --- a/bom/runtime/pom.xml +++ b/bom/runtime/pom.xml @@ -140,6 +140,7 @@ 1.3.1 2.4.0 2.10.70 + 2.28.0 1.3.0 1.3.61 0.11.3 diff --git a/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java b/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java index 42be5690ba20f..efac080651636 100644 --- a/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java +++ b/extensions/amazon-lambda/deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaProcessor.java @@ -50,6 +50,7 @@ public final class AmazonLambdaProcessor { private static final DotName REQUEST_HANDLER = DotName.createSimple(RequestHandler.class.getName()); private static final DotName REQUEST_STREAM_HANDLER = DotName.createSimple(RequestStreamHandler.class.getName()); + private static final DotName SKILL_STREAM_HANDLER = DotName.createSimple("com.amazon.ask.SkillStreamHandler"); private static final DotName NAMED = DotName.createSimple(Named.class.getName()); private static final Logger log = Logger.getLogger(AmazonLambdaProcessor.class); @@ -70,11 +71,13 @@ List discover(CombinedIndexBuildItem combinedIndexBuildIt BuildProducer additionalBeanBuildItemBuildProducer, BuildProducer reflectiveHierarchy, BuildProducer reflectiveClassBuildItemBuildProducer) throws BuildException { + Collection allKnownImplementors = combinedIndexBuildItem.getIndex().getAllKnownImplementors(REQUEST_HANDLER); - Collection allKnownStreamImplementors = combinedIndexBuildItem.getIndex() - .getAllKnownImplementors(REQUEST_STREAM_HANDLER); + allKnownImplementors.addAll(combinedIndexBuildItem.getIndex() + .getAllKnownImplementors(REQUEST_STREAM_HANDLER)); + allKnownImplementors.addAll(combinedIndexBuildItem.getIndex() + .getAllKnownImplementors(SKILL_STREAM_HANDLER)); - allKnownImplementors.addAll(allKnownStreamImplementors); if (allKnownImplementors.size() > 0 && providedLambda.isPresent()) { throw new BuildException( "Multiple handler classes. You have a custom handler class and the " + providedLambda.get().getProvider()