Skip to content

Commit 52e8174

Browse files
committed
Improve docs for GraalVM Polyglot dependencies
* Deprecate `jython` language indicator since only GraalVM Polyglot is there from now on
1 parent 77ebee6 commit 52e8174

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Diff for: spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutorFactory.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
import javax.script.ScriptEngine;
2020
import javax.script.ScriptEngineManager;
2121

22+
import org.apache.commons.logging.Log;
23+
import org.apache.commons.logging.LogFactory;
24+
2225
import org.springframework.integration.scripting.PolyglotScriptExecutor;
2326
import org.springframework.integration.scripting.ScriptExecutor;
2427
import org.springframework.util.Assert;
@@ -33,8 +36,17 @@
3336
*/
3437
public final class ScriptExecutorFactory {
3538

39+
private static final Log LOGGER = LogFactory.getLog(ScriptExecutorFactory.class);
40+
3641
public static ScriptExecutor getScriptExecutor(String language) {
37-
if (language.equalsIgnoreCase("python") || language.equalsIgnoreCase("jython")) {
42+
if (language.equalsIgnoreCase("jython")) {
43+
LOGGER.warn("""
44+
The 'jython' language indicator is deprecated and will be removed in the next version.
45+
The Python support is fully based on GraalVM Polyglot and there is no 'jython' dependency requirement any more.
46+
""");
47+
return new PolyglotScriptExecutor("python");
48+
}
49+
else if (language.equalsIgnoreCase("python")) {
3850
return new PolyglotScriptExecutor("python");
3951
}
4052
else if (language.equalsIgnoreCase("ruby") || language.equalsIgnoreCase("jruby")) {

Diff for: src/reference/antora/modules/ROOT/pages/scripting.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,13 @@ They are mutually exclusive.
296296
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].
297297
The JSR223 engine implementation for JavaScript, removed from Java by itself, has been replaced by using this new script executor.
298298
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.
299+
In particular, an `org.graalvm.polyglot:js` dependency has to be added to the target project to support JavaScript.
300+
299301

300302
Starting with version 6.4, the Python scripts support has been migrated to GraalVM Polyglot as well.
301303
Now these scripts can be written in Python 3.x and can use third-party libraries.
302304
See https://www.graalvm.org/latest/reference-manual/python/[GraalPy] documentation for more information.
305+
In particular, an `rg.graalvm.polyglot:python` dependency has to be added to the target project to support JavaScript.
303306

304307
By default, the framework sets `allowAllAccess` to `true` on the shared Polyglot `Context` which enables this interaction with host JVM:
305308

0 commit comments

Comments
 (0)