Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-21 Thread Timothy Ward
argr...@us.ibm.com> >> >> >> ----- Original message - >> From: Julian Sedding <jsedd...@gmail.com <mailto:jsedd...@gmail.com>> >> Sent by: osgi-dev-boun...@mail.osgi.org >> <mailto:osgi-dev-boun...@mail.osgi.org> >> To: OSGi Develope

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-21 Thread Neil Bartlett
81> > OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788 > <(386)%20848-3788> > hargr...@us.ibm.com > > > > - Original message - > From: Julian Sedding <jsedd...@gmail.com> > Sent by: osgi-dev-boun...@mail.osgi.org > To: OSGi Deve

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-21 Thread Peter Kriens
// office: +1 386 848 1781 > OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788 > hargr...@us.ibm.com > > > - Original message - > From: Julian Sedding <jsedd...@gmail.com> > Sent by: osgi-dev-boun...@mail.osgi.org > To: OSGi Deve

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-20 Thread BJ Hargrave
...@us.ibm.com     - Original message -From: Julian Sedding <jsedd...@gmail.com>Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?Date: Thu, Apr 20, 2017

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-20 Thread Julian Sedding
Hi Tim That's an interesting approach! I hadn't considered using DS but handling the service registration myself. To me it would have felt consistent if registering a ServiceFactory as a service using DS had just worked. Next to controlling the scope (singleton, bundle, prototype) of a service,

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-20 Thread Peter Kriens
Yes, that would solve this issue. Kind regards, Peter Kriens > On 20 Apr 2017, at 14:02, Tim Ward wrote: > > Peter - I assume that you mean that there will be no auto-generated > osgi.service capability. Couldn't that be fixed with an additional annotation >

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-20 Thread Tim Ward
Peter - I assume that you mean that there will be no auto-generated osgi.service capability. Couldn't that be fixed with an additional annotation on the component type to add the Provide-Capability to the manifest? Tim Ward Sent from my iPhone > On 20 Apr 2017, at 12:38, Peter Kriens

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-20 Thread Peter Kriens
But then you loose the DS dependency management on Foo … Since your FooServiceFactory no longer promises to provide a Foo service :-( Kind regards, Peter Kriens > On 20 Apr 2017, at 12:35, Timothy Ward wrote: > > DS isn’t intended to solve every single use

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-20 Thread Timothy Ward
DS isn’t intended to solve every single use case, rather to make common use cases simple to write and understand. In this case what you want is more advanced, and unlikely to make it into DS as a natively supported pattern. Given that you’re already tied to the core OSGi API (ServiceFactory)

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-20 Thread Julian Sedding
Hi Timothy Thanks for your reply. Using delegation works, I currently use it to solve my use-case. However, compared to implementing a ServiceFactory, delegation adds some overhead: - delegation needs to be implemented, which is trivial, but noisy if there are lots of methods that need

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-20 Thread Timothy Ward
Have you not considered the following: @Component(configurationPolicy = ConfigurationPolicy.REQUIRE, scope = ServiceScope.BUNDLE) public class FooImpl implements Foo { public @interface Config { // Config definition in here } @Reference private FooBuilderFactory