This content has been marked as final.
Show 3 replies
-
1. Re: Where does OSGiBundleManager.stopBundle() emit BundleEvent.STOPPED?
alesj May 21, 2010 11:25 AM (in response to bosschaert)1 of 1 people found this helpfulDeploymentUnit unit = bundleState.getDeploymentUnit(); deployerClient.change(unit.getName(), DeploymentStages.CLASSLOADER); deployerClient.checkComplete(unit.getName());
I don't quite follow how these would stop the bundle and, additionally, where the BundleEvent.STOPPED normally comes from.
See OSGiBundleActivatorDeployer.
What this code does it takes unit's undelying MC deployment component and tries to push it to CLASSLOADER stage.
This can be fwd or backwards, depending on the current stage / state.
If it passes the mentioned deployer -- for which OSGiBundleState attachment must exist -- it will trigger that deployer.
-
2. Re: Where does OSGiBundleManager.stopBundle() emit BundleEvent.STOPPED?
thomas.diesler May 31, 2010 3:42 AM (in response to alesj)1 of 1 people found this helpfulOSGiBundleState.stopInternal
// This bundle's state is set to RESOLVED // A bundle event of type BundleEvent.STOPPED is fired destroyBundleContext(); changeState(RESOLVED);
AbstractBundleState.changeState
case Bundle.RESOLVED: { if (previous == Bundle.STOPPING) bundleEventType = BundleEvent.STOPPED; else bundleEventType = BundleEvent.RESOLVED; break; }
-
3. Re: Where does OSGiBundleManager.stopBundle() emit BundleEvent.STOPPED?
bosschaert Jun 4, 2010 7:20 AM (in response to alesj)I have created a unit test that isolates the issue. It's over here: http://github.com/jbosgi/jbosgi-framework/bundle/src/test/java/org/jboss/test/osgi/service/DeployerTestCase.java