tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r1154194 - in /tuscany/sca-java-2.x/trunk/modules: assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/
Date Fri, 05 Aug 2011 12:52:49 GMT
Author: slaws
Date: Fri Aug  5 12:52:48 2011
New Revision: 1154194

URL: http://svn.apache.org/viewvc?rev=1154194&view=rev
Log:
TUSCANY-3907 - Clone top level composites before adding them to the domain level composite
so that they don't get build more than once. Also clone bindings when reference and services
are cloned. 

Modified:
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
    tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java?rev=1154194&r1=1154193&r2=1154194&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java
Fri Aug  5 12:52:48 2011
@@ -53,7 +53,10 @@ public class ReferenceImpl extends Abstr
     @Override
     public Object clone() throws CloneNotSupportedException {
         ReferenceImpl clone = (ReferenceImpl)super.clone();
-        clone.bindings = new ArrayList<Binding>(bindings);
+        clone.bindings = new ArrayList<Binding>();
+        for (Binding binding : getBindings()){
+            clone.bindings.add((Binding)binding.clone());
+        }
         clone.targets = new ArrayList<ComponentService>(targets);
         // clone the endpoint references themselves and set the reference pointer back to

         // this new refrence

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java?rev=1154194&r1=1154193&r2=1154194&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
Fri Aug  5 12:52:48 2011
@@ -50,7 +50,9 @@ public class ServiceImpl extends Abstrac
     public Object clone() throws CloneNotSupportedException {
         ServiceImpl clone = (ServiceImpl)super.clone();
         clone.bindings = new ArrayList<Binding>();
-        clone.bindings.addAll(getBindings());
+        for (Binding binding : getBindings()){
+            clone.bindings.add((Binding)binding.clone());
+        }
         return clone;
     }
 

Modified: tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java?rev=1154194&r1=1154193&r2=1154194&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
Fri Aug  5 12:52:48 2011
@@ -583,6 +583,15 @@ public class DeployerImpl implements Dep
 
         for (Contribution contribution : contributionList) {
             for (Composite composite : contribution.getDeployables()) {
+                // TUSCANY-3907 - clone the top level composite before we includr
+                //                it so that the composite model retained within 
+                //                the CompositeModelResolver is not changed by the build
+                try {
+                    composite = (Composite)composite.clone();
+                } catch (CloneNotSupportedException ex){
+                   // it is supported on Composite 
+                }
+                
                 // Include the node composite in the top-level composite
                 domainComposite.getIncludes().add(composite);
             }



Mime
View raw message