Updated Application overview (markdown)
@@ -352,3 +352,10 @@ class DefaultInterpreter {
|
|||||||
```
|
```
|
||||||
|
|
||||||
You can think of `DefaultInterpreter` as an endpoint for `core` module that is ready to be used by `app` module or any other application willing to make use of SMNP.
|
You can think of `DefaultInterpreter` as an endpoint for `core` module that is ready to be used by `app` module or any other application willing to make use of SMNP.
|
||||||
|
|
||||||
|
# Modules Management System
|
||||||
|
The modules' management system is built on top of the _PF4J_ plugin management system and uses its feature to meet the modules' system requirements. In fact, each `ModuleProvider` implementation is annotated with `@ExtensionPoint` annotation which comes from _PF4J_ framework and each module's _jar_ file is actually a _plugin_ in the terminology of _PF4J_ framework.
|
||||||
|
|
||||||
|
The central component of modules' management system is the _ModuleRegistry_ with standard _DefaultModuleRegistry_ implementation. At the SMNP startup process, the `ModuleRegistry` _loads_ and _starts_ each available module (i.e. found in the default modules' directory or in the module passed through `smnp.modulesDir` JVM property) and composes the dictionary (_registry_) with these modules.
|
||||||
|
|
||||||
|
When it comes to evaluation of the `import` statement, the `Evaluator` calls `Environment`'s `loadModule()` method. The `Environment` requests `ModuleProvider` assigned to desired module from `ModuleRegistry` and accesses the module simply by passing the `DefaultLanguageModuleInterpreter` as well as itself to the `ModuleProvider`, which constructs the `Module` object. This is the stage, when it comes to evaluation scripts in `LanguageModuleProvider`-based _module providers_. Thanks to the tree-like structure of `Module` objects, the newly-provided `Module` can be simply merged into the _root module_ of `Environment`. From now on, all functions and methods of the module are available. This is also the stage, when `onModuleLoad()` `ModuleProvider`'s lifecycle hook is being invoked.
|
||||||
Reference in New Issue
Block a user