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

后端 未结 3 1337
生来不讨喜
生来不讨喜 2020-12-05 21:13

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 \"ME

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 21:18

    Apache Sling does use this mechanism in an OSGi environment to manage its JSR-233 compatible script engines, mostly via its ScriptEngineManagerFactory class [1]. See also [2] for an example custom script engine.

    Adding your script engine to Sling should work if it's JSR-233 compatible. The simplest way to test that is probably to follow the "Sling in 15 minutes" tutorial [3] using your language instead of the server-side javascript language that's used there.

    [1] http://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java

    [2] http://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/javascript

    [3] http://sling.apache.org/site/discover-sling-in-15-minutes.html

提交回复
热议问题