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/t...
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/trun...
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/trun...
http://fisheye.jboss.org/browse/JBossOSGi/projects/runtime/framework/trun...
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&...]