aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwr...@apache.org
Subject svn commit: r1369063 - /aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
Date Fri, 03 Aug 2012 15:59:04 GMT
Author: jwross
Date: Fri Aug  3 15:59:03 2012
New Revision: 1369063

URL: http://svn.apache.org/viewvc?rev=1369063&view=rev
Log:
ARIES-900: The actual resolution work is no longer done for the root subsystem, although it
will still transition to RESOLVING and RESOLVED.

Modified:
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java?rev=1369063&r1=1369062&r2=1369063&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
(original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
Fri Aug  3 15:59:03 2012
@@ -121,20 +121,26 @@ public class StartAction extends Abstrac
 			return;
 		subsystem.setState(State.RESOLVING);
 		try {
-			for (Subsystem child : Activator.getInstance().getSubsystems().getChildren(subsystem))
-				resolve((AriesSubsystem)child);
-			// TODO I think this is insufficient. Do we need both
-			// pre-install and post-install environments for the Resolver?
-			Collection<Bundle> bundles = getBundles(subsystem);
-			if (!Activator.getInstance().getBundleContext().getBundle(0)
-					.adapt(FrameworkWiring.class).resolveBundles(bundles)) {
-				logger.error(
-						"Unable to resolve bundles for subsystem/version/id {}/{}/{}: {}",
-						new Object[] { subsystem.getSymbolicName(), subsystem.getVersion(),
-								subsystem.getSubsystemId(), bundles });
-				throw new SubsystemException("Framework could not resolve the bundles");
+			// The root subsystem should follow the same event pattern for
+			// state transitions as other subsystems. However, an unresolvable
+			// root subsystem should have no effect, so there's no point in
+			// actually doing the resolution work.
+			if (!subsystem.isRoot()) {
+				for (Subsystem child : Activator.getInstance().getSubsystems().getChildren(subsystem))
+					resolve((AriesSubsystem)child);
+				// TODO I think this is insufficient. Do we need both
+				// pre-install and post-install environments for the Resolver?
+				Collection<Bundle> bundles = getBundles(subsystem);
+				if (!Activator.getInstance().getBundleContext().getBundle(0)
+						.adapt(FrameworkWiring.class).resolveBundles(bundles)) {
+					logger.error(
+							"Unable to resolve bundles for subsystem/version/id {}/{}/{}: {}",
+							new Object[] { subsystem.getSymbolicName(), subsystem.getVersion(),
+									subsystem.getSubsystemId(), bundles });
+					throw new SubsystemException("Framework could not resolve the bundles");
+				}
+				setExportIsolationPolicy(subsystem);
 			}
-			setExportIsolationPolicy(subsystem);
 			// TODO Could avoid calling setState (and notifyAll) here and
 			// avoid the need for a lock.
 			subsystem.setState(State.RESOLVED);



Mime
View raw message