Hi Justin,
On Tuesday, August 6, 2013, Justin Edelson wrote:
> ...Whereas today you do:
> ScriptEngineManager.getEngineByExtension("ecma")
>
> You could do
> ScriptEngineManager.getEngineByExtension("ecma", ["healthcheck",
"workflow"]) ...
FYI, I'm getting back to this (SLING-3038) and the above won't work for my
use case, as I need to setup some initial Bindings that provide context
objects, before calling BindingValuesProvider.addBindings(...).
The scenario that I'm considering is:
String context = "healthcheck"; // I don't think we need multiple contexts??
ScriptEngine engine = scriptEngineManager.getEngineByExtension("foo");
Bindings b = engine.createBindings();
b.put("bar", new SomethingThatOtherBindingsNeed());
for(BindingValuesProvider bvp : someProvider.getBindings(engine, context)) {
bvp.addBindings(b);
}
where someProvider is a new service that I'm afraid might be called
BindingValuesProviderProvider...suggestions welcome ;-)
In the above loop, some BVPs use the "bar" object to create their bound
objects, as we already do with the BVP that provides "currentNode" if
there's a "resource" bound when it's called.
-Bertrand