Author: rfeng
Date: Thu Sep 28 17:46:41 2006
New Revision: 451077

URL: http://svn.apache.org/viewvc?view=rev&rev=451077
Log:
Connect the services and references first so that it won't complain that the 
inbound wire of

a reference doesn't have an interceptor. 

Modified:
    
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/AbstractCompositeComponent.java

Modified: 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/AbstractCompositeComponent.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/AbstractCompositeComponent.java?view=diff&rev=451077&r1=451076&r2=451077
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/AbstractCompositeComponent.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/AbstractCompositeComponent.java
 Thu Sep 28 17:46:41 2006
@@ -18,6 +18,7 @@
  */
 package org.apache.tuscany.core.implementation.composite;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -29,6 +30,7 @@
 import org.apache.tuscany.spi.CoreRuntimeException;
 import org.apache.tuscany.spi.builder.Connector;
 import org.apache.tuscany.spi.component.AtomicComponent;
+import org.apache.tuscany.spi.component.Component;
 import org.apache.tuscany.spi.component.CompositeComponent;
 import org.apache.tuscany.spi.component.DuplicateNameException;
 import org.apache.tuscany.spi.component.IllegalTargetException;
@@ -55,7 +57,6 @@
  *
  * @version $Rev$ $Date$
  */
[EMAIL PROTECTED]({"NonPrivateFieldAccessedInSynchronizedContext"})
 public abstract class AbstractCompositeComponent extends 
CompositeComponentExtension implements AutowireComponent {
 
     public static final int DEFAULT_WAIT = 1000 * 60;
@@ -235,7 +236,16 @@
     }
 
     public void prepare() {
+        // Connect services and references first so that their wires are 
linked first
+        List<SCAObject> childList = new ArrayList<SCAObject>();
         for (SCAObject child : children.values()) {
+            if(child instanceof Component) {
+                childList.add(child);
+            } else {
+                childList.add(0, child);
+            }
+        }
+        for (SCAObject child : childList) {
             // connect all children
             // TODO for composite wires, should delegate down
             connector.connect(child);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to