Hi, Am Mittwoch, den 31.10.2007, 12:47 +0100 schrieb Bertrand Delacretaz: > While I find it good to let people experiment with their favorite > scripting language (especially with the "playground" bias of > microsling), I think we need to focus a small number of languages for > our examples, and keep our microsling distribution size slow. I'd keep > only javascript / ESP in the core, and make all other engines plugins.
+1 > Script engines as plugins will be easy to do in Sling OSGi, but we > need some lightweight mechanism for microsling. The same engine jars > should be usable in both microsling and sling. +1 > My requirements for microsling would be that any script engine jar > file found in the microsling servlet classpath is activated at > startup, including discovery of the file extensions supported by the > engine. +1 > 1) Use BSF, the Bean Scripting Framework The BSFManager has two options to register: Explicit registration calling a method and discovery of a BSFEngines by listing them in a certain file in the JAR (same idea as the Jar service provider mechanism) > 2) Use the JDK 1.6 scripting framework Also uses the Jar Service provider in the background. In fact, the SlingScriptEngine interface is a small subset of the Java Scripting ScriptEngine/ScriptEngineFactory interfaces. > 3) Keep our existing interfaces an use the jar service provider mechanism > Jackrabbit uses that for query syntax plugins, a plugin jar needs a > text file like this one: The mechanism is good and is in fact as Thomas points out used throughout Sun's own implementations. But it has one serious drawback: The implementation is based on an internal class and thus not part of the Java API. Hence, if we use the mechanism we should either implement it ourselves or use BSF, which also has an implementation. We should at all cost NOT use the implementation used by the Java 6 javax.script e.a. > WDYT, do we agree on keeping just javascript/ESP in the core, yet > support script engine plugins in microsling? +1 > Which plugin mechanism do you suggest? Have a simple implementation of the Service Provider Mechanism. Regards Felix
