[jboss-dev-forums] [JBoss OSGi Development] - Re: Service integration with MC

alesj do-not-reply at jboss.com
Fri Nov 20 10:23:15 EST 2009


"adrian at jboss.org" wrote : 
  | So we add a "ServiceTracker" to the MDR which for deployments will be in the deployment level (really the application/top level deployment)
  | for others it will be as you say a default one at the Server level, what osgi calls the "SystemBundle".
  | You can imagine others might choose to track at some other level. e.g.
  | for JavaEE we might choose to track at sub-deployment level, what MDR
  | confusingly calls the deployment level. :-)
  | 
  | When you do any type of injection (or the api is invoked from somewhere else)
  | this should invoke the equivalent of get/unget of the ServiceTracker for that context.
  | 
  | Once that is done, the queries can go through the ServiceTracker at the relevant level.
  | The deployment level for normal OSGiBundleState and the server level for the SystemBundle.
  | 
  | You still need a "global" list of services for the getXXXServiceXXX() queries.
  | That should primarily be based on an index by class (it doesn't have to be
  | its a performance optimization and only available when you have been asked
  | to query by class). But once you've subsetted by class then you do a
  | "read and skip" over those contexts to locate the ones that match any passed filter on the properties (instance level MDR).
  | 
I fail to see why I would need to different levels of ServiceTracker.
As I also always have to check the "global" list.

When would I check just deployment level ServiceTracker?
For non-system bundle, to lookup non-osgi services that belong just to this bundle / jar / deployment?


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266790#4266790

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266790



More information about the jboss-dev-forums mailing list