Bertrand Delacretaz wrote > On Mon, Nov 7, 2016 at 12:01 PM, Carsten Ziegeler <cziege...@apache.org> > wrote: >> Bertrand Delacretaz wrote >>> ... That's a nice model but IIUC Carsten earlier in this thread OSGi >>> capabilities cannot be created at runtime so that won't work for >>> service users or access rights. >> >> I just had the crazy idea that we could generate them at runtime by >> creating an artifical bundle providing the capabilities. When the >> capabilities change, that bundle could be updated.... > > I like crazy ideas in general, but service users might appear later > during startup, at a time where bundles that need them are already > started so not sure if the dynamics would work.
Yes, it would - those bundle might not resolve as they require a capability (service user). Once the service user is created, the synthetic bundle is updated, providing the capability, which in turn resolves the bundle. > > If we want to keep the usual dynamics of OSGi, the service model is > probably better - IIRC we are already using somewhere fake services > with properties that act like capabilities, something like depending > on a ServiceUserPresent(target="my-service-user") service. I forgot > where that is. > Yes, though I think the service model is usually great for this, in this case this is nothing you want to have in your code. It should be enough that your bundle declares that it needs a service user and your code is just using it. Carsten -- Carsten Ziegeler Adobe Research Switzerland cziege...@apache.org