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

CAMEL-18977: camel-joor - Make the code more flexible for native mode #9216

Merged
merged 1 commit into from Jan 27, 2023

Conversation

essobedo
Copy link
Contributor

Fix for https://issues.apache.org/jira/browse/CAMEL-18977 (for 3.x)

Motivation

With the current code base, it is hard to change the behavior of the jOOR language in order to move most of the logic at build time and/or at static initialization time, without having to use ugly hacks like reflection. The goal of this task is to make the code more flexible to avoid using hacks.

Modifications:

  • Add a constructor to the class JoorLanguage to be able to inject specific jOOR compiler and jOOR script compiler
  • Add getters for the jOOR compiler and jOOR script compiler
  • Make the method evalCode public to give access to the generated code.

@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

⚠️ Please note that the changes on this PR may be tested automatically.

If necessary Apache Camel Committers may access logs and test results in the job summaries!

@github-actions
Copy link
Contributor

Components tested:

Total Tested Failed ❌ Passed ✅
1 1 0 1

@essobedo
Copy link
Contributor Author

The checkstyle issue is not related to this PR but is in camel-jbang-core:

[camel-jbang-core] [INFO] Starting audit...
[ERROR] /home/runner/work/camel/camel/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CodeRestGenerator.java:108:22: Name 'CODE' must match pattern '^[a-z][a-zA-Z0-9]*$'. [LocalFinalVariableName]
[ERROR] /home/runner/work/camel/camel/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CodeRestGenerator.java:109:22: Name 'GENERATOR_NAME' must match pattern '^[a-z][a-zA-Z0-9]*$'. [LocalFinalVariableName]
[ERROR] /home/runner/work/camel/camel/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CodeRestGenerator.java:110:22: Name 'LIBRARY' must match pattern '^[a-z][a-zA-Z0-9]*$'. [LocalFinalVariableName]

@essobedo essobedo merged commit 485da6e into camel-3.x Jan 27, 2023
@essobedo essobedo deleted the CAMEL-18977/make-native-mode-compatible-v3 branch January 27, 2023 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants