aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwr...@apache.org
Subject svn commit: r1406875 [1/2] - in /aries/trunk/subsystem: subsystem-api/ subsystem-api/src/main/java/org/apache/ subsystem-api/src/main/java/org/apache/aries/ subsystem-api/src/main/java/org/apache/aries/subsystem/ subsystem-bundle/ subsystem-core/src/ma...
Date Thu, 08 Nov 2012 00:33:53 GMT
Author: jwross
Date: Thu Nov  8 00:33:51 2012
New Revision: 1406875

URL: http://svn.apache.org/viewvc?rev=1406875&view=rev
Log:
ARIES-956: Initial support for adding requirements to an already installed subsystem.

Added:
    aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/
    aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/
    aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/
    aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java
      - copied, changed from r1406429, aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AriesSubsystem.java
    aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/AriesSubsystemTest.java
Removed:
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AriesSubsystem.java
Modified:
    aries/trunk/subsystem/subsystem-api/pom.xml
    aries/trunk/subsystem/subsystem-bundle/pom.xml
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/AriesSubsystemParentsHeader.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DeploymentManifest.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AbstractAction.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleEventHook.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/InstallAction.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/PreferredProviderRepository.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RawSubsystemResource.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RegionContextBundleHelper.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceHelper.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceInstaller.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceReferences.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceUninstaller.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StopAction.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemGraph.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemManifestValidator.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResolverHook.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResource.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceInstaller.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceUninstaller.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemServiceRegistrar.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Subsystems.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SystemRepository.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/TargetRegion.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ThreadLocalSubsystem.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/UninstallAction.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Utils.java
    aries/trunk/subsystem/subsystem-itests/pom.xml
    aries/trunk/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/SubsystemTest.java

Modified: aries/trunk/subsystem/subsystem-api/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-api/pom.xml?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-api/pom.xml (original)
+++ aries/trunk/subsystem/subsystem-api/pom.xml Thu Nov  8 00:33:51 2012
@@ -42,11 +42,17 @@
     <properties>
          <!-- Export package versions are maintained in packageinfo files -->
         <aries.osgi.export.pkg>
-            org.osgi.service.subsystem
+            org.osgi.service.subsystem,
+            org.apache.aries.subsystem
         </aries.osgi.export.pkg>
     </properties>
 
     <dependencies>
+    	<dependency>
+            <groupId>org.apache.aries</groupId>
+            <artifactId>org.apache.aries.util</artifactId>
+            <version>1.0.1-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>

Added: aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java?rev=1406875&view=auto
==============================================================================
--- aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java (added)
+++ aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java Thu Nov  8 00:33:51 2012
@@ -0,0 +1,59 @@
+package org.apache.aries.subsystem;
+
+import java.io.InputStream;
+import java.util.Collection;
+
+import org.apache.aries.util.filesystem.IDirectory;
+import org.osgi.resource.Requirement;
+import org.osgi.service.subsystem.Subsystem;
+import org.osgi.service.subsystem.SubsystemException;
+import org.osgi.service.subsystem.SubsystemPermission;
+
+public interface AriesSubsystem extends Subsystem {
+	/**
+	 * Adds the specified requirements to this subsystem's sharing policy.
+	 * <p>
+	 * The sharing policy of this subsystem's region is updated with the 
+	 * specified requirements (i.e. imports). Requirements already part of the
+	 * sharing policy are ignored. Upon return, constituents of this subsystem 
+	 * will be allowed to resolve against matching capabilities that are visible 
+	 * to the parent subsystems.
+	 *
+	 * @param requirement The requirement to add to the sharing policy.
+	 * @throws SubsystemException If the requirement did not already exist and
+	 *         could not be added.
+	 * @throws UnsupportedOperationException If this is the root subsystem or 
+	 *         the type does not support additional requirements.
+	 */
+	void addRequirements(Collection<Requirement> requirements);
+
+	@Override
+	AriesSubsystem install(String location);
+
+	@Override
+	AriesSubsystem install(String location, InputStream content);
+	
+	/**
+	 * Installs a subsystem from the specified location identifier and content.
+	 * <p>
+	 * This method performs the same function as calling
+	 * {@link #install(String, InputStream)} except the content is retrieved
+	 * from the specified {@link IDirectory} instead.
+	 * 
+	 * @param location The location identifier of the subsystem to install.
+	 * @param content The directory from which this subsystem will be read or
+	 *        {@code null} to indicate the directory must be created from the
+	 *        specified location identifier.
+	 * @return The installed subsystem.
+	 * @throws IllegalStateException If this subsystem's state is in
+	 *         {@link State#INSTALLING INSTALLING}, {@link State#INSTALL_FAILED
+	 *         INSTALL_FAILED}, {@link State#UNINSTALLING UNINSTALLING},
+	 *         {@link State#UNINSTALLED UNINSTALLED}.
+	 * @throws SubsystemException If the installation failed.
+	 * @throws SecurityException If the caller does not have the appropriate
+	 *         {@link SubsystemPermission}[installed subsystem,LIFECYCLE], and
+	 *         the runtime supports permissions.
+	 * @see #install(String, InputStream)
+	 */
+	AriesSubsystem install(String location, IDirectory content);
+}

Modified: aries/trunk/subsystem/subsystem-bundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-bundle/pom.xml?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-bundle/pom.xml (original)
+++ aries/trunk/subsystem/subsystem-bundle/pom.xml Thu Nov  8 00:33:51 2012
@@ -47,10 +47,11 @@
     		*
     	</aries.osgi.import>
         <aries.osgi.export.pkg>
-            org.osgi.service.subsystem;version="1.0"
+            org.osgi.service.subsystem;version="1.0",
+            org.apache.aries.subsystem;version="1.0"
         </aries.osgi.export.pkg>
         <aries.osgi.private.pkg>
-            org.apache.aries.subsystem*
+            org.apache.aries.subsystem.*
         </aries.osgi.private.pkg>
     </properties>
 

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/AriesSubsystemParentsHeader.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/AriesSubsystemParentsHeader.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/AriesSubsystemParentsHeader.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/AriesSubsystemParentsHeader.java Thu Nov  8 00:33:51 2012
@@ -24,7 +24,7 @@ import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.aries.subsystem.core.internal.AriesSubsystem;
+import org.apache.aries.subsystem.core.internal.BasicSubsystem;
 import org.apache.aries.subsystem.core.internal.OsgiIdentityRequirement;
 import org.osgi.framework.Version;
 import org.osgi.framework.VersionRange;
@@ -68,11 +68,11 @@ public class AriesSubsystemParentsHeader
 			fillInDefaults(parameters);
 		}
 		
