Re: [osgi-dev] Library development

2020-05-22 Thread David Leangen via osgi-dev
Thank you all. This has been very helpful. :-) ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Library development

2020-05-21 Thread Raymond Auge via osgi-dev
FYI, One thing few people realize is that Service Loader Mediator does allow your providers to be consumed via the service registry. If you use the bnd SPI annotations I already mentioned this is a default behavior. - Ray On Thu, May 21, 2020 at 9:19 AM Raymond Auge wrote: > Another

Re: [osgi-dev] Library development

2020-05-21 Thread Raymond Auge via osgi-dev
Another alternative designed specifically for this scenario is the OSGi Service Loader Mediator Specification [1]. Java's default _service_ mechanism is Service Loader SPI. The Service Loader Mediator Specification adds a veneer of pure metadata over this to allow it to function in OSGi. There

Re: [osgi-dev] Library development

2020-05-21 Thread Neil Bartlett via osgi-dev
Along the lines of Bernd's answer, here is what I do: 1. Use declarative services. 2. For injection of service references, prefer constructor injection. 3. The component implementation should be in a private package. However, non-OSGi consumers don't know anything about exported versus private

Re: [osgi-dev] Library development

2020-05-20 Thread David Leangen via osgi-dev
Hi Bernd, Thank you, this is good information. Much appreciated. Would you happen to have a link to an example project? Cheers, =David ___ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Library development

2020-05-20 Thread Bernd Eckenfels via osgi-dev
Hello, We typically use declarative services (DS) with the Maven bundle plugin and Annotations. This leaves no (optional) OSGi framework dependency and still allows a compliant container to manage the lifecycle of the component. In some (rare) cases when you have to deal with service