Re: On Demand Imports

2017-09-02 Thread Edmond Kemokai
Thanks Guillaume, I'll look into the servicemix approach. On Fri, Sep 1, 2017 at 2:41 AM, Guillaume Nodet wrote: > ServiceMix provides a modified version of the scripting api which supports > discovery of service providers in an OSGi compatible way: > >

Re: On Demand Imports

2017-09-01 Thread Guillaume Nodet
ServiceMix provides a modified version of the scripting api which supports discovery of service providers in an OSGi compatible way: https://repo1.maven.org/maven2/org/apache/servicemix/specs/org.apache.servicemix.specs.scripting-api-1.0/2.9.0/ 2017-09-01 1:59 GMT+02:00 Edmond Kemokai

Re: On Demand Imports

2017-08-31 Thread Edmond Kemokai
Hi Neil, Thanks for the input...I'll probably end up rolling a custom solution using DI-P in some way as you suggested. The platform I am developing ( codesolvent.com) uses bundles that implement JSR-223. JSR-223 itself has its own OSGi compatibility problem having to do with the service

Re: On Demand Imports

2017-08-30 Thread Neil Bartlett
You’re already aware of DynamicImport-Package, so in what way does that not work for you? A bundle that uses "DynamicImport-Package: *” can use any exported package from any bundle. Of course this is pretty dangerous… I would recommend running the scripts in the context of a special bundle

Re: On Demand Imports

2017-08-30 Thread Edmond Kemokai
Hi Julian, Thanks for the Sling pointer. I have taken a look at the code and see that using this approach basically requires hacking the ScriptEngineFactory of various script engines, something I don't have the bandwidth for. I was hoping there was a solution that the OSGi framework itself

Re: On Demand Imports

2017-08-30 Thread Julian Sedding
Hi Edmond Apache Sling solves this problem by using a Dynamic Class Loader [0]. This bundle provides a DynamicClassLoaderManager service that you can depend on. It provides a class loader that can delegate to each bundle's class loader. When a bundle's state changes (e.g bundle is stopped), the

On Demand Imports

2017-08-30 Thread Edmond Kemokai
Hi Folks, I am in need of an "On Demand" import functionality with the OSGi framework but not sure if something like this already exists before doing unnecessary work. Basically an "On Demand" import would be a combination of a DynamicImport-Package and an optional Import-Package. I am