jsr223

Where can I find a list of available JSR-223 scripting languages? [closed]

心不动则不痛 提交于 2019-11-27 06:20:55
I need a JVM-based scripting language for my app and would like to see what else is out there besides Groovy, Ruby, and Python. Google keeps pointing me to a dead page at http://scripting.dev.java.net/ davidbuzatto This is not a official list, but you can start here: http://en.wikipedia.org/wiki/List_of_JVM_languages Rhino (JavaScript) is implemented in the Oracle JDK/JRE by default. With this code you can see what scripting languages are available in your JDK: import java.util.*; import javax.script.*; public class A { public static void main( String[] args ) { ScriptEngineManager mgr = new

Is OSGi fundamentally incompatible with JSR-223 Scripting Language Discovery?

点点圈 提交于 2019-11-26 23:04:09
问题 I've recently written a small specialist scripting language and used the Maven to export an OSGi compliant bundle that also exports a service descriptor into the " META-INF/services/javax.script.ScriptEngineFactory " service registry file. The problem is that although the OSGi import and export packages are fine, the service registry appears to be incompatible with OSGi (as OSGi keeps its bundles off the general classpath and uses separate classloaders for modules). My question is, am I

How to convert Rhino-JavaScript arrays to Java-Arrays

泪湿孤枕 提交于 2019-11-26 20:54:14
问题 I have the following: ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine jsEngine = mgr.getEngineByName("JavaScript"); jsEngine.eval("function getArray() {return [1,2,3,4,5];};"); Object result = jsEngine.eval("getArray();"); How can i convert the result object which is of type sun.org.mozilla.javascript.internal.NativeArray to a corresponding java array? Can somone show me a working code sample where this is done? It should work for String and Integer arrays. Plus, it would be

Should I use a separate ScriptEngine and CompiledScript instances per each thread?

强颜欢笑 提交于 2019-11-26 17:22:43
My program uses Java Scripting API and can eval some scripts concurrently. They don't use shared script objects, Bindings or Context, but can use same ScriptEngine and CompiledScript objects. I see that Oracle Nashorn implementation in Java 8 is not multithreaded, ScriptEngineFactory.getParameter('THREADING') returns null about which the documentation says: The engine implementation is not thread safe, and cannot be used to execute scripts concurrently on multiple threads. Does it mean that I should create a separate instance of ScriptEngine for each thread? Besides, documentation says nothing

Where can I find a list of available JSR-223 scripting languages? [closed]

心不动则不痛 提交于 2019-11-26 11:57:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I need a JVM-based scripting language for my app and would like to see what else is out there besides Groovy, Ruby, and Python. Google keeps pointing me to a dead page at http://scripting.dev.java.net/ 回答1: This is not a official list, but you can start here: http://en.wikipedia.org/wiki/List_of_JVM_languages

Should I use a separate ScriptEngine and CompiledScript instances per each thread?

…衆ロ難τιáo~ 提交于 2019-11-26 05:22:48
问题 My program uses Java Scripting API and can eval some scripts concurrently. They don\'t use shared script objects, Bindings or Context, but can use same ScriptEngine and CompiledScript objects. I see that Oracle Nashorn implementation in Java 8 is not multithreaded, ScriptEngineFactory.getParameter(\'THREADING\') returns null about which the documentation says: The engine implementation is not thread safe, and cannot be used to execute scripts concurrently on multiple threads. Does it mean