You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jm...@apache.org on 2007/02/11 07:55:32 UTC

svn commit: r505856 [2/2] - in /incubator/tuscany/java/sca/kernel: core/src/main/java/org/apache/tuscany/core/bootstrap/ core/src/main/java/org/apache/tuscany/core/builder/ core/src/main/java/org/apache/tuscany/core/component/ core/src/main/java/org/ap...

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/CompositeComponentExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/CompositeComponentExtension.java?view=diff&rev=505856&r1=505855&r2=505856
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/CompositeComponentExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/CompositeComponentExtension.java Sat Feb 10 22:55:31 2007
@@ -21,6 +21,7 @@
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -30,7 +31,6 @@
 
 import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.builder.Connector;
-import org.apache.tuscany.spi.builder.WiringException;
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.Component;
 import org.apache.tuscany.spi.component.ComponentRegistrationException;
@@ -110,6 +110,15 @@
         return children.get(name);
     }
 
+
+    public List<Service> getServices() {
+        return Collections.unmodifiableList(services);
+    }
+
+    public List<Reference> getReferences() {
+        return Collections.unmodifiableList(references);
+    }
+
     public void register(SCAObject child) throws ComponentRegistrationException {
         assert child instanceof Service || child instanceof Reference || child instanceof Component;
         String name;
@@ -272,38 +281,11 @@
     }
 
     public void prepare() throws PrepareException {
-        // Connect services and references first so that their wires are linked first
-        List<SCAObject> childList = new ArrayList<SCAObject>();
-        // connect system artifacts
-        for (SCAObject child : childList) {
-            // connect all children
-            // TODO for composite wires, should delegate down
-            try {
-                connector.connect(child);
-                child.prepare();
-            } catch (WiringException e) {
-                throw new PrepareException("Error preparing composite", getUri().toString(), e);
-            }
+        for (Service service : services) {
+            service.prepare();
         }
-
-        // connect application artifacts
-        childList.clear();
-        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
-            try {
-                connector.connect(child);
-                child.prepare();
-            } catch (WiringException e) {
-                throw new PrepareException("Error preparing composite", getUri().toString(), e);
-            }
+        for (Reference reference : references) {
+            reference.prepare();
         }
     }
 

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java?view=diff&rev=505856&r1=505855&r2=505856
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java Sat Feb 10 22:55:31 2007
@@ -142,16 +142,31 @@
      * superset of those specified by the service. <li>other specified attributes of the two interfaces MUST match,
      * including Scope and Callback interface </ol>
      * <p/>
-     * <p>Please note this test is not symetric: the success of checkCompatibility(A, B) does NOT imply that
+     * <p>Please note this test is not symetric: the success of checkCompatibility(A, B) does NOT imply
      * checkCompatibility(B, A)
      *
      * @param source         The source service contract
      * @param target         The target service contract
      * @param ignoreCallback Indicate the callback should be checked
+     * @param silent         if true, errors will be thrown if the service contracts are not compatible
+     * @return true if the service contracts are compatible
      * @throws IncompatibleServiceContractException
      *          If the source service contract is not compatible with the target one
      */
-    void checkCompatibility(ServiceContract<?> source, ServiceContract<?> target, boolean ignoreCallback)
+    boolean checkCompatibility(ServiceContract<?> source,
+                               ServiceContract<?> target,
+                               boolean ignoreCallback,
+                               boolean silent)
         throws IncompatibleServiceContractException;
+
+    /**
+     * Performs a silent check for service contract compatibility using the algorithm defined by {@link
+     * #checkCompatibility(org.apache.tuscany.spi.model.ServiceContract,org.apache.tuscany.spi.model.ServiceContract,
+     *boolean)}
+     *
+     * @param source The source service contract
+     * @param target The target service contract
+     * @return true if compatible
+     */
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org