tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1103636 - /tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java
Date Mon, 16 May 2011 07:40:53 GMT
Author: antelder
Date: Mon May 16 07:40:52 2011
New Revision: 1103636

URL: http://svn.apache.org/viewvc?rev=1103636&view=rev
Log:
Simplify methods for loading a composite by xml

Modified:
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java?rev=1103636&r1=1103635&r2=1103636&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl2.java
Mon May 16 07:40:52 2011
@@ -198,29 +198,21 @@ public class NodeImpl2 {
         // load it to check its valid composite XML
         Composite composite = compositeFromXML(compositeXML);
         
-        addDeploymentComposite(ic, composite);
-        return composite.getURI();
-    }
-
-    protected Composite compositeFromXML(Reader compositeXML) throws XMLStreamException,
ContributionReadException, ValidationException {
-        Monitor monitor = deployer.createMonitor();
-        Composite composite = deployer.loadXMLDocument(compositeXML, monitor);
-        monitor.analyzeProblems();
-        return composite;
+        return addDeploymentComposite(ic, composite);
     }
 
     public String addDeploymentComposite(String contributionURI, Composite composite) {
         InstalledContribution ic = getInstalledContribution(contributionURI);
-        addDeploymentComposite(ic, composite);
-        return composite.getURI();
+        return addDeploymentComposite(ic, composite);
     }
 
-    protected void addDeploymentComposite(InstalledContribution ic, Composite composite)
{
+    protected String addDeploymentComposite(InstalledContribution ic, Composite composite)
{
         if (composite.getURI() == null || composite.getURI().length() < 1) {
             composite.setURI(composite.getName().getLocalPart() + ".composite");
         }
         ic.getAdditionalDeployables().put(composite.getURI(), compositeToXML(composite));
         domainRegistry.updateInstalledContribution(ic);
+        return composite.getURI();
     }
 
     public void validateContribution(String contributionURI) throws ContributionReadException,
ValidationException {
@@ -393,4 +385,10 @@ public class NodeImpl2 {
         }
     }
     
+    protected Composite compositeFromXML(Reader compositeXML) throws XMLStreamException,
ContributionReadException, ValidationException {
+        Monitor monitor = deployer.createMonitor();
+        Composite composite = deployer.loadXMLDocument(compositeXML, monitor);
+        monitor.analyzeProblems();
+        return composite;
+    }
 }



Mime
View raw message