"alesj" wrote : "adrian(a)jboss.org" wrote :
| | e.g. The OSGi api is at the deployment level
| | by passing in the Bundle to getService(Bundle).
| |
| Wouldn't this be DeploymentControllerContext?
|
But that's just an implementation detail. ;-)
The actual answer is yes for normal bundles, because they always represent
top level deployments. OSGi bundles can't have subdeployments.
But its also not for the SystemBundle which doesn't have a DeploymentUnit, it should
use
the SYSTEM level.
I can imagine other cases where you might not have a specific ControllerContext but
you do know what your ServiceTracker is (or something else does and can "hide"
the
link through its own api).
Or as I described above, you may want to do tracking at subdeployment level.
The DeploymentControllerContext is no use there because it maps to the top level
deployment.
DeploymentControllerContext.getScope() -> APPLICATION scope
DeploymentUnit.getTopLevel().getScope() -> APPLICATION scope
(Sub)DeploymentUnit.getScope() -> DEPLOYMENT scope
So you can see that using the implement detail actually can give you the wrong answer.
Because you are writing to the wrong api. ;-)
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267036#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...