-		public Clause(AriesSubsystem subsystem, boolean referenceCount) {
+		public Clause(BasicSubsystem subsystem, boolean referenceCount) {
 			this(appendSubsystem(subsystem, new StringBuilder(), referenceCount).toString());
 		}
 		
-		public boolean contains(AriesSubsystem subsystem) {
+		public boolean contains(BasicSubsystem subsystem) {
 			return getSymbolicName().equals(
 					subsystem.getSymbolicName())
 					&& getVersion().equals(
@@ -168,7 +168,7 @@ public class AriesSubsystemParentsHeader
 	
 	public static final String NAME = "AriesSubsystem-Parents";
 	
-	private static StringBuilder appendSubsystem(AriesSubsystem subsystem, StringBuilder builder, boolean referenceCount) {
+	private static StringBuilder appendSubsystem(BasicSubsystem subsystem, StringBuilder builder, boolean referenceCount) {
 		String symbolicName = subsystem.getSymbolicName();
 		Version version = subsystem.getVersion();
 		String type = subsystem.getType();
@@ -208,11 +208,11 @@ public class AriesSubsystemParentsHeader
 		this(processHeader(value));
 	}
 	
-	public boolean contains(AriesSubsystem subsystem) {
+	public boolean contains(BasicSubsystem subsystem) {
 		return getClause(subsystem) != null;
 	}
 	
-	public Clause getClause(AriesSubsystem subsystem) {
+	public Clause getClause(BasicSubsystem subsystem) {
 		String symbolicName = subsystem.getSymbolicName();
 		Version version = subsystem.getVersion();
 		String type = subsystem.getType();

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DeploymentManifest.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DeploymentManifest.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DeploymentManifest.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DeploymentManifest.java Thu Nov  8 00:33:51 2012
@@ -30,7 +30,7 @@ import java.util.Map.Entry;
 import java.util.jar.Attributes;
 import java.util.jar.Manifest;
 
-import org.apache.aries.subsystem.core.internal.AriesSubsystem;
+import org.apache.aries.subsystem.core.internal.BasicSubsystem;
 import org.apache.aries.util.manifest.ManifestProcessor;
 import org.osgi.framework.Constants;
 import org.osgi.resource.Resource;
@@ -119,7 +119,7 @@ public class DeploymentManifest {
 			return this;
 		}
 		
-		public Builder parent(AriesSubsystem value, boolean referenceCount) {
+		public Builder parent(BasicSubsystem value, boolean referenceCount) {
 			AriesSubsystemParentsHeader.Clause clause = new AriesSubsystemParentsHeader.Clause(value, referenceCount);
 			AriesSubsystemParentsHeader header = (AriesSubsystemParentsHeader)headers.get(ARIESSUBSYSTEM_PARENTS);
 			if (header == null)

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AbstractAction.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AbstractAction.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AbstractAction.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AbstractAction.java Thu Nov  8 00:33:51 2012
@@ -19,10 +19,10 @@ import org.osgi.service.subsystem.Subsys
 
 public abstract class AbstractAction implements PrivilegedAction<Object> {
 	protected final boolean disableRootCheck;
-	protected final AriesSubsystem requestor;
-	protected final AriesSubsystem target;
+	protected final BasicSubsystem requestor;
+	protected final BasicSubsystem target;
 	
-	public AbstractAction(AriesSubsystem requestor, AriesSubsystem target, boolean disableRootCheck) {
+	public AbstractAction(BasicSubsystem requestor, BasicSubsystem target, boolean disableRootCheck) {
 		this.requestor = requestor;
 		this.target = target;
 		this.disableRootCheck = disableRootCheck;
@@ -34,7 +34,7 @@ public abstract class AbstractAction imp
 	}
 	
 	protected void checkValid() {
-		AriesSubsystem s = (AriesSubsystem)Activator.getInstance().getSubsystemServiceRegistrar().getSubsystemService(target);
+		BasicSubsystem s = (BasicSubsystem)Activator.getInstance().getSubsystemServiceRegistrar().getSubsystemService(target);
 		if (s != target)
 			throw new IllegalStateException("Detected stale subsystem instance: " + s);
 	}

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java Thu Nov  8 00:33:51 2012
@@ -164,7 +164,7 @@ public class Activator implements Bundle
 		}
 		registrations.add(bundleContext.registerService(ResolverHookFactory.class, new SubsystemResolverHookFactory(subsystems), null));
 		registrar = new SubsystemServiceRegistrar(bundleContext);
-		AriesSubsystem root = subsystems.getRootSubsystem();
+		BasicSubsystem root = subsystems.getRootSubsystem();
 		root.start();
 	}
 	

Copied: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java (from r1406429, aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AriesSubsystem.java)
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java?p2=aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java&p1=aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AriesSubsystem.java&r1=1406429&r2=1406875&rev=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AriesSubsystem.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java Thu Nov  8 00:33:51 2012
@@ -30,6 +30,7 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Map.Entry;
 
+import org.apache.aries.subsystem.AriesSubsystem;
 import org.apache.aries.subsystem.core.archive.AriesSubsystemParentsHeader;
 import org.apache.aries.subsystem.core.archive.DeployedContentHeader;
 import org.apache.aries.subsystem.core.archive.DeploymentManifest;
@@ -39,11 +40,17 @@ import org.apache.aries.subsystem.core.a
 import org.apache.aries.util.filesystem.FileSystem;
 import org.apache.aries.util.filesystem.IDirectory;
 import org.apache.aries.util.io.IOUtils;
+import org.eclipse.equinox.region.Region;
+import org.eclipse.equinox.region.RegionDigraph;
+import org.eclipse.equinox.region.RegionDigraph.FilteredRegion;
+import org.eclipse.equinox.region.RegionFilter;
+import org.eclipse.equinox.region.RegionFilterBuilder;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.Version;
 import org.osgi.framework.namespace.IdentityNamespace;
+import org.osgi.namespace.service.ServiceNamespace;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Requirement;
 import org.osgi.resource.Resource;
@@ -54,7 +61,7 @@ import org.osgi.service.subsystem.Subsys
 import org.osgi.service.subsystem.SubsystemConstants;
 import org.osgi.service.subsystem.SubsystemException;
 
-public class AriesSubsystem implements Resource, Subsystem {
+public class BasicSubsystem implements Resource, AriesSubsystem {
 	public static final String ROOT_SYMBOLIC_NAME = "org.osgi.service.subsystem.root";
 	public static final Version ROOT_VERSION = Version.parseVersion("1.0.0");
 	public static final String ROOT_LOCATION = "subsystem://?"
@@ -68,7 +75,7 @@ public class AriesSubsystem implements R
 	
 	private final IDirectory directory;
 	
-	public AriesSubsystem(SubsystemResource resource) throws URISyntaxException, IOException, BundleException, InvalidSyntaxException {
+	public BasicSubsystem(SubsystemResource resource) throws URISyntaxException, IOException, BundleException, InvalidSyntaxException {
 		this.resource = resource;
 		final File file = new File(Activator.getInstance().getBundleContext().getDataFile(""), Long.toString(resource.getId()));
 		file.mkdirs();
@@ -101,11 +108,11 @@ public class AriesSubsystem implements R
 				.build());
 	}
 	
-	public AriesSubsystem(File file) throws IOException, URISyntaxException, ResolutionException {
+	public BasicSubsystem(File file) throws IOException, URISyntaxException, ResolutionException {
 		this(FileSystem.getFSRoot(file));
 	}
 	
-	public AriesSubsystem(IDirectory directory) throws IOException, URISyntaxException, ResolutionException {
+	public BasicSubsystem(IDirectory directory) throws IOException, URISyntaxException, ResolutionException {
 		this.directory = directory;
 		setDeploymentManifest(new DeploymentManifest.Builder().manifest(getDeploymentManifest()).build());
 	}
@@ -116,9 +123,9 @@ public class AriesSubsystem implements R
 	public boolean equals(Object o) {
 		if (o == this)
 			return true;
-		if (!(o instanceof AriesSubsystem))
+		if (!(o instanceof BasicSubsystem))
 			return false;
-		AriesSubsystem that = (AriesSubsystem)o;
+		BasicSubsystem that = (BasicSubsystem)o;
 		return getLocation().equals(that.getLocation());
 	}
 	
@@ -202,7 +209,7 @@ public class AriesSubsystem implements R
 			return Collections.emptyList();
 		Collection<Subsystem> result = new ArrayList<Subsystem>(header.getClauses().size());
 		for (AriesSubsystemParentsHeader.Clause clause : header.getClauses()) {
-			AriesSubsystem subsystem = Activator.getInstance().getSubsystems().getSubsystemById(clause.getId());
+			BasicSubsystem subsystem = Activator.getInstance().getSubsystems().getSubsystemById(clause.getId());
 			if (subsystem == null)
 				continue;
 			result.add(subsystem);
@@ -241,14 +248,20 @@ public class AriesSubsystem implements R
 	}
 
 	@Override
-	public Subsystem install(String location) {
-		return install(location, null);
+	public AriesSubsystem install(String location) {
+		return install(location, (InputStream)null);
 	}
 
 	@Override
-	public Subsystem install(String location, InputStream content) {
+	public AriesSubsystem install(String location, final InputStream content) {
 		try {
-			return AccessController.doPrivileged(new InstallAction(location, content, this, AccessController.getContext()));
+			return install(location, content == null ? null : 
+				AccessController.doPrivileged(new PrivilegedAction<IDirectory>() {
+					@Override
+					public IDirectory run() {
+						return FileSystem.getFSRoot(content);
+					}
+				}));
 		}
 		finally {
 			// This method must guarantee the content input stream was closed.
@@ -307,7 +320,7 @@ public class AriesSubsystem implements R
 		}
 	}
 	
-	void addedParent(AriesSubsystem subsystem, boolean referenceCount) {
+	void addedParent(BasicSubsystem subsystem, boolean referenceCount) {
 		try {
 			setDeploymentManifest(new DeploymentManifest.Builder()
 					.manifest(getDeploymentManifest()).parent(subsystem, referenceCount).build());
@@ -530,4 +543,61 @@ public class AriesSubsystem implements R
 			return null;
 		return header.getValue();
 	}
+
+	@Override
+	public synchronized void addRequirements(Collection<Requirement> requirements) {
+		// The root subsystem has no requirements (there is no parent to import from).
+		if (isRoot())
+			throw new UnsupportedOperationException("The root subsystem does not accept additional requirements");
+		// Unscoped subsystems import everything.already.
+		if (!isScoped())
+			return;
+		Region currentRegion = getRegion();
+		RegionDigraph currentDigraph = currentRegion.getRegionDigraph();
+		RegionFilterBuilder filterBuilder = currentDigraph.createRegionFilterBuilder();
+		try {
+			// Copy the sharing policy of the current region.
+			for (FilteredRegion filteredRegion : currentRegion.getEdges()) {
+				Map<String, Collection<String>> sharingPolicy = filteredRegion.getFilter().getSharingPolicy();
+				for (Map.Entry<String, Collection<String>> entry : sharingPolicy.entrySet())
+					for (String filter : entry.getValue())
+						filterBuilder.allow(entry.getKey(), filter);
+			}
+			// Add the additional requirements to the sharing policy.
+			for (Requirement requirement : requirements) {
+				String namespace = requirement.getNamespace();
+				// The osgi.service namespace requires translation.
+				if (ServiceNamespace.SERVICE_NAMESPACE.equals(namespace))
+					namespace = RegionFilter.VISIBLE_SERVICE_NAMESPACE;
+				String filter = requirement.getDirectives().get(IdentityNamespace.REQUIREMENT_FILTER_DIRECTIVE);
+				// A null filter means import everything from that namespace.
+				if (filter == null)
+					filterBuilder.allowAll(namespace);
+				else
+					filterBuilder.allow(namespace, filter);
+			}
+			// Update the region digraph. Lock on the class to prevent conflicts
+			// with other subsystems updating their own requirements.
+			// TODO This lock does not prevent conflicts with users outside of
+			// subsystems.
+			synchronized (BasicSubsystem.class) {
+				RegionDigraph copiedDigraph = currentDigraph.copy();
+				copiedDigraph.removeRegion(currentRegion);
+				Region fromRegion = copiedDigraph.createRegion(currentRegion.getName());
+				Region toRegion = ((BasicSubsystem)getParents().iterator().next()).getRegion();
+				copiedDigraph.connect(fromRegion, filterBuilder.build(), copiedDigraph.getRegion(toRegion.getName()));
+				// TODO Protect against the possibility of an already modified
+				// digraph with multiple attempts, if necessary?
+				currentDigraph.replace(copiedDigraph);
+			}
+		}
+		catch (Exception e) {
+			throw new SubsystemException(e);
+		}
+	}
+
+	@Override
+	public AriesSubsystem install(String location, IDirectory content) {
+		return AccessController.doPrivileged(new InstallAction(location, content, this, AccessController.getContext()));
+	}
 }

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleEventHook.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleEventHook.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleEventHook.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleEventHook.java Thu Nov  8 00:33:51 2012
@@ -52,10 +52,10 @@ public class BundleEventHook implements 
 		// The bundle needs to be associated with all subsystems that are 
 		// associated with the bundle whose context was used to install the 
 		// bundle.
-		Collection<AriesSubsystem> subsystems = Activator.getInstance().getSubsystems().getSubsystemsReferencing(originRevision);
+		Collection<BasicSubsystem> subsystems = Activator.getInstance().getSubsystems().getSubsystemsReferencing(originRevision);
 		if (subsystems.isEmpty())
 			throw new IllegalStateException("Orphaned bundle revision detected: " + originRevision);
-		for (AriesSubsystem s : subsystems)
+		for (BasicSubsystem s : subsystems)
 			Utils.installResource(bundleRevision, s);
 	}
 	
@@ -64,7 +64,7 @@ public class BundleEventHook implements 
 			// the region used to install the bundle.
 			RegionDigraph digraph = Activator.getInstance().getRegionDigraph();
 			Region region = digraph.getRegion(origin);
-			for (AriesSubsystem s : Activator.getInstance().getSubsystems().getSubsystems()) {
+			for (BasicSubsystem s : Activator.getInstance().getSubsystems().getSubsystems()) {
 				if ((s.isApplication() || s.isComposite())
 						&& region.equals(s.getRegion())) {
 					Utils.installResource(bundleRevision, s);
@@ -98,7 +98,7 @@ public class BundleEventHook implements 
 		BundleRevision revision = bundleToRevision.remove(bundle);
 		if (ThreadLocalSubsystem.get() != null)
 			return;
-		for (AriesSubsystem subsystem : Activator.getInstance().getSubsystems().getSubsystemsByConstituent(new BundleConstituent(null, revision)))
+		for (BasicSubsystem subsystem : Activator.getInstance().getSubsystems().getSubsystemsByConstituent(new BundleConstituent(null, revision)))
 			ResourceUninstaller.newInstance(revision, subsystem).uninstall();
 	}
 }

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java Thu Nov  8 00:33:51 2012
@@ -145,7 +145,7 @@ public class BundleResourceInstaller ext
 		}
 	}
 	
-	public BundleResourceInstaller(Coordination coordination, Resource resource, AriesSubsystem subsystem) {
+	public BundleResourceInstaller(Coordination coordination, Resource resource, BasicSubsystem subsystem) {
 		super(coordination, resource, subsystem);
 	}
 	

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceUninstaller.java Thu Nov  8 00:33:51 2012
@@ -21,7 +21,7 @@ import org.osgi.resource.Resource;
 import org.osgi.service.subsystem.SubsystemException;
 
 public class BundleResourceUninstaller extends ResourceUninstaller {
-	public BundleResourceUninstaller(Resource resource, AriesSubsystem subsystem) {
+	public BundleResourceUninstaller(Resource resource, BasicSubsystem subsystem) {
 		super(resource, subsystem);
 	}
 	

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java Thu Nov  8 00:33:51 2012
@@ -20,9 +20,9 @@ import org.osgi.framework.BundleContext;
 import org.osgi.service.subsystem.Subsystem.State;
 
 public class GetBundleContextAction implements PrivilegedAction<BundleContext> {
-	private final AriesSubsystem subsystem;
+	private final BasicSubsystem subsystem;
 	
-	public GetBundleContextAction(AriesSubsystem subsystem) {
+	public GetBundleContextAction(BasicSubsystem subsystem) {
 		this.subsystem = subsystem;
 	}
 	
@@ -31,7 +31,7 @@ public class GetBundleContextAction impl
 		if (EnumSet.of(State.INSTALL_FAILED, State.UNINSTALLED).contains(
 				subsystem.getState()))
 			return null;
-		AriesSubsystem subsystem = Utils.findScopedSubsystemInRegion(this.subsystem);
+		BasicSubsystem subsystem = Utils.findScopedSubsystemInRegion(this.subsystem);
 		return subsystem.getRegion().getBundle(
 				RegionContextBundleHelper.SYMBOLICNAME_PREFIX
 						+ subsystem.getSubsystemId(),

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java Thu Nov  8 00:33:51 2012
@@ -21,9 +21,9 @@ import java.util.Map.Entry;
 import org.apache.aries.subsystem.core.archive.Header;
 
 public class GetSubsystemHeadersAction implements PrivilegedAction<Map<String, String>> {
-	private final AriesSubsystem subsystem;
+	private final BasicSubsystem subsystem;
 	
-	public GetSubsystemHeadersAction(AriesSubsystem subsystem) {
+	public GetSubsystemHeadersAction(BasicSubsystem subsystem) {
 		this.subsystem = subsystem;
 	}
 	

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/InstallAction.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/InstallAction.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/InstallAction.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/InstallAction.java Thu Nov  8 00:33:51 2012
@@ -14,13 +14,13 @@
 package org.apache.aries.subsystem.core.internal;
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.URISyntaxException;
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
 import org.apache.aries.application.modelling.ModellerException;
+import org.apache.aries.util.filesystem.IDirectory;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.coordinator.Coordination;
@@ -28,19 +28,19 @@ import org.osgi.service.coordinator.Coor
 import org.osgi.service.resolver.ResolutionException;
 import org.osgi.service.subsystem.SubsystemException;
 
-public class InstallAction implements PrivilegedAction<AriesSubsystem> {
-	private final InputStream content;
+public class InstallAction implements PrivilegedAction<BasicSubsystem> {
+	private final IDirectory content;
 	private final AccessControlContext context;
 	private final Coordination coordination;
 	private final boolean embedded;
 	private final String location;
-	private final AriesSubsystem parent;
+	private final BasicSubsystem parent;
 	
-	public InstallAction(String location, InputStream content, AriesSubsystem parent, AccessControlContext context) {
+	public InstallAction(String location, IDirectory content, BasicSubsystem parent, AccessControlContext context) {
 		this(location, content, parent, context, null, false);
 	}
 	
-	public InstallAction(String location, InputStream content, AriesSubsystem parent, AccessControlContext context, Coordination coordination, boolean embedded) {
+	public InstallAction(String location, IDirectory content, BasicSubsystem parent, AccessControlContext context, Coordination coordination, boolean embedded) {
 		this.location = location;
 		this.content = content;
 		this.parent = parent;
@@ -50,13 +50,13 @@ public class InstallAction implements Pr
 	}
 	
 	@Override
-	public AriesSubsystem run() {
+	public BasicSubsystem run() {
 		// Initialization of a null coordination must be privileged and,
 		// therefore, occur in the run() method rather than in the constructor.
 		Coordination coordination = this.coordination;
 		if (coordination == null)
 			coordination = Utils.createCoordination(parent);
-		AriesSubsystem result = null;
+		BasicSubsystem result = null;
 		try {
 			TargetRegion region = new TargetRegion(parent);
 			SubsystemResource ssr = createSubsystemResource(location, content, parent);
@@ -69,20 +69,20 @@ public class InstallAction implements Pr
 						&& result.getVersion().equals(ssr.getSubsystemManifest().getSubsystemVersionHeader().getVersion())
 						&& result.getType().equals(ssr.getSubsystemManifest().getSubsystemTypeHeader().getType())))
 					throw new SubsystemException("Location already exists but symbolic name, version, and type are not the same: " + location);
-				return (AriesSubsystem)ResourceInstaller.newInstance(coordination, result, parent).install();
+				return (BasicSubsystem)ResourceInstaller.newInstance(coordination, result, parent).install();
 			}
-			result = (AriesSubsystem)region.find(
+			result = (BasicSubsystem)region.find(
 					ssr.getSubsystemManifest().getSubsystemSymbolicNameHeader().getSymbolicName(), 
 					ssr.getSubsystemManifest().getSubsystemVersionHeader().getVersion());
 			if (result != null) {
 				checkLifecyclePermission(result);
 				if (!result.getType().equals(ssr.getSubsystemManifest().getSubsystemTypeHeader().getType()))
 					throw new SubsystemException("Subsystem already exists in target region but has a different type: " + location);
-				return (AriesSubsystem)ResourceInstaller.newInstance(coordination, result, parent).install();
+				return (BasicSubsystem)ResourceInstaller.newInstance(coordination, result, parent).install();
 			}
 			result = createSubsystem(ssr);
 			checkLifecyclePermission(result);
-			return (AriesSubsystem)ResourceInstaller.newInstance(coordination, result, parent).install();
+			return (BasicSubsystem)ResourceInstaller.newInstance(coordination, result, parent).install();
 		}
 		catch (Throwable t) {
 			coordination.fail(t);
@@ -105,7 +105,7 @@ public class InstallAction implements Pr
 		return result;
 	}
 
-	private void checkLifecyclePermission(final AriesSubsystem subsystem) {
+	private void checkLifecyclePermission(final BasicSubsystem subsystem) {
 		if (embedded)
 			return;
 		AccessController.doPrivileged(new PrivilegedAction<Object>() {
@@ -118,13 +118,13 @@ public class InstallAction implements Pr
 		context);
 	}
 	
-	private AriesSubsystem createSubsystem(SubsystemResource resource) throws URISyntaxException, IOException, BundleException, InvalidSyntaxException {
-		final AriesSubsystem result = new AriesSubsystem(resource);
+	private BasicSubsystem createSubsystem(SubsystemResource resource) throws URISyntaxException, IOException, BundleException, InvalidSyntaxException {
+		final BasicSubsystem result = new BasicSubsystem(resource);
 		return result;
 		
 	}
 	
-	private SubsystemResource createSubsystemResource(String location, InputStream content, AriesSubsystem parent) throws URISyntaxException, IOException, ResolutionException, BundleException, InvalidSyntaxException, ModellerException {
+	private SubsystemResource createSubsystemResource(String location, IDirectory content, BasicSubsystem parent) throws URISyntaxException, IOException, ResolutionException, BundleException, InvalidSyntaxException, ModellerException {
 		final SubsystemResource result = new SubsystemResource(location, content, parent);
 		return result;
 	}

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/PreferredProviderRepository.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/PreferredProviderRepository.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/PreferredProviderRepository.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/PreferredProviderRepository.java Thu Nov  8 00:33:51 2012
@@ -102,7 +102,7 @@ public class PreferredProviderRepository
 	}
 	
 	private boolean isValid(Capability capability) {
-		for (AriesSubsystem parent : resource.getParents())
+		for (BasicSubsystem parent : resource.getParents())
 			for (Resource constituent : parent.getConstituents())
 				if (ResourceHelper.areEqual(constituent, capability.getResource()))
 					return true;

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RawSubsystemResource.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RawSubsystemResource.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RawSubsystemResource.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RawSubsystemResource.java Thu Nov  8 00:33:51 2012
@@ -15,7 +15,6 @@ package org.apache.aries.subsystem.core.
 
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
@@ -100,10 +99,6 @@ public class RawSubsystemResource implem
 	private final Collection<Resource> resources;
 	private final SubsystemManifest subsystemManifest;
 	
-	public RawSubsystemResource(String location, InputStream content) throws URISyntaxException, IOException, ResolutionException, ModellerException {
-		this(location, content == null ? null : FileSystem.getFSRoot(content));
-	}
-	
 	public RawSubsystemResource(String location, IDirectory content) throws URISyntaxException, IOException, ResolutionException, ModellerException {
 		this.location = new Location(location);
 		if (content == null)
@@ -328,7 +323,7 @@ public class RawSubsystemResource implem
 				if (name.endsWith(".jar"))
 					result.add(new BundleResource(file));
 				else if (name.endsWith(".esa"))
-					result.add(new RawSubsystemResource(convertFileToLocation(file), file.open()));
+					result.add(new RawSubsystemResource(convertFileToLocation(file), file.convertNested()));
 			}
 			else {
 				if (name.endsWith(".esa"))
@@ -405,7 +400,7 @@ public class RawSubsystemResource implem
 		else
 			return new DeploymentManifest.Builder()
 					.manifest(getSubsystemManifest())
-					.location(AriesSubsystem.ROOT_LOCATION).autostart(true).id(0)
+					.location(BasicSubsystem.ROOT_LOCATION).autostart(true).id(0)
 					.lastId(SubsystemIdentifier.getLastId())
 					.state(State.INSTALLING)
 					.build();
@@ -419,8 +414,8 @@ public class RawSubsystemResource implem
 			return new SubsystemManifest(manifest);
 		else
 			return new SubsystemManifest.Builder()
-					.symbolicName(AriesSubsystem.ROOT_SYMBOLIC_NAME)
-					.version(AriesSubsystem.ROOT_VERSION)
+					.symbolicName(BasicSubsystem.ROOT_SYMBOLIC_NAME)
+					.version(BasicSubsystem.ROOT_VERSION)
 					.type(SubsystemTypeHeader.TYPE_APPLICATION
 							+ ';'
 							+ SubsystemTypeHeader.DIRECTIVE_PROVISION_POLICY

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RegionContextBundleHelper.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RegionContextBundleHelper.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RegionContextBundleHelper.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RegionContextBundleHelper.java Thu Nov  8 00:33:51 2012
@@ -30,7 +30,7 @@ public class RegionContextBundleHelper {
 	public static final String SYMBOLICNAME_PREFIX = Constants.RegionContextBundleSymbolicNamePrefix;
 	public static final Version VERSION = Version.parseVersion("1.0.0");
 	
-	public static void installRegionContextBundle(AriesSubsystem subsystem) throws BundleException, IOException {
+	public static void installRegionContextBundle(BasicSubsystem subsystem) throws BundleException, IOException {
 		String symbolicName = SYMBOLICNAME_PREFIX + subsystem.getSubsystemId();
 		String location = subsystem.getLocation() + '/' + subsystem.getSubsystemId();
 		Bundle b = subsystem.getRegion().getBundle(symbolicName, VERSION);
@@ -43,7 +43,7 @@ public class RegionContextBundleHelper {
 		b.start();
 	}
 	
-	public static void uninstallRegionContextBundle(AriesSubsystem subsystem) {
+	public static void uninstallRegionContextBundle(BasicSubsystem subsystem) {
 		String symbolicName = SYMBOLICNAME_PREFIX + subsystem.getSubsystemId();
 		Bundle bundle = subsystem.getRegion().getBundle(symbolicName, VERSION);
 		if (bundle == null)

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceHelper.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceHelper.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceHelper.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceHelper.java Thu Nov  8 00:33:51 2012
@@ -69,8 +69,8 @@ public class ResourceHelper {
 			return ((BundleResource)resource).getLocation();
 		if (resource instanceof BundleRevision)
 			return ((BundleRevision)resource).getBundle().getLocation();
-		if (resource instanceof AriesSubsystem)
-			return ((AriesSubsystem)resource).getLocation();
+		if (resource instanceof BasicSubsystem)
+			return ((BasicSubsystem)resource).getLocation();
 		if (resource instanceof SubsystemResource)
 			return ((SubsystemResource)resource).getLocation();
 		if (resource instanceof RawSubsystemResource)

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceInstaller.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceInstaller.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceInstaller.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceInstaller.java Thu Nov  8 00:33:51 2012
@@ -23,7 +23,7 @@ import org.osgi.service.subsystem.Subsys
 import org.osgi.service.subsystem.SubsystemException;
 
 public abstract class ResourceInstaller {
-	public static ResourceInstaller newInstance(Coordination coordination, Resource resource, AriesSubsystem subsystem) {
+	public static ResourceInstaller newInstance(Coordination coordination, Resource resource, BasicSubsystem subsystem) {
 		String type = ResourceHelper.getTypeAttribute(resource);
 		if (SubsystemConstants.SUBSYSTEM_TYPE_APPLICATION.equals(type)
 				|| SubsystemConstants.SUBSYSTEM_TYPE_COMPOSITE.equals(type)
@@ -36,11 +36,11 @@ public abstract class ResourceInstaller 
 	}
 	
 	protected final Coordination coordination;
-	protected final AriesSubsystem provisionTo;
+	protected final BasicSubsystem provisionTo;
 	protected final Resource resource;
-	protected final AriesSubsystem subsystem;
+	protected final BasicSubsystem subsystem;
 	
-	public ResourceInstaller(Coordination coordination, Resource resource, AriesSubsystem subsystem) {
+	public ResourceInstaller(Coordination coordination, Resource resource, BasicSubsystem subsystem) {
 		this.coordination = coordination;
 		this.resource = resource;
 		this.subsystem = subsystem;

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceReferences.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceReferences.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceReferences.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceReferences.java Thu Nov  8 00:33:51 2012
@@ -24,43 +24,43 @@ import java.util.Set;
 import org.osgi.resource.Resource;
 
 public class ResourceReferences {
-	private final Map<Resource, Set<AriesSubsystem>> resourceToSubsystems = new HashMap<Resource, Set<AriesSubsystem>>();
-	private final Map<AriesSubsystem, Set<Resource>> subsystemToResources = new HashMap<AriesSubsystem, Set<Resource>>();
+	private final Map<Resource, Set<BasicSubsystem>> resourceToSubsystems = new HashMap<Resource, Set<BasicSubsystem>>();
+	private final Map<BasicSubsystem, Set<Resource>> subsystemToResources = new HashMap<BasicSubsystem, Set<Resource>>();
 	
-	public synchronized void addReference(AriesSubsystem subsystem, Resource resource) {
+	public synchronized void addReference(BasicSubsystem subsystem, Resource resource) {
 		addSubsystemToResource(subsystem, resource);
 		addResourceToSubsystem(subsystem, resource);
 	}
 	
-	public synchronized Collection<Resource> getResources(AriesSubsystem subsystem) {
+	public synchronized Collection<Resource> getResources(BasicSubsystem subsystem) {
 		Collection<Resource> result = subsystemToResources.get(subsystem);
 		if (result == null)
 			result = Collections.emptyList();
 		return Collections.unmodifiableCollection(new ArrayList<Resource>(result));
 	}
 	
-	public synchronized Collection<AriesSubsystem> getSubsystems(Resource resource) {
-		Collection<AriesSubsystem> result = resourceToSubsystems.get(resource);
+	public synchronized Collection<BasicSubsystem> getSubsystems(Resource resource) {
+		Collection<BasicSubsystem> result = resourceToSubsystems.get(resource);
 		if (result == null)
 			result = Collections.emptyList();
-		return Collections.unmodifiableCollection(new ArrayList<AriesSubsystem>(result));
+		return Collections.unmodifiableCollection(new ArrayList<BasicSubsystem>(result));
 	}
 	
-	public synchronized void removeReference(AriesSubsystem subsystem, Resource resource) {
+	public synchronized void removeReference(BasicSubsystem subsystem, Resource resource) {
 		removeResourceToSubsystem(subsystem, resource);
 		removeSubsystemToResource(subsystem, resource);
 	}
 	
-	private void addResourceToSubsystem(AriesSubsystem subsystem, Resource resource) {
-		Set<AriesSubsystem> subsystems = resourceToSubsystems.get(resource);
+	private void addResourceToSubsystem(BasicSubsystem subsystem, Resource resource) {
+		Set<BasicSubsystem> subsystems = resourceToSubsystems.get(resource);
 		if (subsystems == null) {
-			subsystems = new HashSet<AriesSubsystem>();
+			subsystems = new HashSet<BasicSubsystem>();
 			resourceToSubsystems.put(resource, subsystems);
 		}
 		subsystems.add(subsystem);
 	}
 	
-	private void addSubsystemToResource(AriesSubsystem subsystem, Resource resource) {
+	private void addSubsystemToResource(BasicSubsystem subsystem, Resource resource) {
 		Set<Resource> resources = subsystemToResources.get(subsystem);
 		if (resources == null) {
 			resources = new HashSet<Resource>();
@@ -69,8 +69,8 @@ public class ResourceReferences {
 		resources.add(resource);
 	}
 	
-	private void removeResourceToSubsystem(AriesSubsystem subsystem, Resource resource) {
-		Set<AriesSubsystem> subsystems = resourceToSubsystems.get(resource);
+	private void removeResourceToSubsystem(BasicSubsystem subsystem, Resource resource) {
+		Set<BasicSubsystem> subsystems = resourceToSubsystems.get(resource);
 		if (subsystems == null)
 			return;
 		subsystems.remove(subsystem);
@@ -78,7 +78,7 @@ public class ResourceReferences {
 			resourceToSubsystems.remove(resource);
 	}
 	
-	private void removeSubsystemToResource(AriesSubsystem subsystem, Resource resource) {
+	private void removeSubsystemToResource(BasicSubsystem subsystem, Resource resource) {
 		Set<Resource> resources = subsystemToResources.get(subsystem);
 		if (resources == null)
 			return;

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceUninstaller.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceUninstaller.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceUninstaller.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceUninstaller.java Thu Nov  8 00:33:51 2012
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
 public abstract class ResourceUninstaller {
 	private static final Logger logger = LoggerFactory.getLogger(ResourceUninstaller.class);
 	
-	public static ResourceUninstaller newInstance(Resource resource, AriesSubsystem subsystem) {
+	public static ResourceUninstaller newInstance(Resource resource, BasicSubsystem subsystem) {
 		String type = ResourceHelper.getTypeAttribute(resource);
 		if (SubsystemConstants.SUBSYSTEM_TYPE_APPLICATION.equals(type)
 				|| SubsystemConstants.SUBSYSTEM_TYPE_COMPOSITE.equals(type)
@@ -37,19 +37,19 @@ public abstract class ResourceUninstalle
 			throw new SubsystemException("No uninstaller exists for resource type: " + type);
 	}
 	
-	protected static void removeConstituent(AriesSubsystem subsystem, Resource resource) {
+	protected static void removeConstituent(BasicSubsystem subsystem, Resource resource) {
 		Activator.getInstance().getSubsystems().removeConstituent(subsystem, resource);
 	}
 	
-	protected static void removeReference(AriesSubsystem subsystem, Resource resource) {
+	protected static void removeReference(BasicSubsystem subsystem, Resource resource) {
 		Activator.getInstance().getSubsystems().removeReference(subsystem, resource);
 	}
 	
-	protected final AriesSubsystem provisionTo;
+	protected final BasicSubsystem provisionTo;
 	protected final Resource resource;
-	protected final AriesSubsystem subsystem;
+	protected final BasicSubsystem subsystem;
 	
-	public ResourceUninstaller(Resource resource, AriesSubsystem subsystem) {
+	public ResourceUninstaller(Resource resource, BasicSubsystem subsystem) {
 		if (resource == null)
 			throw new NullPointerException("Missing required parameter: resource");
 		if (subsystem == null)
@@ -76,7 +76,7 @@ public abstract class ResourceUninstalle
 				return subsystem.getRegion().contains(((BundleRevision)resource).getBundle());
 			// TODO This is insufficient. The unscoped subsystem could be a
 			// dependency in another region, which would make it implicit.
-			return !((AriesSubsystem)resource).isScoped();
+			return !((BasicSubsystem)resource).isScoped();
 		}
 		return false;
 	}

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=1406875&r1=1406874&r2=1406875&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 Thu Nov  8 00:33:51 2012
@@ -51,11 +51,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class StartAction extends AbstractAction {
-	private static final Logger logger = LoggerFactory.getLogger(AriesSubsystem.class);
+	private static final Logger logger = LoggerFactory.getLogger(BasicSubsystem.class);
 	
-	private final AriesSubsystem instigator;
+	private final BasicSubsystem instigator;
 	
-	public StartAction(AriesSubsystem instigator, AriesSubsystem requestor, AriesSubsystem target) {
+	public StartAction(BasicSubsystem instigator, BasicSubsystem requestor, BasicSubsystem target) {
 		super(requestor, target, false);
 		this.instigator = instigator;
 	}
@@ -123,7 +123,7 @@ public class StartAction extends Abstrac
 		return null;
 	}
 	
-	private static Collection<Bundle> getBundles(AriesSubsystem subsystem) {
+	private static Collection<Bundle> getBundles(BasicSubsystem subsystem) {
 		Collection<Resource> constituents = Activator.getInstance().getSubsystems().getConstituents(subsystem);
 		ArrayList<Bundle> result = new ArrayList<Bundle>(constituents.size());
 		for (Resource resource : constituents) {
@@ -134,7 +134,7 @@ public class StartAction extends Abstrac
 		return result;
 	}
 	
-	private static void resolve(AriesSubsystem subsystem) {
+	private static void resolve(BasicSubsystem subsystem) {
 		// Don't propagate a RESOLVING event if this is a persisted subsystem
 		// that is already RESOLVED.
 		if (State.INSTALLED.equals(subsystem.getState()))
@@ -146,7 +146,7 @@ public class StartAction extends Abstrac
 			// actually doing the resolution work.
 			if (!subsystem.isRoot()) {
 				for (Subsystem child : Activator.getInstance().getSubsystems().getChildren(subsystem))
-					resolve((AriesSubsystem)child);
+					resolve((BasicSubsystem)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);
@@ -173,10 +173,10 @@ public class StartAction extends Abstrac
 		}
 	}
 	
-	private static void setExportIsolationPolicy(AriesSubsystem subsystem) throws InvalidSyntaxException, IOException, BundleException, URISyntaxException, ResolutionException {
+	private static void setExportIsolationPolicy(BasicSubsystem subsystem) throws InvalidSyntaxException, IOException, BundleException, URISyntaxException, ResolutionException {
 		if (!subsystem.isComposite())
 			return;
-		Region from = ((AriesSubsystem)subsystem.getParents().iterator().next()).getRegion();
+		Region from = ((BasicSubsystem)subsystem.getParents().iterator().next()).getRegion();
 		Region to = subsystem.getRegion();
 		RegionFilterBuilder builder = from.getRegionDigraph().createRegionFilterBuilder();
 		setExportIsolationPolicy(builder, subsystem.getDeploymentManifest().getExportPackageHeader(), subsystem);
@@ -191,7 +191,7 @@ public class StartAction extends Abstrac
 		from.connectRegion(to, regionFilter);
 	}
 	
-	private static void setExportIsolationPolicy(RegionFilterBuilder builder, ExportPackageHeader header, AriesSubsystem subsystem) throws InvalidSyntaxException {
+	private static void setExportIsolationPolicy(RegionFilterBuilder builder, ExportPackageHeader header, BasicSubsystem subsystem) throws InvalidSyntaxException {
 		if (header == null)
 			return;
 		String policy = RegionFilter.VISIBLE_PACKAGE_NAMESPACE;
@@ -206,7 +206,7 @@ public class StartAction extends Abstrac
 		}
 	}
 	
-	private static void setExportIsolationPolicy(RegionFilterBuilder builder, ProvideCapabilityHeader header, AriesSubsystem subsystem) throws InvalidSyntaxException {
+	private static void setExportIsolationPolicy(RegionFilterBuilder builder, ProvideCapabilityHeader header, BasicSubsystem subsystem) throws InvalidSyntaxException {
 		if (header == null)
 			return;
 		for (ProvideCapabilityHeader.Clause clause : header.getClauses()) {
@@ -222,7 +222,7 @@ public class StartAction extends Abstrac
 		}
 	}
 	
-	private static void setExportIsolationPolicy(RegionFilterBuilder builder, SubsystemExportServiceHeader header, AriesSubsystem subsystem) throws InvalidSyntaxException {
+	private static void setExportIsolationPolicy(RegionFilterBuilder builder, SubsystemExportServiceHeader header, BasicSubsystem subsystem) throws InvalidSyntaxException {
 		if (header == null)
 			return;
 		String policy = RegionFilter.VISIBLE_SERVICE_NAMESPACE;
@@ -276,7 +276,7 @@ public class StartAction extends Abstrac
 	}
 
 	private void startSubsystemResource(Resource resource, Coordination coordination) throws IOException {
-		final AriesSubsystem subsystem = (AriesSubsystem)resource;
+		final BasicSubsystem subsystem = (BasicSubsystem)resource;
 		// Subsystems that are content resources of another subsystem must have
 		// their autostart setting set to started.
 		if (Utils.isContent(this.target, subsystem))

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StopAction.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StopAction.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StopAction.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StopAction.java Thu Nov  8 00:33:51 2012
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
 public class StopAction extends AbstractAction {
 	private static final Logger logger = LoggerFactory.getLogger(StopAction.class);
 	
-	public StopAction(AriesSubsystem requestor, AriesSubsystem target, boolean disableRootCheck) {
+	public StopAction(BasicSubsystem requestor, BasicSubsystem target, boolean disableRootCheck) {
 		super(requestor, target, disableRootCheck);
 	}
 	
@@ -110,6 +110,6 @@ public class StopAction extends Abstract
 	}
 	
 	private void stopSubsystemResource(Resource resource) throws IOException {
-		new StopAction(target, (AriesSubsystem)resource, !((AriesSubsystem)resource).isRoot()).run();
+		new StopAction(target, (BasicSubsystem)resource, !((BasicSubsystem)resource).isRoot()).run();
 	}
 }

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemGraph.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemGraph.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemGraph.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemGraph.java Thu Nov  8 00:33:51 2012
@@ -63,11 +63,11 @@ public class SubsystemGraph {
 	}
 	private final Map<SubsystemWrapper, Collection<SubsystemWrapper>> adjacencyList = new HashMap<SubsystemWrapper, Collection<SubsystemWrapper>>();
 	
-	public SubsystemGraph(AriesSubsystem root) {
+	public SubsystemGraph(BasicSubsystem root) {
 		adjacencyList.put(new SubsystemWrapper(root), new HashSet<SubsystemWrapper>());
 	}
 	
-	public synchronized void add(AriesSubsystem parent, AriesSubsystem child) {
+	public synchronized void add(BasicSubsystem parent, BasicSubsystem child) {
 		SubsystemWrapper parentWrap = new SubsystemWrapper(parent);
 		SubsystemWrapper childWrap = new SubsystemWrapper(child);
 		if (containsAncestor(childWrap, parentWrap))
@@ -85,7 +85,7 @@ public class SubsystemGraph {
 		subsystems.add(childWrap);
 	}
 	
-	public synchronized Collection<Subsystem> getChildren(AriesSubsystem parent) {
+	public synchronized Collection<Subsystem> getChildren(BasicSubsystem parent) {
 		Collection<SubsystemWrapper> children = adjacencyList.get(new SubsystemWrapper(parent));
 		if (children == null || children.isEmpty())
 			return Collections.emptySet();
@@ -95,7 +95,7 @@ public class SubsystemGraph {
  		return Collections.unmodifiableCollection(result);
 	}
 	
-	public synchronized Collection<Subsystem> getParents(AriesSubsystem child) {
+	public synchronized Collection<Subsystem> getParents(BasicSubsystem child) {
 		Collection<SubsystemWrapper> parents = getParents(new SubsystemWrapper(child));
 		Collection<Subsystem> result = new ArrayList<Subsystem>(parents.size());
 		for (SubsystemWrapper parent : parents) {
@@ -104,7 +104,7 @@ public class SubsystemGraph {
 		return Collections.unmodifiableCollection(result);
 	}
 	
-	public synchronized void remove(AriesSubsystem child) {
+	public synchronized void remove(BasicSubsystem child) {
 		SubsystemWrapper subsystemWrap = new SubsystemWrapper(child);
 		Collection<SubsystemWrapper> parents = getParents(subsystemWrap);
 		for (SubsystemWrapper parent : parents)
@@ -112,7 +112,7 @@ public class SubsystemGraph {
 		adjacencyList.remove(subsystemWrap);
 	}
 	
-	public synchronized void remove(AriesSubsystem parent, AriesSubsystem child) {
+	public synchronized void remove(BasicSubsystem parent, BasicSubsystem child) {
 		SubsystemWrapper parentWrap = new SubsystemWrapper(parent);
 		SubsystemWrapper childWrap = new SubsystemWrapper(child);
 		adjacencyList.get(parentWrap).remove(childWrap);

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemManifestValidator.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemManifestValidator.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemManifestValidator.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemManifestValidator.java Thu Nov  8 00:33:51 2012
@@ -20,7 +20,7 @@ import org.osgi.service.subsystem.Subsys
 import org.osgi.service.subsystem.SubsystemException;
 
 public class SubsystemManifestValidator {
-	public static void validate(AriesSubsystem subsystem, SubsystemManifest manifest) {
+	public static void validate(BasicSubsystem subsystem, SubsystemManifest manifest) {
 		validatePreferredProviderHeader(manifest.getPreferredProviderHeader());
 		if (subsystem.isComposite()) {
 			SubsystemContentHeader header = manifest.getSubsystemContentHeader();

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResolverHook.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResolverHook.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResolverHook.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResolverHook.java Thu Nov  8 00:33:51 2012
@@ -47,14 +47,14 @@ public class SubsystemResolverHook imple
 		// there is at least one preferred provider.
 		// (1) Find the subsystem(s) containing requirement.getResource() as a
 		// constituent.
-		Collection<AriesSubsystem> requirers = subsystems.getSubsystemsReferencing(requirement.getResource());
+		Collection<BasicSubsystem> requirers = subsystems.getSubsystemsReferencing(requirement.getResource());
 		// (2) For each candidate, ask each subsystem if the candidate or any of
 		// the candidate's containing subsystems is a preferred provider. If at
 		// least one preferred provider exists, filter out all other candidates
 		// that are not also preferred providers.
 		Collection<BundleCapability> preferredProviders = new ArrayList<BundleCapability>(candidates.size());
 		for (BundleCapability candidate : candidates)
-			for (AriesSubsystem subsystem : requirers) {
+			for (BasicSubsystem subsystem : requirers) {
 				PreferredProviderHeader header = subsystem.getSubsystemManifest().getPreferredProviderHeader();
 				if (header != null && (header.contains(candidate.getResource()) || isResourceConstituentOfPreferredSubsystem(candidate.getResource(), subsystem)))
 					preferredProviders.add(candidate);
@@ -70,8 +70,8 @@ public class SubsystemResolverHook imple
 				if (revision.getSymbolicName().startsWith(Constants.RegionContextBundleSymbolicNamePrefix))
 					// Don't want to filter out the region context bundle.
 					continue;
-				Collection<AriesSubsystem> subsystems = this.subsystems.getSubsystemsReferencing(revision);
-				for (AriesSubsystem subsystem : subsystems) {
+				Collection<BasicSubsystem> subsystems = this.subsystems.getSubsystemsReferencing(revision);
+				for (BasicSubsystem subsystem : subsystems) {
 					if (subsystem.isFeature()) {
 						// Feature subsystems require no isolation.
 						continue;
@@ -94,9 +94,9 @@ public class SubsystemResolverHook imple
 		// noop
 	}
 	
-	private boolean isResourceConstituentOfPreferredSubsystem(Resource resource, AriesSubsystem preferer) {
-		Collection<AriesSubsystem> subsystems = this.subsystems.getSubsystemsReferencing(resource);
-		for (AriesSubsystem subsystem : subsystems)
+	private boolean isResourceConstituentOfPreferredSubsystem(Resource resource, BasicSubsystem preferer) {
+		Collection<BasicSubsystem> subsystems = this.subsystems.getSubsystemsReferencing(resource);
+		for (BasicSubsystem subsystem : subsystems)
 			if (preferer.getSubsystemManifest().getPreferredProviderHeader().contains(subsystem))
 				return true;
 		return false;

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResource.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResource.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResource.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResource.java Thu Nov  8 00:33:51 2012
@@ -15,7 +15,6 @@ package org.apache.aries.subsystem.core.
 
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -84,17 +83,17 @@ public class SubsystemResource implement
 	private final Collection<Resource> mandatoryResources = new HashSet<Resource>();
 	private final Collection<DeployedContentHeader.Clause> missingResources = new HashSet<DeployedContentHeader.Clause>();
 	private final Collection<Resource> optionalResources = new HashSet<Resource>();
-	private final AriesSubsystem parent;
+	private final BasicSubsystem parent;
 	private final Repository preferredProviderRepository;
 	private final RawSubsystemResource resource;
 	private final Collection<Resource> sharedContent = new HashSet<Resource>();
 	private final Collection<Resource> sharedDependencies = new HashSet<Resource>();
 	
-	public SubsystemResource(String location, InputStream content, AriesSubsystem parent) throws URISyntaxException, IOException, ResolutionException, BundleException, InvalidSyntaxException, ModellerException {
+	public SubsystemResource(String location, IDirectory content, BasicSubsystem parent) throws URISyntaxException, IOException, ResolutionException, BundleException, InvalidSyntaxException, ModellerException {
 		this(new RawSubsystemResource(location, content), parent);
 	}
 	
-	public SubsystemResource(RawSubsystemResource resource, AriesSubsystem parent) throws IOException, BundleException, InvalidSyntaxException, URISyntaxException {
+	public SubsystemResource(RawSubsystemResource resource, BasicSubsystem parent) throws IOException, BundleException, InvalidSyntaxException, URISyntaxException {
 		this.parent = parent;
 		this.resource = resource;
 		id = SubsystemIdentifier.getNextId();
@@ -191,13 +190,13 @@ public class SubsystemResource implement
 		return missingResources;
 	}
 	
-	public Collection<AriesSubsystem> getParents() {
+	public Collection<BasicSubsystem> getParents() {
 		if (parent == null) {
 			Header<?> header = getDeploymentManifest().getHeaders().get(DeploymentManifest.ARIESSUBSYSTEM_PARENTS);
 			if (header == null)
 				return Collections.emptyList();
 			String[] parentIds = header.getValue().split(",");
-			Collection<AriesSubsystem> result = new ArrayList<AriesSubsystem>(parentIds.length);
+			Collection<BasicSubsystem> result = new ArrayList<BasicSubsystem>(parentIds.length);
 			for (String parentId : parentIds)
 				result.add(Activator.getInstance().getSubsystems().getSubsystemById(Long.valueOf(parentId)));
 			return result;
@@ -480,7 +479,7 @@ public class SubsystemResource implement
 			
 			private Map<Resource, Wiring> computeWirings() {
 				Map<Resource, Wiring> wirings = new HashMap<Resource, Wiring>();
-				for (AriesSubsystem subsystem : Activator.getInstance().getSubsystems().getSubsystems())
+				for (BasicSubsystem subsystem : Activator.getInstance().getSubsystems().getSubsystems())
 					for (Resource constituent : subsystem.getConstituents())
 						addWiring(constituent, wirings);
 				return Collections.unmodifiableMap(wirings);
@@ -566,8 +565,8 @@ public class SubsystemResource implement
 							return provider;
 						}
 					}
-					else if (provider instanceof AriesSubsystem) {
-						if (getRegion().equals(((AriesSubsystem)provider).getRegion())) {
+					else if (provider instanceof BasicSubsystem) {
+						if (getRegion().equals(((BasicSubsystem)provider).getRegion())) {
 							return provider;
 						}
 					}
@@ -652,7 +651,7 @@ public class SubsystemResource implement
 	}
 	
 	private boolean isRoot() {
-		return AriesSubsystem.ROOT_LOCATION.equals(getLocation());
+		return BasicSubsystem.ROOT_LOCATION.equals(getLocation());
 	}
 	
 	private boolean isShared(Resource resource) {
@@ -701,7 +700,7 @@ public class SubsystemResource implement
 		Region region = getRegion();
 		Region from = region;
 		RegionFilterBuilder builder = from.getRegionDigraph().createRegionFilterBuilder();
-		Region to = ((AriesSubsystem)getParents().iterator().next()).getRegion();
+		Region to = ((BasicSubsystem)getParents().iterator().next()).getRegion();
 		addSubsystemServiceImportToSharingPolicy(builder, to);
 		// TODO Is this check really necessary? Looks like it was done at the beginning of this method.
 		if (isScoped()) {

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceInstaller.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceInstaller.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceInstaller.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceInstaller.java Thu Nov  8 00:33:51 2012
@@ -18,6 +18,7 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
+import org.apache.aries.util.filesystem.FileSystem;
 import org.osgi.resource.Resource;
 import org.osgi.service.coordinator.Coordination;
 import org.osgi.service.coordinator.Participant;
@@ -25,16 +26,16 @@ import org.osgi.service.repository.Repos
 import org.osgi.service.subsystem.Subsystem.State;
 
 public class SubsystemResourceInstaller extends ResourceInstaller {
-	public SubsystemResourceInstaller(Coordination coordination, Resource resource, AriesSubsystem subsystem) {
+	public SubsystemResourceInstaller(Coordination coordination, Resource resource, BasicSubsystem subsystem) {
 		super(coordination, resource, subsystem);
 	}
 	
 	public Resource install() throws Exception {
-		AriesSubsystem result;
+		BasicSubsystem result;
 		if (resource instanceof RepositoryContent)
 			result = installRepositoryContent((RepositoryContent)resource);
-		else if (resource instanceof AriesSubsystem)
-			result = installAriesSubsystem((AriesSubsystem)resource);
+		else if (resource instanceof BasicSubsystem)
+			result = installAriesSubsystem((BasicSubsystem)resource);
 		else if (resource instanceof RawSubsystemResource)
 			result = installRawSubsystemResource((RawSubsystemResource)resource);
 		else
@@ -42,7 +43,7 @@ public class SubsystemResourceInstaller 
 		return result;
 	}
 	
-	private void addChild(final AriesSubsystem child) {
+	private void addChild(final BasicSubsystem child) {
 		// provisionTo will be null if the resource is an already installed
 		// dependency.
 		if (provisionTo == null)
@@ -64,7 +65,7 @@ public class SubsystemResourceInstaller 
 		});
 	}
 	
-	private void addSubsystem(final AriesSubsystem subsystem) {
+	private void addSubsystem(final BasicSubsystem subsystem) {
 		Activator.getInstance().getSubsystems().addSubsystem(subsystem);
 		coordination.addParticipant(new Participant() {
 			@Override
@@ -79,7 +80,7 @@ public class SubsystemResourceInstaller 
 		});
 	}
 	
-	private AriesSubsystem installAriesSubsystem(AriesSubsystem subsystem) throws Exception {
+	private BasicSubsystem installAriesSubsystem(BasicSubsystem subsystem) throws Exception {
 		// If the state is null, this is a brand new subsystem. If the state is
 		// not null, this is a persisted subsystem. For brand new subsystems,
 		// an INSTALLING event must be propagated.
@@ -122,18 +123,18 @@ public class SubsystemResourceInstaller 
 		return subsystem;
 	}
 	
-	private AriesSubsystem installRawSubsystemResource(RawSubsystemResource resource) throws Exception {
+	private BasicSubsystem installRawSubsystemResource(RawSubsystemResource resource) throws Exception {
 		SubsystemResource subsystemResource = new SubsystemResource(resource, provisionTo);
 		return installSubsystemResource(subsystemResource);
 	}
 	
-	private AriesSubsystem installRepositoryContent(RepositoryContent resource) throws Exception {
-		RawSubsystemResource rawSubsystemResource = new RawSubsystemResource(getLocation(), resource.getContent());
+	private BasicSubsystem installRepositoryContent(RepositoryContent resource) throws Exception {
+		RawSubsystemResource rawSubsystemResource = new RawSubsystemResource(getLocation(), FileSystem.getFSRoot(resource.getContent()));
 		return installRawSubsystemResource(rawSubsystemResource);
 	}
 	
-	private AriesSubsystem installSubsystemResource(SubsystemResource resource) throws Exception {
-		AriesSubsystem subsystem = new AriesSubsystem(resource);
+	private BasicSubsystem installSubsystemResource(SubsystemResource resource) throws Exception {
+		BasicSubsystem subsystem = new BasicSubsystem(resource);
 		installAriesSubsystem(subsystem);
 		return subsystem;
 	}

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceUninstaller.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceUninstaller.java?rev=1406875&r1=1406874&r2=1406875&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceUninstaller.java (original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceUninstaller.java Thu Nov  8 00:33:51 2012
@@ -22,13 +22,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class SubsystemResourceUninstaller extends ResourceUninstaller {
-	private static final Logger logger = LoggerFactory.getLogger(AriesSubsystem.class);
+	private static final Logger logger = LoggerFactory.getLogger(BasicSubsystem.class);
 	
-	private static void removeChild(AriesSubsystem parent, AriesSubsystem child) {
+	private static void removeChild(BasicSubsystem parent, BasicSubsystem child) {
 		Activator.getInstance().getSubsystems().removeChild(parent, child);
 	}
 	
-	public SubsystemResourceUninstaller(Resource resource, AriesSubsystem subsystem) {
+	public SubsystemResourceUninstaller(Resource resource, BasicSubsystem subsystem) {
 		super(resource, subsystem);
 	}
 	
@@ -47,11 +47,11 @@ public class SubsystemResourceUninstalle
 	
 	private void removeChildren() {
 		if (!isExplicit()) {
-			removeChild((AriesSubsystem)subsystem, (AriesSubsystem)resource);
+			removeChild((BasicSubsystem)subsystem, (BasicSubsystem)resource);
 			return;
 		}
-		for (Subsystem subsystem : ((AriesSubsystem)resource).getParents())
-			removeChild((AriesSubsystem)subsystem, (AriesSubsystem)resource);
+		for (Subsystem subsystem : ((BasicSubsystem)resource).getParents())
+			removeChild((BasicSubsystem)subsystem, (BasicSubsystem)resource);
 	}
 	
 	private void removeConstituents() {
@@ -59,8 +59,8 @@ public class SubsystemResourceUninstalle
 			removeConstituent();
 			return;
 		}
-		for (Subsystem subsystem : ((AriesSubsystem)resource).getParents())
-			removeConstituent((AriesSubsystem)subsystem, (AriesSubsystem)resource);
+		for (Subsystem subsystem : ((BasicSubsystem)resource).getParents())
+			removeConstituent((BasicSubsystem)subsystem, (BasicSubsystem)resource);
 	}
 	
 	private void removeReferences() {
@@ -68,16 +68,16 @@ public class SubsystemResourceUninstalle
 			removeReference();
 			return;
 		}
-		for (Subsystem subsystem : ((AriesSubsystem)resource).getParents())
-			removeReference((AriesSubsystem)subsystem, (AriesSubsystem)resource);
+		for (Subsystem subsystem : ((BasicSubsystem)resource).getParents())
+			removeReference((BasicSubsystem)subsystem, (BasicSubsystem)resource);
 	}
 	
 	private void removeSubsystem() {
-		Activator.getInstance().getSubsystems().removeSubsystem((AriesSubsystem)resource);
+		Activator.getInstance().getSubsystems().removeSubsystem((BasicSubsystem)resource);
 	}
 	
 	private void uninstallSubsystem() {
-		AriesSubsystem subsystem = (AriesSubsystem) resource;
+		BasicSubsystem subsystem = (BasicSubsystem) resource;
 		try {
 			if (subsystem.getState().equals(Subsystem.State.RESOLVED))
 				subsystem.setState(State.INSTALLED);



Mime
View raw message