Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CombinedIndexBuildItem to receive ClassInfo on inherited interfaces #7955

Closed
oztimpower opened this issue Mar 19, 2020 · 3 comments
Closed
Labels
kind/enhancement New feature or request triage/duplicate This issue or pull request already exists

Comments

@oztimpower
Copy link
Contributor

Description
For example, per Amazon Lambda extension documentation updates:

Writing Skills with the Amazon Alexa ASK SDK v2

The starting point for an Alexa Skill on AWS Lambda is typically via subclassing SkillStreamHandler, which implements the RequestStreamHandler::requestHandler method. If you examine the source code for this class it is very simple, and can be implemented directly without this helper base class.

NOTE: Quarkus requires a direct implementation of RequestStreamHandler, as the build process will scan only directly implemented interfaces, inherited interfaces will not be seen.

Implementation ideas

Generated ClassInfo, as part of the CombinedIndexBuildItem, to include all inherited interfaces. It currently only contains directly implemented interfaces.

For example in Amazon Lambda, AmazonLambdaProcesser, the code below looking for a specific interface implementation, would see the inherited interfaces.

Collection<ClassInfo> allKnownImplementors = combinedIndexBuildItem.getIndex().getAllKnownImplementors(REQUEST_HANDLER);

    @BuildStep
    List<AmazonLambdaBuildItem> discover(CombinedIndexBuildItem combinedIndexBuildItem,
            Optional<ProvidedAmazonLambdaHandlerBuildItem> providedLambda,
            BuildProducer<AdditionalBeanBuildItem> additionalBeanBuildItemBuildProducer,
            BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy,
            BuildProducer<ReflectiveClassBuildItem> reflectiveClassBuildItemBuildProducer) throws BuildException {
  
      Collection<ClassInfo> allKnownImplementors = combinedIndexBuildItem.getIndex().getAllKnownImplementors(REQUEST_HANDLER);

      Collection<ClassInfo> allKnownStreamImplementors = combinedIndexBuildItem.getIndex()
                .getAllKnownImplementors(REQUEST_STREAM_HANDLER);


/cc @gsmet
/cc @patriot1burke

@oztimpower oztimpower added the kind/enhancement New feature or request label Mar 19, 2020
@geoand
Copy link
Contributor

geoand commented Mar 19, 2020

I think this request is essentially this issue: smallrye/jandex#65

@gsmet
Copy link
Member

gsmet commented Mar 19, 2020

For now, I would just also get the classes implementing SkillStreamHandler and merge them with the others.

Not ideal and we should definitely pursue this on the Jandex side but good enough for this particular case.

@oztimpower
Copy link
Contributor Author

Closing as a workaround has been implemented in #7985, and as above there is already a FR open on smallrye/jandex#65

@gsmet gsmet added the triage/duplicate This issue or pull request already exists label Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants