Module Design
As defined in JSR-223: Scripting for the Java Platform, script engines are deployed in Jar files and the Service Provider mechanism described in the Jar File Specification can be used for their discovery. The Scripting module supports both engines available in libraries on Java Classpath as well as script engines packaged as bundles installed on the OSGi framework.

OSGi Script Engine Manager
The Scripting module provides a service, called OSGi Script Engine Manager service (com.prosyst.mbs.services.scripting.OSGiScriptEngineManager), which can be used by applications to create instances of OSGi Script Engines. It looks in both Java Classpath and installed bundles to find Script Engine Factory for the requested script engine.
Since an OSGi Script Engine always executes scripts on behalf of given bundle, all OSGi Script Engine Manager methods for instantiating script engines take additional bundle argument.
For script engine factories provided from OSGi bundles events are sent from OSGi Script Engine Manager for their appearance and disappearance.
OSGi Script Engine
The OSGi Script Engine (com.prosyst.mbs.services.scripting.OSGiScriptEngine) is a wrapper of javax.script.ScriptEngine instance for working in the OSGi environment. The OSGi Script Engine interface has methods for executing script from URL and String sources.
Scripts executed form OSGi Script Engine instances have access to utility objects for logging, loading scripts, working with OSGi registry and Functional Item Management.
Core
The Core object (com.prosyst.mbs.services.scripting.bindings.Core) is a grouping objects for all the utility objects. It is available to scripts (bound in their global namespace) under the name of "mbs".
Script Engine Access
The Script Engine Access object (com.prosyst.mbs.services.scripting.bindings.ScriptEngineAccess) provides methods for locating and loading (i.e. evaluating) scripts. It is available to scripts under the Core.getEngine() field and can be accessed in scripts simply as "mbs.engine".
Registry Access
The Registry Access object (com.prosyst.mbs.services.scripting.bindings.RegistryAccess) provides methods for accessing services from the OSGi registry as well as registering script objects as services in the registry. It is available to scripts under the Core.getRegistry() field and can be accessed in scripts simply as "mbs.registry".
FIM Access
The FIM Access object (com.prosyst.mbs.services.scripting.bindings.FIMAccess) provides methods for accessing Functional Items and for registering script objects implementing functional items in OSGi. It is available to scripts under the Core.getFim() field and can be accessed in scripts simply as "mbs.fim".
Logger
The Logger object (com.prosyst.mbs.services.scripting.bindings.Logger) is instance of org.slf4j.Logger and provides methods for error, debug and info logging. It is available under Core.getLog() field and can be accessed in scripts simply as "mbs.log".
Bundle
The Core object provides also access to the bundle on behalf of which the OSGI Script Engine is executing scripts. It is available under Core.getBundle() field and be accessed in scripts simply as "mbs.bundle".