Felix Meschberger wrote:
Just an idea, not sure how it works out ...
At one time I also used the ConfigurationListener approach in Felix SCR,
but I missed quite a few configurations. The problem with the listener
approach is, that the listener is only notified if a configuration has
been changed. If a listener is registered _after_ the configuration has
already been created, the listener is never notified. So you have to ask
for these configurations first.
Yes, you are correct. Equinox DS handles this by listing the available
configurations when a component is being initiated.
For ManagedService[Factory] services things are different: Whenever such
a service is registered, the ConfigurationAdmin service has to provide
whatever it has: If it has nothing (in the case of a ManagedService), it
has to call the ManagedService with nothing. If it has anything, it must
call the services accordingly.
Thus, because using the ManagedService[Factory] approach is simpler from
the perspective of SCR, I ended up using this in Felix SCR. Of course
the price is the number of services registered -- regardless of whether
there will ever be configuration or not. I think the next spec revision
might bring some relief in that a component may declare, that it is not
interested in configuration and thus a ManagedService[Factory]
registration is not needed.
Hope this helps.
Regards
Felix
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev