diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-17 11:05:13 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-17 11:05:13 +0000 |
commit | eb2e833e9d2abeb28fb7dab7709337735046593e (patch) | |
tree | b2e6ae83ce63ad2637556a0ecf16cb1e9f2d3406 | |
parent | e7b85f88a520a840e5927dcdab23a06d09806332 (diff) |
Remove unused methods on InstalledContribution and add a method to merge in contribution metadata
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1104134 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/InstalledContribution.java | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/InstalledContribution.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/InstalledContribution.java index c71751b7e0..0f2eacbaf7 100644 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/InstalledContribution.java +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/InstalledContribution.java @@ -26,6 +26,15 @@ import java.util.HashMap; import java.util.List;
import java.util.Map;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.Export;
+import org.apache.tuscany.sca.contribution.Import;
+import org.apache.tuscany.sca.contribution.java.JavaExport;
+import org.apache.tuscany.sca.contribution.java.JavaImport;
+import org.apache.tuscany.sca.contribution.namespace.NamespaceExport;
+import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
+
public class InstalledContribution implements Serializable {
private static final long serialVersionUID = 1L;
@@ -42,9 +51,6 @@ public class InstalledContribution implements Serializable { private List<String> javaImports = new ArrayList<String>();
private List<String> namespaceImports = new ArrayList<String>();
- private String metaData;
- private boolean overwriteMetaData;
-
// the URI and XML content of composites to include in the contribution
private Map<String, String> additionalDeployables = new HashMap<String, String>();
@@ -74,18 +80,6 @@ public class InstalledContribution implements Serializable { public List<String> getDependentContributionURIs() {
return dependentContributionURIs;
}
- public String getMetaData() {
- return metaData;
- }
- public void setMetaData(String metaData) {
- this.metaData = metaData;
- }
- public boolean isOverwriteMetaData() {
- return overwriteMetaData;
- }
- public void setOverwriteMetaData(boolean overwriteMetaData) {
- this.overwriteMetaData = overwriteMetaData;
- }
public Map<String, String> getAdditionalDeployables() {
return additionalDeployables;
}
@@ -102,6 +96,37 @@ public class InstalledContribution implements Serializable { return namespaceImports;
}
+ public void configureMetaData(Contribution contribution) {
+
+ if (contribution.getDeployables() != null) {
+ for (Composite composite : contribution.getDeployables()) {
+ getDeployables().add(composite.getURI());
+ }
+ }
+
+ if (contribution.getExports() != null) {
+ for (Export export : contribution.getExports()) {
+ // TODO: Handle these and others in a more extensible way
+ if (export instanceof JavaExport) {
+ getJavaExports().add(((JavaExport)export).getPackage());
+ } else if (export instanceof NamespaceExport) {
+ getNamespaceExports().add(((NamespaceExport)export).getNamespace());
+ }
+ }
+ }
+
+ if (contribution.getImports() != null) {
+ for (Import imprt : contribution.getImports()) {
+ // TODO: Handle these and others in a more extensible way
+ if (imprt instanceof JavaImport) {
+ getJavaImports().add(((JavaImport)imprt).getPackage());
+ } else if (imprt instanceof NamespaceImport) {
+ getNamespaceImports().add(((NamespaceImport)imprt).getNamespace());
+ }
+ }
+ }
+ }
+
/**
* Derives a URI for the contribution based on its URL
*/
|