aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwr...@apache.org
Subject svn commit: r1339608 - in /aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core: archive/SubsystemArchive.java internal/AriesSubsystem.java
Date Thu, 17 May 2012 14:05:22 GMT
Author: jwross
Date: Thu May 17 14:05:21 2012
New Revision: 1339608

URL: http://svn.apache.org/viewvc?rev=1339608&view=rev
Log:
ARIES-825: General cleanup. Obsolete code removal.

Modified:
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemArchive.java
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/AriesSubsystem.java

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemArchive.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemArchive.java?rev=1339608&r1=1339607&r2=1339608&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemArchive.java
(original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemArchive.java
Thu May 17 14:05:21 2012
@@ -31,11 +31,11 @@ public class SubsystemArchive implements
 	private DeploymentManifest deploymentManifest;
 	private SubsystemManifest subsystemManifest;
 	
-	public SubsystemArchive(SubsystemResource resource, File directory) {
+	public SubsystemArchive(SubsystemResource resource, File directory) throws IOException {
 		this.directory = directory;
 		resources = resource.getResources();
-		deploymentManifest = resource.getDeploymentManifest();
-		subsystemManifest = resource.getSubsystemManifest();
+		setSubsystemManifest(resource.getSubsystemManifest());
+		setDeploymentManifest(resource.getDeploymentManifest());
 	}
 	
 	public SubsystemArchive(File content) throws Exception {

Modified: 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/AriesSubsystem.java?rev=1339608&r1=1339607&r2=1339608&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/AriesSubsystem.java
Thu May 17 14:05:21 2012
@@ -239,12 +239,9 @@ public class AriesSubsystem implements S
 			throw new SubsystemException("Unable to make directory for " + directory.getAbsolutePath());
 		try {
 			archive = new SubsystemArchive(resource, directory);
-			archive.setSubsystemManifest(resource.getSubsystemManifest());
-			if (resource.getDeploymentManifest() != null)
-				archive.setDeploymentManifest(resource.getDeploymentManifest());
 			SubsystemManifestValidator.validate(this, archive.getSubsystemManifest());
 			// Unscoped subsystems don't get their own region. They share the region with their scoped
parent.
-			if (isFeature())
+			if (isUnscoped())
 				region = parent.region;
 			else
 				region = createRegion(getSymbolicName() + ';' + getVersion() + ';' + getType() + ';'
+ getSubsystemId());
@@ -256,25 +253,6 @@ public class AriesSubsystem implements S
 		}
 	}
 	
-	public AriesSubsystem(SubsystemArchive archive, AriesSubsystem parent) throws Exception
{
-		subsystemGraph = parent.subsystemGraph;
-		this.archive = archive;
-		DeploymentManifest manifest = archive.getDeploymentManifest();
-		if (manifest == null)
-			throw new IllegalStateException("Missing deployment manifest");
-		autostart = Boolean.parseBoolean(manifest.getHeaders().get(DeploymentManifest.ARIESSUBSYSTEM_AUTOSTART).getValue());
-		id = Long.parseLong(manifest.getHeaders().get(DeploymentManifest.ARIESSUBSYSTEM_ID).getValue());
-		location = manifest.getHeaders().get(DeploymentManifest.ARIESSUBSYSTEM_LOCATION).getValue();
-		String directoryName = "subsystem" + id;
-		directory = new File(parent.directory, directoryName);
-		// Unscoped subsystems don't get their own region. They share the region with their scoped
parent.
-		if (isFeature())
-			region = parent.region;
-		else
-			region = createRegion(getSymbolicName() + ';' + getVersion() + ';' + getType() + ';' +
getSubsystemId());
-		resource = null;
-	}
-	
 	public SubsystemArchive getArchive() {
 		return archive;
 	}
@@ -517,16 +495,6 @@ public class AriesSubsystem implements S
 			return;
 		}
 		setState(State.STOPPING);
-		// Stop child subsystems first.
-//		for (Subsystem subsystem : subsystemGraph.getChildren(this)) {
-//			try {
-//				stopSubsystemResource((AriesSubsystem)subsystem);
-//			}
-//			catch (Exception e) {
-//				LOGGER.error("An error occurred while stopping resource "
-//						+ subsystem + " of subsystem " + this, e);
-//			}
-//		}
 		// For non-root subsystems, stop any remaining constituents.
 		if (!isRoot()){
 			List<Resource> resources = new ArrayList<Resource>(resourceReferences.getResources(this));
@@ -651,17 +619,7 @@ public class AriesSubsystem implements S
 		return root;
 	}
 	
-	private DeploymentManifest getDeploymentManifest() throws IOException, URISyntaxException,
ResolutionException {
-		if (archive.getDeploymentManifest() == null)
-			archive.setDeploymentManifest(new DeploymentManifest(
-					archive.getDeploymentManifest(),
-					archive.getSubsystemManifest(), 
-					autostart,
-					id,
-					SubsystemIdentifier.getLastId(),
-					location,
-					true,
-					false));
+	private DeploymentManifest getDeploymentManifest() {
 		return archive.getDeploymentManifest();
 	}
 	
@@ -821,6 +779,10 @@ public class AriesSubsystem implements S
 		return isApplication() || isComposite();
 	}
 	
+	private boolean isUnscoped() {
+		return !isScoped();
+	}
+	
 	void resolve() {
 		if (state != State.INSTALLED)
 			return;



Mime
View raw message