Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

under construction
 New script scripting languages can be added to IGB via plugins that implement JSR-223.

To create a plugin for a scripting language, find a ScriptEngine implementation for the language, and include it in the plugin with an implementation of the ScriptProcessor interface. Then in the plugin Activator start() method, include the line:

Code Block
languagejava
ScriptProcessorHolder.getInstance().addScriptProcessor(new MyScriptProcessor());

Note - that OSGi is not compatible with the java Service Provider framework, so the usual way of getting the ScriptEngineFactory, ScriptEngineManager.getEngineByName(name) or ScriptEngineManager.getEngineByExtension(extension) does not work. Instead, the ScriptProcessor has a method:

Code Block
languagejava
 public ScriptEngineFactory getScriptEngineFactory();


that returns the ScriptEngineFactory. You can find the ScriptEngineFactory implementation by looking in the META-INF/services/javax.script.ScriptEngineFactory file. You may be able to just call the no parameter constructor.

...