The ScriptRegistryService registers itself with OSGi as 4 different services and manages most scripting concerns via its own code and the code it inherits from ScriptRegistryImpl. This makes understanding the component a time-consuming task and is likely not very maintainable.
Separating the various script management concerns of script configuration, engine configuration, REST API, scheduling, and execution should help at least make the code more palatable in chunks. We also manage our own script-event mechanism to track changes to the source files. The event mechanism could be replaced with OSGi's EventAdmin to further reduce complexity.
- Scripting is functionally the same
- Code is more maintainable