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

Document allowContextMapAll native mode limitations #1855

Merged
merged 1 commit into from Sep 30, 2020

Conversation

jamesnetherton
Copy link
Contributor

Fixes #1807

Copy link
Contributor

@ppalaga ppalaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A suggestion inline

@@ -316,6 +320,29 @@ static boolean detectNativeSsl(Path deploymentBasePath) {
}
}

static boolean detectAllowContextMapAll(CqCatalog catalog, String artifactId) {
final String allowContextMapAll = "allowContextMapAll";
Optional<ArtifactModel<?>> optional = catalog.filterModels(artifactId).findFirst();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not work as expected if the first model is a LanguageModel or a Dataformat model. I think it would be safer to

Suggested change
Optional<ArtifactModel<?>> optional = catalog.filterModels(artifactId).findFirst();
return catalog.filterModels(artifactId)
.filter(m -> m instanceof ComponentModel)
.map(m -> (ComponentModel) m)
.anyMatch(/* your options condition here */)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Latest commit implements this suggestion.

@ppalaga
Copy link
Contributor

ppalaga commented Sep 30, 2020

I like general idea to auto-document allowContextMapAll based on the data from the Catalog

@jamesnetherton jamesnetherton merged commit fa37a04 into apache:master Sep 30, 2020
@jamesnetherton jamesnetherton deleted the contextmapall-docs branch September 30, 2020 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allowContextMapAll requires template engines to have reflective access to camel core classess
3 participants