[jboss-user] [JBoss Microcontainer Development] - On demand resolution

Thomas Diesler do-not-reply at jboss.com
Wed Mar 31 04:44:35 EDT 2010


Thomas Diesler [http://community.jboss.org/people/thomas.diesler%40jboss.com] replied to the discussion

"On demand resolution"

To view the discussion, visit: http://community.jboss.org/message/534827#534827

--------------------------------------------------------------
This  http://fisheye.jboss.org/changelog/JBossOSGi/projects/runtime/framework/trunk?cs=103244 change causes  http://jbmuc.dyndns.org:8280/hudson/job/jbossosgi-git-staging/22/testReport/ regression in bundle lifecycle handling. I added test coverage for this in the framework's  http://fisheye.jboss.org/browse/JBossOSGi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java?r=103300 BundleLifecycleTestCase

The issue is that a bundle may automatically progress to state RESOLVED after it gets installed . The expected behaviour is that a bundle stays in state INSTALLED until the first class load triggers a state change to RESOLVED. It is important that bundles do not get resolved one-by-one as they get installed because this may lead to undesired wirings. i.e. the resolver might no be able to correctly wire a set of bundles together

Consider, bundle B imports a package from bundle X. B gets installed. Starting B fails because of the the unresolved constraint. Later X gets installed and is expected to be in state INSTALLED. Currently, X progesses unexpectedly to state RESOLVED.

      Bundle bundleB = installBundle(assembleArchive("lifecycle-bundleB", "/bundles/lifecycle/bundleB", ActivatorB.class, ServiceB.class));
      assertBundleState(Bundle.INSTALLED, bundleB.getState());
 
      try
      {
         bundleB.start();
         fail("Unresolved constraint expected");
      }
      catch (BundleException ex)
      {
         // expected
      }
 
      Bundle bundleX = installBundle(assembleArchive("lifecycle-bundleX", "/bundles/lifecycle/bundleX", X.class));
      System.out.println("FIXME [JBDEPLOY-245] Unexpected dependee state changes");
      //assertBundleState(Bundle.INSTALLED, bundleX.getState());
 

 http://fisheye.jboss.org/browse/JBossOSGi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java?r=103300 http://fisheye.jboss.org/browse/JBossOSGi/projects/runtime/framework/trunk/bundle/src/test/java/org/jboss/test/osgi/bundle/BundleLifecycleTestCase.java?r=103300 

I still need to look into the details of why this would happen.

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/534827#534827]

Start a new discussion in JBoss Microcontainer Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2115]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100331/766b0a10/attachment.html 


More information about the jboss-user mailing list