Hi Luke lukewpatterson schrieb: > Hi, > > I'm fumbling my way through Declarative Services, gleaning knowledge from > here and there. I've been trying to figure things out, but I think it's > time to ask for help. > > The problem is, when I chose DS for my service registration mechanism, I was > under the impression that all "INSTALLED" impl bundles would automatically > be registered. After further reading, it seems that only "ACTIVE" bundles > are registered. > > I guess my questions are: > > * Is the following page > http://www.eclipsezone.com/articles/extensions-vs-services/ > correct when it says "All service component XML files declared through the > Service- Component manifest entry are automatically registered." ? Based on > that description, the behavior sounds like Extensions "All <extension> nodes > in the plugin.xml are automatically registered.", which definitely allow > registration of >=INSTALLED bundles.
It is true, the DS descriptors are automatically picked up. But only of ACTIVE (or in case of lazy activated bundles ACTIVATING) state. The reson for this is, that INSTALLED bundles are just present in the framework but not resolved (wired) and thus not directly usable. They are just there. Activing bundles is part of the bundle lifecycle and bundles need to be active for the to be usable -- classes may be used while the bundle is in the resolved state, but only when the bundles are started will the descriptors be taken up and all the other activation tasks take place. > > * If only ACTIVE bundles are registered, how can I work around this fact and > search all INSTALLED bundles? My consuming bundle needs to be able to > retrieve impls from any >=INSTALLED bundle. You can access INSTALLed bundles by retrieving them from the BundleContext. But you will not be able to load any classes or resources from that bundle until the bundle has at least been resolved. Components will only be registered and usable when the bundle is being started. Let me ask one question: Why do you want to access components from INSTALLed bundles ? Regards Felix > > > Thanks, > > Luke --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

