GH-9507: Migrate Python support to GraalVM Polyglot
Fixes: #9507 Issue link: https://github.com/spring-projects/spring-integration/issues/9507 * Deprecate `PythonScriptExecutor` in favor of `PolyglotScriptExecutor` with a `python` as language * Add handling for `PolyglotWrapper` return type of the script evaluation * Rework `DeriveLanguageFromExtensionTests.testParseLanguage()` to the `@ParameterizedTest`
This commit is contained in:
@@ -28,7 +28,7 @@ compile "org.springframework.integration:spring-integration-scripting:{project-v
|
||||
----
|
||||
======
|
||||
|
||||
In addition, you need to add a script engine implementation, e.g. JRuby, Jython.
|
||||
In addition, you need to add a script engine implementation, e.g. JRuby.
|
||||
|
||||
Starting with version 5.2, Spring Integration provides a Kotlin Jsr223 support.
|
||||
You need to add this dependency into your project to make it working:
|
||||
@@ -293,9 +293,14 @@ They are mutually exclusive.
|
||||
[[graalmv-polyglot]]
|
||||
=== GraalVM Polyglot
|
||||
|
||||
Starting with version 6.0, the framework provides a `PolyglotScriptExecutor` which is based the https://www.graalvm.org/22.2/reference-manual/embed-languages[GraalVM Polyglot API].
|
||||
Starting with version 6.0, the framework provides a `PolyglotScriptExecutor` which is based the https://www.graalvm.org/latest/reference-manual/languages/[GraalVM Polyglot API].
|
||||
The JSR223 engine implementation for JavaScript, removed from Java by itself, has been replaced by using this new script executor.
|
||||
See more information about enabling JavaScript support in GraalVM and what https://www.graalvm.org/22.2/reference-manual/js[configuration options] can be propagated via script variables.
|
||||
See more information about enabling JavaScript support in GraalVM and what https://www.graalvm.org/latest/reference-manual/js/[configuration options] can be propagated via script variables.
|
||||
|
||||
Starting with version 6.4, the Python scripts support has been migrated to GraalVM Polyglot as well.
|
||||
Now these scripts can be written in Python 3.x and can use third-party libraries.
|
||||
See https://www.graalvm.org/latest/reference-manual/python/[GraalPy] documentation for more information.
|
||||
|
||||
By default, the framework sets `allowAllAccess` to `true` on the shared Polyglot `Context` which enables this interaction with host JVM:
|
||||
|
||||
* The creation and use of new threads.
|
||||
@@ -307,6 +312,4 @@ By default, the framework sets `allowAllAccess` to `true` on the shared Polyglot
|
||||
* The creation and use of new sub-processes.
|
||||
* The access to process environment variables.
|
||||
|
||||
This can be customized via overloaded `PolyglotScriptExecutor` constructor which accepts a `org.graalvm.polyglot.Context.Builder`.
|
||||
|
||||
To enable this JavaScript support, GraalVM with the `js` component installed has to be used or, when using a regular JVM, the `org.graalvm.sdk:graal-sdk` and `org.graalvm.js:js` dependencies must be included.
|
||||
This can be customized via overloaded `PolyglotScriptExecutor` constructor which accepts a `org.graalvm.polyglot.Context.Builder`.
|
||||
@@ -84,3 +84,10 @@ See xref:mqtt.adoc[MQTT Support] for more information.
|
||||
|
||||
The `ZipTransformer` now exposes a `fileNameGenerator` property to customize a target zip file (and optional zip entry) name generation.
|
||||
See xref:zip.adoc[Zip Support] for more information.
|
||||
|
||||
|
||||
[[x6.4-scripting-changes]]
|
||||
=== Scripting Changes
|
||||
|
||||
The Python scripts evaluation is now migrated to the GraalVM Polyglot.
|
||||
See xref:scripting.adoc[Scripting Support] for more information.
|
||||
|
||||
Reference in New Issue
Block a user