You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/12/19 02:38:49 UTC

svn commit: r605380 [1/2] - in /incubator/tuscany/java/sca: modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/ modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ modules/binding-sca-axis2/src/main/java/org...

Author: slaws
Date: Tue Dec 18 17:38:46 2007
New Revision: 605380

URL: http://svn.apache.org/viewvc?rev=605380&view=rev
Log:
Make the domain to node update more reliable. This primarily involves; including the target service name in the binding name and updating the domain wiring algorithm to use this, updating the axis binding so that it can be started and stopped.

Added:
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java
Modified:
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BindingUtil.java
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/DomainWireBuilderImpl.java
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceBindingProvider.java
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestDomain.java
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestNode.java
    incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java
    incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java
    incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java
    incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainAPITestCase.java
    incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java
    incubator/tuscany/java/sca/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingImpl.java
    incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeA/Calculator.composite
    incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeA/META-INF/sca-contribution.xml
    incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeB/Calculator.composite
    incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeB/META-INF/sca-contribution.xml
    incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeC/Calculator.composite
    incubator/tuscany/java/sca/samples/calculator-distributed/src/main/resources/nodeC/META-INF/sca-contribution.xml
    incubator/tuscany/java/sca/samples/calculator-distributed/src/test/java/calculator/DomainInMemoryTestCase.java

Added: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java?rev=605380&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java (added)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java Tue Dec 18 17:38:46 2007
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.assembly.builder;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Service;
+
+/**
+ * A builder that handles the configuration of the components inside a
+ * composite and the wiring of component references to component services.
+ *
+ * @version $Rev: 563358 $ $Date: 2007-08-07 01:26:27 +0100 (Tue, 07 Aug 2007) $
+ */
+public interface DomainBuilder {
+    
+    /**
+     * Wire up the references and service in a domain returning a list
+     * of the composites that have changed
+     * 
+     * @param domainLevelCompsite
+     * @return a list of change composites
+     * @throws CompositeBuilderException
+     */
+    public List<Composite> wireDomain(Composite domainLevelComposite);
+    
+    /**
+     * Locates the referenced service and updates the URI on the identified binding
+     * 
+     * @param domainLevelComposite
+     * @param referenceName
+     * @param bindingClassName
+     * @param URI
+     */
+    public void updateDomainLevelServiceURI(Composite domainLevelComposite, String referenceName, String bindingClassName, String URI);
+    
+    /**
+     * Get the component name out of the reference name that might look like Component/Service
+     * 
+     * @param referenceName
+     * @return
+     */
+    public String getComponentNameFromReference(String referenceName);
+    
+    /**
+     * Get the service name out of the reference name that might look like Component/Service
+     * 
+     * @param referenceName
+     * @return
+     */
+    public String getServiceNameFromReference(String referenceName);
+    
+    /**
+     * Find the service object given a reference name
+     * 
+     * @param composite
+     * @param referenceName
+     * @return
+     */
+    public Service findServiceForReference(Composite composite, String referenceName);
+    
+}

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BindingUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BindingUtil.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BindingUtil.java (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BindingUtil.java Tue Dec 18 17:38:46 2007
@@ -70,7 +70,11 @@
                         
                         //Customise the binding name to make it unique 
                         // regardless of how many bindings or targets there are
-                        cloned.setName(binding.getName() + "#" + serviceBinding.getName());
+                        if ( component != null){
+                            cloned.setName(binding.getName() + "#" + component.getName() + "/" + serviceBinding.getName());
+                        } else {
+                            cloned.setName(binding.getName() + "#" + serviceBinding.getName());
+                        }
                         
                         // Set the binding URI to the URI of the target service
                         // that has been matched
@@ -89,30 +93,7 @@
                         break;
                     } catch (Exception ex) {
                         // do nothing 
-                    }
-/*                    
-                   
-                    Binding cloned = binding;
-                    if (binding instanceof OptimizableBinding) {
-                        // TODO: We need to clone the reference binding
-                        try {
-                            cloned = (Binding)((OptimizableBinding)binding).clone();
-                            OptimizableBinding endpoint = ((OptimizableBinding)cloned);
-                            endpoint.setTargetComponent(component);
-                            endpoint.setTargetComponentService(service);
-                            endpoint.setTargetBinding(serviceBinding);
-                            cloned.setURI(serviceBinding.getURI());
-                        } catch (Exception e) {
-                            // warning("The binding doesn't support clone: " + binding.getClass().getSimpleName(), binding);
-                        }
-                    } else {
-                        if (binding.getURI() == null) {
-                            binding.setURI(serviceBinding.getURI());
-                        }
-                    }
-                    matched.add(cloned);
-                    break;
-*/                    
+                    }                   
                 }
             }
         }

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/DomainWireBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/DomainWireBuilderImpl.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/DomainWireBuilderImpl.java (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/DomainWireBuilderImpl.java Tue Dec 18 17:38:46 2007
@@ -45,20 +45,34 @@
 import org.apache.tuscany.sca.assembly.OptimizableBinding;
 import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.assembly.SCABinding;
+import org.apache.tuscany.sca.assembly.SCABindingFactory;
 import org.apache.tuscany.sca.assembly.Service;
 import org.apache.tuscany.sca.assembly.Wire;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilderMonitor;
+import org.apache.tuscany.sca.assembly.builder.DomainBuilder;
 import org.apache.tuscany.sca.assembly.builder.Problem.Severity;
 import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
 import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.IntentAttachPoint;
 import org.apache.tuscany.sca.policy.IntentAttachPointType;
+import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
 import org.apache.tuscany.sca.policy.PolicySet;
 import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
 import org.apache.tuscany.sca.policy.ProfileIntent;
 import org.apache.tuscany.sca.policy.QualifiedIntent;
 
-public class DomainWireBuilderImpl {
+public class DomainWireBuilderImpl implements DomainBuilder {
+    
+    private CompositeWireBuilderImpl wireBuilder;
+    
+    public DomainWireBuilderImpl(AssemblyFactory assemblyFactory,
+            SCABindingFactory scaBindingFactory,
+            IntentAttachPointTypeFactory  intentAttachPointTypeFactory,
+            InterfaceContractMapper interfaceContractMapper,
+            List<PolicySet> domainPolicySets,
+            CompositeBuilderMonitor monitor) {
+        wireBuilder = new CompositeWireBuilderImpl(assemblyFactory, interfaceContractMapper, domainPolicySets, monitor);
+    }
     
     public String getComponentNameFromReference(String referenceName){
         // Extract the component name
@@ -186,64 +200,20 @@
                     binding.setURI(URI);
                     break;
                 }
-            }
-/*
-            // update any references that refer to this service
-            List<Reference> referenceList = new ArrayList<Reference>();
-            
-            for (Composite composite : domainLevelComposite.getIncludes()){
-                referenceList.addAll(findReferenceForService(composite, referenceName));
-            }
-           
-            for (Reference reference : referenceList){
-                // find if a  bindings that are already resolved against the target
-                Binding binding = null;
-                
-                for (Binding tmpBinding : reference.getBindings()){
-                    if (tmpBinding.getClass().getName().equals(bindingClassName) &&
-                        (tmpBinding.getName().equals(referenceName) || 
-                                tmpBinding.getName().equals(componentName))){
-                        binding = tmpBinding;
-                    }
-                }
-                
-                if (binding == null) {
-                    // find the named target and if it's not already resolved resolve it  
-                    for (ComponentService targetService : reference.getTargets()){
-                        if ( (targetService.getName().equals(referenceName) || targetService.getName().equals(componentName) ) &&
-                             targetService.isUnresolved()){
-                            
-                            List<Binding> source = targetService.getBindings();
-                            List<Binding> target = service.getBindings();
-                            
-                            // Resolve the binding that will be used
-                            // TODO - this cast to ComponentReference should not be here as the service
-                            //        could be a composite level service
-                            binding = BindingUtil.matchBinding(null, (ComponentService)service, source, target);
-                            
-                            if ( binding != null){
-                                // put the selected binding into the reference 
-                                Binding clonedBinding = binding;//.clone();
-                                reference.getBindings().remove(binding);
-                                reference.getBindings().add(clonedBinding);
-                            }
-                        }
-                    }
-                }
-                
-                if ( binding != null){
-                    binding.setURI(URI);
-                    binding.setName(referenceName);
-                }   
-            }
- */            
+            }        
         }   
     }
 
     public List<Composite> wireDomain(Composite domainLevelComposite){
         List<Composite> changedComposites = new ArrayList<Composite>();
         
-        // process included composites
+        // process wires
+        
+        // autowire
+        
+        // wire by impl?
+        
+        // process all wired references
         for(Composite composite : domainLevelComposite.getIncludes()) {
             boolean compositeChanged = false;
             for(Component component : composite.getComponents()){
@@ -251,8 +221,30 @@
                     for (ComponentService targetService : reference.getTargets()){
                         String targetName = targetService.getName();
                         String componentName = getComponentNameFromReference(targetName);
+                        String serviceName = getServiceNameFromReference(targetName);
+                        
+                        Service service = null;
+                        Component serviceComponent = null;
                         
-                        Service service = findDomainLevelService(domainLevelComposite, targetName);
+                        // find the real target service in the domain
+                        for(Composite tmpComposite : domainLevelComposite.getIncludes()) {
+                            for (Component tmpComponent: tmpComposite.getComponents()) {
+                                if (tmpComponent.getName().equals(componentName)){
+                                    serviceComponent = tmpComponent;
+                                    if (tmpComponent.getServices().size() > 1) {
+                                        for (Service tmpService: tmpComponent.getServices()) {
+                                            if (tmpService.getName().equals(serviceName)){
+                                                service = tmpService; 
+                                                break;
+                                            }
+                                        }
+                                    } else {
+                                        service = tmpComponent.getServices().get(0);
+                                        break;
+                                    }
+                                }
+                            }
+                        }
                         
                         if ( targetService.isUnresolved()){
                             
@@ -262,16 +254,18 @@
                                 
                                 for (Binding tmpBinding : reference.getBindings()){
                                     if ((tmpBinding.getName() != null) &&
-                                        (tmpBinding.getName().equals(targetName) || 
-                                         tmpBinding.getName().equals(componentName))){
+                                        (tmpBinding.getName().startsWith(reference.getName() + "#" + targetName))){
                                         binding = tmpBinding;
                                     }
                                 }
 
                                 // Resolve the binding that should be used for this target
+                                // TODO - hang onto the old bindings at the domain level, i.e. 
+                                //        don't rely on the target objects as we still need the
+                                //        bindings if we are going to do autowiring 
                                 List<Binding> source = targetService.getBindings();
                                 List<Binding> target = service.getBindings();
-                                Binding newBinding = BindingUtil.matchBinding(null, (ComponentService)service, source, target);
+                                Binding newBinding = BindingUtil.matchBinding(serviceComponent, (ComponentService)service, source, target);
                                 
                                 // update the existing binding to the new binding if required
                                 if (newBinding != null) {
@@ -284,9 +278,7 @@
                                         }
                                     } else {
                                         // this is a newly configured binding so add it
-                                        Binding clonedBinding = newBinding;//.clone();
-                                        clonedBinding.setName(targetName);
-                                        reference.getBindings().add(clonedBinding);
+                                        reference.getBindings().add(newBinding);
                                         compositeChanged = true;
                                     }
                                 }
@@ -294,29 +286,18 @@
                                 // Do nothing - the target service hasn't been contributed yet
                             }
                         } else {
-                            // this is a wired reference within a composite. check that the 
-                            // reference and service binding uris match
-                            
-                            // TODO - If we had the name of the target service stored on the 
-                            //        binding we could go straight to it
-                            // Resolve the binding that should be used for this target
-                            List<Binding> source = service.getBindings();
-                            List<Binding> target = reference.getBindings();
-                            Binding newBinding = BindingUtil.matchBinding(null, (ComponentService)service, source, target);
-                            
-                            if (newBinding instanceof SCABinding){
-                                // do nothing as it will already be sorted
-                            } else {
-                                // find this binding in the reference and copy the URL
-                                for (Binding binding : reference.getBindings()){
-                                    if ((binding.getClass() == newBinding.getClass()) && 
-                                        (!binding.getURI().equals(newBinding.getURI()))){
-                                        binding.setURI(newBinding.getURI());
-                                        compositeChanged = true;
+                            // find the reference binding with the right name 
+                            for (Binding refBinding : reference.getBindings()){
+                                if ((refBinding.getName() != null) &&
+                                    (refBinding.getName().startsWith(reference.getName() + "#" + targetName))){
+                                    // find the matching service binding
+                                    for (Binding serviceBinding : service.getBindings()){
+                                        if (refBinding.getClass() == serviceBinding.getClass()){
+                                            refBinding.setURI(serviceBinding.getURI());
+                                        }
                                     }
-                                }
+                                }  
                             }
-
                         }
                     }
                 }
@@ -325,14 +306,7 @@
             if (compositeChanged) {
                 changedComposites.add(composite);
             }
-        }
-        
-        // process wires
-        
-        // autowire
-        
-        // wire by impl?
-        
+        }       
         
         return changedComposites;
     }

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceBindingProvider.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAServiceBindingProvider.java Tue Dec 18 17:38:46 2007
@@ -214,6 +214,12 @@
     }
 
     public void stop() {
+        if (!started) {
+            return;
+        } else {
+            started = false;
+        }
+        
         axisProvider.stop();
     }
 

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java Tue Dec 18 17:38:46 2007
@@ -40,6 +40,7 @@
             // create and start domains
             nodeA = createNode("http://localhost:8100/nodeG");
             nodeB = createNode("http://localhost:8200/nodeH");
+            testDomain.start();
             nodeA.start();
             nodeB.start();
 

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java Tue Dec 18 17:38:46 2007
@@ -38,6 +38,7 @@
             // create and start domains
             nodeA = createNode("http://localhost:8100/nodeE");
             nodeB = createNode("http://localhost:8200/nodeF");
+            testDomain.start();
             nodeA.start();
             nodeB.start();
 

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java Tue Dec 18 17:38:46 2007
@@ -35,6 +35,7 @@
             // create and start domains
             nodeA = createNode("http://localhost:8100/nodeC");
             nodeB = createNode("http://localhost:8200/nodeD");
+            testDomain.start();
             nodeA.start();
             nodeB.start();
 

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java Tue Dec 18 17:38:46 2007
@@ -38,6 +38,7 @@
             // create and start domains
             nodeA = createNode("http://localhost:8100/nodeA");
             nodeB = createNode("http://localhost:8200/nodeB");
+            testDomain.start();
             nodeA.start();
             nodeB.start();
 

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestDomain.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestDomain.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestDomain.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestDomain.java Tue Dec 18 17:38:46 2007
@@ -26,11 +26,15 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.domain.DomainException;
 import org.apache.tuscany.sca.domain.SCADomain;
 import org.apache.tuscany.sca.domain.SCADomainEventService;
 import org.apache.tuscany.sca.domain.SCADomainSPI;
 import org.apache.tuscany.sca.domain.model.DomainModel;
+import org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime;
 import org.osoa.sca.CallableReference;
 import org.osoa.sca.ServiceReference;
 
@@ -43,13 +47,30 @@
 public class TestDomain implements SCADomain, SCADomainEventService {
     
     private String domainURI;
+    
+    private ReallySmallRuntime domainRuntime;
+    private Composite domainComposite = null;
+    
+    private ClassLoader cl = TestDomain.class.getClassLoader();
         
     
     public TestDomain(String domainURI) {
-        this.domainURI = domainURI; 
+        try {
+            this.domainURI = domainURI; 
+            domainRuntime = new ReallySmallRuntime(cl);
+            domainRuntime.start();
+            
+            AssemblyFactory assemblyFactory = domainRuntime.getAssemblyFactory();
+            domainComposite = assemblyFactory.createComposite();
+            domainComposite.setName(new QName(Constants.SCA10_NS, "domain"));
+            domainComposite.setURI(domainURI);
+        } catch (Exception ex) {
+            System.out.println(ex.toString());
+        }
     }
     
     public void start() throws DomainException {
+        domainRuntime.getDomainBuilder().wireDomain(domainComposite);
     }    
     
     public void stop() throws DomainException {
@@ -63,85 +84,12 @@
     }
      
     
-    List<ServiceEndpoint> serviceEndpoints = new ArrayList<ServiceEndpoint>();
-    
-    public class ServiceEndpoint {
-        private String domainUri;
-        private String nodeUri;
-        private String serviceName;
-        private String bindingName;
-        private String url;
-        
-        public ServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName, String URL){
-            this.domainUri = domainUri;
-            this.nodeUri = nodeUri;
-            this.serviceName = serviceName;
-            this.bindingName = bindingName;
-            this.url = URL;
-        }
-        
-        public boolean match(String domainUri, String serviceName, String bindingName) {
-            // trap the case where the we are trying to map
-            //   ComponentName/Service name with a registered ComponentName             - this is OK
-            //   ComponentName              with a registered ComponentName/ServiceName - this should fail
-            
-            boolean serviceNameMatch = false;
-            
-            if (this.serviceName.equals(serviceName)) {
-                serviceNameMatch = true;
-            } else {
-                int s = serviceName.indexOf('/');
-                if ((s != -1) &&
-                    (this.serviceName.equals(serviceName.substring(0, s)))){
-                    serviceNameMatch = true;
-                }
-            }
-            
-            return ((this.domainUri.equals(domainUri)) &&
-                    (serviceNameMatch) &&
-                    (this.bindingName.equals(bindingName)));
-        }
-        
-        public String getUrl() {
-            return url;
-        }     
-        
-        @Override
-        public String toString (){
-            return "[" +
-                   domainUri + " " +
-                   nodeUri + " " +
-                   serviceName + " " +
-                   bindingName + " " + 
-                   url +
-                   "]";
-        }
-    }
-    
     public DomainModel getDomainModel() {
         return null;
     }
      
-    /**
-     * Accepts information about a service endpoint and holds onto it
-     * 
-     * @param domainUri the string uri for the distributed domain
-     * @param nodeUri the string uri for the current node
-     * @param serviceName the name of the service that is exposed and the provided endpoint
-     * @param bindingName the remote binding that is providing the endpoint
-     * @param url the enpoint url
-     */
+
     public void registerServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName, String URL){
-        // if the service name ends in a "/" remove it
-        String modifiedServiceName = null;
-        if ( serviceName.endsWith("/") ) {
-            modifiedServiceName = serviceName.substring(0, serviceName.length() - 1);
-        } else {
-            modifiedServiceName = serviceName;
-        }        
-        ServiceEndpoint serviceEndpoint = new ServiceEndpoint (domainUri, nodeUri, modifiedServiceName, bindingName, URL);
-        serviceEndpoints.add(serviceEndpoint);
-        System.err.println("Registering service: " + serviceEndpoint.toString());
     }
     
     public void unregisterServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName){  
@@ -155,30 +103,9 @@
         
     }
     
-    /**
-     * Locates information about a service endpoint 
-     * 
-     * @param domainUri the string uri for the distributed domain
-     * @param serviceName the name of the service that is exposed and the provided endpoint
-     * @param bindingName the remote binding that we want to find an endpoint for
-     * @return url the endpoint url
-     */
+
     public String findServiceEndpoint(String domainUri, String serviceName, String bindingName){
-        System.err.println("Finding service: [" + 
-                           domainUri + " " +
-                           serviceName + " " +
-                           bindingName +
-                           "]");
-        
-        String url = null;
-        
-        for(ServiceEndpoint serviceEndpoint : serviceEndpoints){
-            if ( serviceEndpoint.match(domainUri, serviceName, bindingName)){
-                url = serviceEndpoint.getUrl();
-                System.err.println("Matching service url: " + url); 
-            }
-        }
-        return url;
+        return null;
     }
     
     public String findServiceNode(String domainUri, String serviceName, String bindingName){
@@ -239,6 +166,7 @@
     }
     
     public void startComposite(QName compositeName) throws DomainException {
+       
     }
 
     public void stopComposite(QName compositeName) throws DomainException {             
@@ -256,5 +184,7 @@
         return null;
     } 
     
-    
+    public void addComposite(Composite composite){
+        domainComposite.getIncludes().add(composite);
+    }
 }

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestNode.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestNode.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestNode.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/TestNode.java Tue Dec 18 17:38:46 2007
@@ -140,7 +140,10 @@
             nodeComposite.getIncludes().add(appComposite);
             nodeRuntime.getCompositeBuilder().build(appComposite);
             nodeRuntime.getCompositeActivator().activate(appComposite);
-            registerRemoteServices(appComposite);
+            
+            ((TestDomain)domain).addComposite(appComposite);
+            
+            //registerRemoteServices(appComposite);
 
         } catch (Exception ex) {
             System.err.println("Exception when creating domain " + ex.getMessage());
@@ -149,137 +152,11 @@
         }         
     }
     
-    private void registerRemoteServices(Composite composite){
-        // Loop through all service binding URIs registering them with the domain 
-        for (Service service: composite.getServices()) {
-            for (Binding binding: service.getBindings()) {
-                String uri = binding.getURI();
-                if (uri != null) {
-                    try {
-                        ((SCADomainEventService)scaDomain).registerServiceEndpoint(domainURI, 
-                                                                                   nodeName, 
-                                                                                   service.getName(), 
-                                                                                   binding.getClass().getName(), 
-                                                                                   uri);
-                    } catch(Exception ex) {
-                        logger.log(Level.WARNING, 
-                                   "Unable to  register service: "  +
-                                   domainURI + " " +
-                                   nodeName + " " +
-                                   service.getName()+ " " +
-                                   binding.getClass().getName() + " " +
-                                   uri);
-                    }
-                }
-            }
-        }
-        
-        for (Component component: composite.getComponents()) {
-            for (ComponentService service: component.getServices()) {
-                if (service.getInterfaceContract().getInterface().isRemotable()) {
-                    for (Binding binding: service.getBindings()) {
-                        String uriString = binding.getURI();
-                        if (uriString != null) {
-                             
-                            String serviceName = component.getURI();
-                            
-                            if (component.getServices().size() > 1){
-                                serviceName = serviceName + '/' + binding.getName();
-                            }
-                                
-                            try {
-                                URI uri = new URI(uriString);
-                                ((SCADomainEventService)scaDomain).registerServiceEndpoint(domainURI, 
-                                                                                           nodeName, 
-                                                                                           serviceName, 
-                                                                                           binding.getClass().getName(), 
-                                                                                           uriString);
-                            } catch(Exception ex) {
-                                logger.log(Level.WARNING, 
-                                           "Unable to  register service: "  +
-                                           domainURI + " " +
-                                           nodeName + " " +
-                                           service.getName()+ " " +
-                                           binding.getClass().getName() + " " +
-                                           uriString);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }  
-    
-    private void resolveRemoteReferences(Composite composite){
-        // Loop through all reference binding URIs. Any that are not resolved
-        // should be looked up in the domain
-        for (Reference reference: composite.getReferences()) {
-            for (Binding binding: reference.getBindings()) {
-                if (binding.isUnresolved()) {
-                    // find the right endpoint for this reference/binding. This relies on looking
-                    // up every binding URI. If a response is returned then it's set back into the
-                    // binding uri
-                    String uri = "";
-                    try {
-                        uri = ((SCADomainEventService)scaDomain).findServiceEndpoint(domainURI, 
-                                                                                     binding.getURI(), 
-                                                                                     binding.getClass().getName());
-                    } catch(Exception ex) {
-                        logger.log(Level.WARNING, 
-                                   "Unable to  find service: "  +
-                                   domainURI + " " +
-                                   nodeName + " " +
-                                   binding.getURI() + " " +
-                                   binding.getClass().getName() + " " +
-                                   uri);
-                    }
-                     
-                    if (uri.equals("") == false){
-                        binding.setURI(uri);
-                    }
-                }
-            }
-        }
-        
-        for (Component component: composite.getComponents()) {
-            for (ComponentReference reference: component.getReferences()) {
-                for (Binding binding: reference.getBindings()) {
-                    if (binding.isUnresolved()) {
-                        // find the right endpoint for this reference/binding. This relies on looking
-                        // up every binding URI. If a response is returned then it's set back into the
-                        // binding uri
-                    
-                        String referenceName = binding.getURI();
-                                            
-                        String uri = "";
-                        try {
-                            uri = ((SCADomainEventService)scaDomain).findServiceEndpoint(domainURI, 
-                                                                                         referenceName, 
-                                                                                         binding.getClass().getName());
-                        } catch(Exception ex) {
-                            logger.log(Level.WARNING, 
-                                       "Unable to  find service: "  +
-                                       domainURI + " " +
-                                       nodeName + " " +
-                                       binding.getURI() + " " +
-                                       binding.getClass().getName() + " " +
-                                       uri);
-                        }
-                         
-                        if ((uri != null) && (uri.equals("") == false)){
-                            binding.setURI(uri);
-                        }
-                    }
-                }
-            }
-        }        
-    }    
-    
     public void start()
         throws NodeException {
         
         try {
-            resolveRemoteReferences(appComposite);
+
             nodeRuntime.getCompositeActivator().start(appComposite);
         } catch (Exception ex) {
             System.err.println("Exception when creating domain " + ex.getMessage());
@@ -435,3 +312,4 @@
     public void startContribution(String contributionURI) throws NodeException {
     }     
 }
+

Modified: incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java Tue Dec 18 17:38:46 2007
@@ -155,79 +155,12 @@
                 targetIsRemote = false;
             }
         }
+        return targetIsRemote;
+    }
+    
+    private ReferenceBindingProvider getDistributedProvider(){
         
-/*
-                     // look in the domain for the endpoint. This is the exception rather than the rule but we may
-                     // get to this point if this binding belongs to a reference that has been retrieved from the domain
-                     // and the reference was given a target that is remote or that didn't exist when the reference was requested
-                     String serviceURL = null;
-                     
-                     SCADomainEventService domainProxy = (SCADomainEventService)nodeFactory.getNode().getDomain();
- 
-                     try {
-                         serviceURL =
-                             domainProxy.findServiceEndpoint(nodeFactory.getNode().getDomain().getURI(),
-                                                             binding.getURI(),
-                                                             binding.getClass().getName());
-                     } catch (Exception ex) {
-                         logger.log(Level.WARNING, 
-                                    "Unable to contact domain to find service. Service: "  +
-                                    nodeFactory.getNode().getDomain().getURI() + " " +
-                                    nodeFactory.getNode().getURI() + " " +
-                                    binding.getURI() + " " +
-                                    SCABinding.class.getName());                    
-                         
-                     }
-                     
-                     if ((serviceURL == null) || serviceURL.equals("")) {
-                         throw new IllegalStateException("Can't resolve : " + component
-                                 .getName()
-                                 + " and reference: "
-                                 + reference.getName()); 
-                     } else {
-                         targetIsRemote = true;
-                         binding.setURI(serviceURL);
-                     }  
- 
-*/
-
-/*        
-        else {
-            // if no target is found then this could be a completely dynamic
-            // reference, e.g. a callback, so check the domain to see if the service is available
-            // at this node. The binding uri might be null here if the dynamic reference hasn't been
-            // fully configured yet. It won't have all of the information until invocation time
-            if ( (nodeFactory != null) && (nodeFactory.getNode() != null) && (binding.getURI() != null)) {
-                SCADomainEventService domainProxy = (SCADomainEventService)nodeFactory.getNode().getDomain();
-
-                String serviceUrl = null;
-                
-                try {
-                    serviceUrl =
-                        domainProxy.findServiceEndpoint(nodeFactory.getNode().getDomain().getURI(),
-                                                             binding.getURI(),
-                                                             binding.getClass().getName());
-                } catch (Exception ex) {
-                    logger.log(Level.WARNING, 
-                            "Unable to  find service service: "  +
-                            nodeFactory.getNode().getDomain().getURI() + " " +
-                            nodeFactory.getNode().getURI() + " " +
-                            binding.getURI() + " " +
-                            SCABinding.class.getName());                    
-                    
-                }
-                
-                if ((serviceUrl == null) || serviceUrl.equals("")) {
-                    targetIsRemote = false;
-                } else {
-                    targetIsRemote = true;
-                }
-
-            }
-        }
-
-        // if we think the target is remote check that everything is configured correctly
-        if (targetIsRemote) {
+        if (isTargetRemote()){
             // initialize the remote provider if it hasn't been done already
             if (distributedProvider == null) {
                 if (!reference.getInterfaceContract().getInterface().isRemotable()) {
@@ -236,68 +169,32 @@
                         + " and reference: "
                         + reference.getName());
                 }
-
+    
                 if (distributedProviderFactory == null) {
                     throw new IllegalStateException("No distributed SCA binding available for component: " + component
                         .getName()
                         + " and reference: "
                         + reference.getName());
                 }
-
+    
                 if (nodeFactory.getNode() == null) {
                     throw new IllegalStateException("No distributed domain available for component: " + component
                         .getName()
                         + " and reference: "
                         + reference.getName());
                 }
-
+    
                 // create the remote provider
                 DistributedSCABinding distributedBinding = new DistributedSCABindingImpl();
                 distributedBinding.setSCABinging(binding);
-
+    
                 distributedProvider = distributedProviderFactory
                         .createReferenceBindingProvider(component, reference, distributedBinding);
             }
-        }
-*/
-        return targetIsRemote;
-    }
-    
-    private ReferenceBindingProvider getDistributedProvider(){
-
-        // initialize the remote provider if it hasn't been done already
-        if (distributedProvider == null) {
-            if (!reference.getInterfaceContract().getInterface().isRemotable()) {
-                throw new IllegalStateException("Reference interface not remoteable for component: " + component
-                    .getName()
-                    + " and reference: "
-                    + reference.getName());
-            }
-
-            if (distributedProviderFactory == null) {
-                throw new IllegalStateException("No distributed SCA binding available for component: " + component
-                    .getName()
-                    + " and reference: "
-                    + reference.getName());
-            }
-
-            if (nodeFactory.getNode() == null) {
-                throw new IllegalStateException("No distributed domain available for component: " + component
-                    .getName()
-                    + " and reference: "
-                    + reference.getName());
-            }
-
-            // create the remote provider
-            DistributedSCABinding distributedBinding = new DistributedSCABindingImpl();
-            distributedBinding.setSCABinging(binding);
-
-            distributedProvider = distributedProviderFactory
-                    .createReferenceBindingProvider(component, reference, distributedBinding);
+        
         }
         
         return distributedProvider;
-        
     }
 
     public InterfaceContract getBindingInterfaceContract() {
@@ -365,13 +262,19 @@
             started = true;
         }
 
-        if (distributedProvider != null) {
+        if (getDistributedProvider() != null) {
             distributedProvider.start();
         }
     }
 
     public void stop() {
-        if (distributedProvider != null) {
+        if (!started) {
+            return;
+        } else {
+            started = false;
+        }
+        
+        if (getDistributedProvider() != null) {
             distributedProvider.stop();
         }
     }

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java Tue Dec 18 17:38:46 2007
@@ -46,7 +46,7 @@
  */
 public class Axis2BindingInvoker implements Invoker {
 
-    private ServiceClient serviceClient;
+    private Axis2ServiceClient serviceClient;
     private QName wsdlOperationName;
     private Options options;
     private SOAPFactory soapFactory;
@@ -60,7 +60,7 @@
     public static final QName CALLBACK_ID_REFPARM_QN = new QName(Constants.SCA10_TUSCANY_NS, "CallbackID");
     public static final QName CONVERSATION_ID_REFPARM_QN = new QName(Constants.SCA10_TUSCANY_NS, "ConversationID");
 
-    public Axis2BindingInvoker(ServiceClient serviceClient,
+    public Axis2BindingInvoker(Axis2ServiceClient serviceClient,
                                QName wsdlOperationName,
                                Options options,
                                SOAPFactory soapFactory) {
@@ -134,7 +134,7 @@
         requestMC.setEnvelope(env);
 
         // Axis2 operationClients can not be shared so create a new one for each request
-        OperationClient operationClient = serviceClient.createClient(wsdlOperationName);
+        OperationClient operationClient = serviceClient.getServiceClient().createClient(wsdlOperationName);
         operationClient.setOptions(options);
 
         ReferenceParameters parameters = msg.getTo().getReferenceParameters();

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2OneWayBindingInvoker.java Tue Dec 18 17:38:46 2007
@@ -32,7 +32,7 @@
 
 public class Axis2OneWayBindingInvoker extends Axis2BindingInvoker {
 
-    public Axis2OneWayBindingInvoker(ServiceClient serviceClient,
+    public Axis2OneWayBindingInvoker(Axis2ServiceClient serviceClient,
                                      QName wsdlOperationName,
                                      Options options,
                                      SOAPFactory soapFactory) {

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java Tue Dec 18 17:38:46 2007
@@ -86,11 +86,17 @@
                               MessageFactory messageFactory) {
 
         this.wsBinding = wsBinding;
-        this.serviceClient = createServiceClient();
     }
 
     protected void start() {
+        if (serviceClient == null){
+            this.serviceClient = createServiceClient();
+        }
     }
+    
+    public ServiceClient getServiceClient() {
+        return serviceClient;
+    }    
 
     /**
      * Create an Axis2 ServiceClient
@@ -254,13 +260,17 @@
     }
 
     protected void stop() {
-        // close all connections that we have initiated, so that the jetty server
-        // can be restarted without seeing ConnectExceptions
-        HttpClient httpClient =
-            (HttpClient)serviceClient.getServiceContext().getConfigurationContext()
-                .getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
-        if (httpClient != null)
-            ((MultiThreadedHttpConnectionManager)httpClient.getHttpConnectionManager()).shutdown();
+        if (serviceClient != null){
+            // close all connections that we have initiated, so that the jetty server
+            // can be restarted without seeing ConnectExceptions
+            HttpClient httpClient =
+                (HttpClient)serviceClient.getServiceContext().getConfigurationContext()
+                    .getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
+            if (httpClient != null)
+                ((MultiThreadedHttpConnectionManager)httpClient.getHttpConnectionManager()).shutdown();
+            
+            serviceClient = null;
+        }
     }
 
     /**
@@ -288,9 +298,9 @@
 
         Axis2BindingInvoker invoker;
         if (operation.isNonBlocking()) {
-            invoker = new Axis2OneWayBindingInvoker(serviceClient, wsdlOperationQName, options, soapFactory);
+            invoker = new Axis2OneWayBindingInvoker(this, wsdlOperationQName, options, soapFactory);
         } else {
-            invoker = new Axis2BindingInvoker(serviceClient, wsdlOperationQName, options, soapFactory);
+            invoker = new Axis2BindingInvoker(this, wsdlOperationQName, options, soapFactory);
         }
         return invoker;
     }

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java Tue Dec 18 17:38:46 2007
@@ -24,6 +24,7 @@
 import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.security.PrivilegedAction;
 import java.util.Iterator;
@@ -289,9 +290,20 @@
             jmsSender.stop();
 
         try {
-            configContext.getAxisConfiguration().removeService(wsBinding.getURI());
-        }
-        catch (AxisFault e) {
+            // get the path to the service
+            URI uriPath = new URI(wsBinding.getURI());
+            String stringURIPath = uriPath.getPath();
+            
+            // remove any "/" from the start of the path
+            if (stringURIPath.startsWith("/")) {
+                stringURIPath = stringURIPath.substring(1, stringURIPath.length());
+            } 
+            
+            // remove it from the Axis context
+            configContext.getAxisConfiguration().removeService(stringURIPath);
+        } catch (URISyntaxException e) {
+            throw new RuntimeException(e);
+        } catch (AxisFault e) {
             throw new RuntimeException(e);
         }
     }

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java Tue Dec 18 17:38:46 2007
@@ -191,8 +191,8 @@
      * @param reference
      */
     private void resolveTargets(RuntimeComponentReference reference) {
-        // Support for distributed domain follows
-
+        
+/* Not used now that domain wires are created using the domain wire builder
         // go over any targets that have not been resolved yet (as they are running on other nodes)
         // and try an resolve them remotely
         // TODO - this should work for any kind of wired binding but the only wireable binding 
@@ -235,7 +235,7 @@
                             // warning("The binding doesn't support clone: " + binding.getClass().getSimpleName(), binding);
                         }
                     } else {
-                        /*
+                        
                          * Just leave the binding as it. It will be filled in later 
                          * when the node resolves the targets
                         throw new IllegalStateException(
@@ -243,11 +243,12 @@
                                                             .getName()
                                                             + " and target: "
                                                             + service.getName());
-                        */
+                     
                     }
                 }
             }
         }
+*/        
     }
 
     /**

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java Tue Dec 18 17:38:46 2007
@@ -149,7 +149,9 @@
             if (msgContext != null) {
                 msgContext.getTo().getReferenceParameters().setConversationID(contextId);
             }
-        }
+        }    
+        
+        contextId = contextId;
 
         InstanceLifeCycleWrapper anInstanceWrapper = this.instanceLifecycleCollection.get(contextId);
 
@@ -163,8 +165,9 @@
         // If an existing instance is found return it only if its not expired and update its 
         // last referenced time. 
         else {
-            if (anInstanceWrapper.isExpired())
+            if (anInstanceWrapper.isExpired()) {               
                 throw new ConversationEndedException();
+            }
             anInstanceWrapper.updateLastReferencedTime();
         }
 
@@ -188,6 +191,8 @@
      *                and reset when the component instance is removed
      */
     public void addWrapperReference(Object existingContextId, Object contextId) throws TargetResolutionException {
+       
+        
         // get the instance wrapper via the existing id
         InstanceLifeCycleWrapper existingInstanceWrapper = this.instanceLifecycleCollection.get(existingContextId);
         InstanceLifeCycleWrapper newInstanceWrapper = this.instanceLifecycleCollection.get(contextId);

Modified: incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java (original)
+++ incubator/tuscany/java/sca/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java Tue Dec 18 17:38:46 2007
@@ -42,6 +42,7 @@
 import org.apache.tuscany.sca.assembly.SCABinding;
 import org.apache.tuscany.sca.assembly.SCABindingFactory;
 import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.builder.DomainBuilder;
 import org.apache.tuscany.sca.assembly.builder.impl.DomainWireBuilderImpl;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.contribution.Contribution;
@@ -108,7 +109,7 @@
     protected Composite domainComposite;
     
     // the logic for wiring up references and services at the domain level
-    protected DomainWireBuilderImpl domainWireBuilder = new DomainWireBuilderImpl();
+    protected DomainBuilder domainBuilder;
     
     // Used to pipe dummy node information into the domain management runtime
     // primarily so that the sca binding can resolve endpoints. 
@@ -156,6 +157,9 @@
             domainManagementRuntime = new ReallySmallRuntime(domainClassLoader);
             domainManagementRuntime.start();
             
+            // get the domain builder
+            domainBuilder = domainManagementRuntime.getDomainBuilder();            
+            
             // Configure the default server port and path
             int port = URI.create(domainModel.getDomainURI()).getPort();
             String path = URI.create(domainModel.getDomainURI()).getPath();
@@ -245,7 +249,7 @@
     }          
     
     private void notifyDomainChange() throws DomainException {
-        List<Composite> changedComposites = domainWireBuilder.wireDomain(domainComposite);
+        List<Composite> changedComposites = domainBuilder.wireDomain(domainComposite);
         
         // notify nodes that have composites that the composites have changed
         for (Composite composite : changedComposites){
@@ -544,8 +548,6 @@
                             domainModel.getDeployedComposites().put(compositeQName, compositeModel);
                             domainModel.getDomainLevelComposite().getIncludes().add(compositeModel.getComposite());
                         }
-                        
-                        // TODO - resolve and unresolved references
                     }
                 }   
             }
@@ -574,10 +576,10 @@
         } 
         
         // TODO - only interested if multiplicity is <= 1
-        componentName = domainWireBuilder.getComponentNameFromReference(targetServiceName);
-        serviceName = domainWireBuilder.getServiceNameFromReference(targetServiceName);
+        componentName = domainBuilder.getComponentNameFromReference(targetServiceName);
+        serviceName = domainBuilder.getServiceNameFromReference(targetServiceName);
         
-        domainWireBuilder.updateDomainLevelServiceURI(domainComposite, targetServiceName, bindingClassName, URL);        
+        domainBuilder.updateDomainLevelServiceURI(domainComposite, targetServiceName, bindingClassName, URL);        
         
         // find the node with the service
         NodeModel node = domainModel.getNodes().get(nodeURI);     
@@ -609,10 +611,6 @@
                                       "that isn't registered");
         }
 
-        // TODO - create and even list for this to separate
-        //        the incoming call from the node notifications
-        //notifyServiceChange(targetServiceName, bindingClassName);
-        //notifyDomainChange();
     }    
      
     public void unregisterServiceEndpoint(String domainURI, String nodeURI, String serviceName, String bindingClassName) throws DomainException{
@@ -628,9 +626,7 @@
         node.getServices().remove(shortServiceName + bindingClassName);
         
         logger.log(Level.FINE, "Removed service: " +  serviceName );   
-        
-        //notifyServiceChange(serviceName, bindingClassName);
-        //notifyDomainChange();
+
     }
        
     public String findServiceEndpoint(String domainURI, String serviceName, String bindingName) throws DomainException{
@@ -670,7 +666,7 @@
         for (NodeModel node : domainModel.getNodes().values()){
             Service service = null;
             for (CompositeModel compositeModel : node.getDeployedComposites().values()){
-                service = domainWireBuilder.findServiceForReference(compositeModel.getComposite(), serviceName);
+                service = domainBuilder.findServiceForReference(compositeModel.getComposite(), serviceName);
                 if (service != null) {
                     nodeURI = node.getNodeURI();
                     break;
@@ -868,6 +864,7 @@
                         node.getContributions().clear();
                         node.getDeployedComposites().clear();
                         node.setLifecycleState(LifecyleState.AVAILABLE);
+                        node.getServices().clear();
                     } catch (Exception ex) {
                         // TODO - collate errors and report
                         ex.printStackTrace();

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java (original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java Tue Dec 18 17:38:46 2007
@@ -30,6 +30,7 @@
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.SCABindingFactory;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.sca.assembly.builder.DomainBuilder;
 import org.apache.tuscany.sca.context.ContextFactoryExtensionPoint;
 import org.apache.tuscany.sca.context.DefaultContextFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
@@ -71,6 +72,7 @@
     private ContributionService contributionService;
     private CompositeActivator compositeActivator;
     private CompositeBuilder compositeBuilder;
+    private DomainBuilder domainBuilder;    
     private WorkScheduler workScheduler;
     private ScopeRegistry scopeRegistry;
     private ProxyFactory proxyFactory;
@@ -160,6 +162,14 @@
                                                                             intentAttachPointTypeFactory,
                                                                             mapper,
                                                                             domainPolicySets);
+
+        //Create a domain builder
+        domainBuilder = ReallySmallRuntimeBuilder.createDomainBuilder(assemblyFactory,
+                                                                      scaBindingFactory,
+                                                                      intentAttachPointTypeFactory,
+                                                                      mapper,
+                                                                      domainPolicySets);
+        
         if (logger.isLoggable(Level.FINE)) {
             long end = System.currentTimeMillis();
             logger.fine("The tuscany runtime is started in " + (end - start) + " ms.");
@@ -223,6 +233,10 @@
         return assemblyFactory;
     }
 
+    public DomainBuilder getDomainBuilder() {
+        return domainBuilder;
+    }
+    
     @SuppressWarnings("unchecked")
     private List<ModuleActivator> loadModules(ExtensionPointRegistry registry) throws ActivationException {
 

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java (original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java Tue Dec 18 17:38:46 2007
@@ -28,7 +28,9 @@
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.SCABindingFactory;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.sca.assembly.builder.DomainBuilder;
 import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
+import org.apache.tuscany.sca.assembly.builder.impl.DomainWireBuilderImpl;
 import org.apache.tuscany.sca.assembly.xml.ComponentTypeDocumentProcessor;
 import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor;
 import org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor;
@@ -153,6 +155,14 @@
                                                           List<PolicySet> domainPolicySets) {
         return new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, intentAttachPointTypeFactory, interfaceContractMapper, domainPolicySets, null);
     }
+    
+    public static DomainBuilder createDomainBuilder(AssemblyFactory assemblyFactory,
+            SCABindingFactory scaBindingFactory,
+            IntentAttachPointTypeFactory intentAttachPointTypeFactory,
+            InterfaceContractMapper interfaceContractMapper, 
+            List<PolicySet> domainPolicySets) {
+        return new DomainWireBuilderImpl(assemblyFactory, scaBindingFactory, intentAttachPointTypeFactory, interfaceContractMapper, domainPolicySets, null);
+    }     
 
     /**
      * Create the contribution service used by this domain.

Modified: incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/SCANodeImpl.java Tue Dec 18 17:38:46 2007
@@ -47,6 +47,7 @@
 import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.assembly.Service;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
+import org.apache.tuscany.sca.assembly.builder.DomainBuilder;
 import org.apache.tuscany.sca.assembly.builder.impl.DomainWireBuilderImpl;
 import org.apache.tuscany.sca.assembly.xml.Constants;
 import org.apache.tuscany.sca.contribution.Contribution;
@@ -113,7 +114,9 @@
     NodeFactoryImpl nodeFactory;
     
     // domain level wiring 
-    DomainWireBuilderImpl domainWireBuilder = new DomainWireBuilderImpl();
+    DomainBuilder domainBuilder;
+    List<Binding> removeCandidates = new ArrayList<Binding>();
+    List<Binding> addCandidates = new ArrayList<Binding>();
     
        
     // methods defined on the implementation only
@@ -186,6 +189,9 @@
             nodeRuntime = new ReallySmallRuntime(nodeClassLoader);
             nodeRuntime.start();
             
+            // get the domain builder
+            domainBuilder = nodeRuntime.getDomainBuilder();            
+            
             // configure the default port and path for this runtime
             int port = URI.create(nodeURI).getPort();
             String path = nodeURL.getPath();
@@ -689,7 +695,7 @@
                 // the node has more than one composite and is stand alone
                 // If the node is not stand alone the domain will do this
                 if (domainURI == null){
-                    domainWireBuilder.wireDomain(nodeComposite);
+                    domainBuilder.wireDomain(nodeComposite);
                 }
                 
                 for (Composite composite : nodeComposite.getIncludes()) {
@@ -830,6 +836,7 @@
             throw new NodeException(ex);
         }       
         
+/*        
         // for each component in the composite compare it against the live component
         for (Component newComponent : newComposite.getComponents()){
             for (Component component : composite.getComponents()){         
@@ -906,7 +913,105 @@
         }
         
         // TODO - Compare other parts of the composite?
- 
-    }  
+    } 
+*/
+        
+        // for each component in the composite compare it against the live component
+        for (Component newComponent : newComposite.getComponents()){
+            for (Component component : composite.getComponents()){         
+                if (component.getName().equals(newComponent.getName())){
+                    // compare the component references
+                    for (Reference newReference : newComponent.getReferences()){
+                        for (Reference reference : component.getReferences()) {           
+                            if (reference.getName().equals(newReference.getName())) {
+                                boolean referenceChanged = false;
+                                removeCandidates.clear();
+                                addCandidates.clear();
+                                
+                                for (Binding newBinding : newReference.getBindings()){
+                                    boolean bindingFound = false;
+                                    for (Binding binding : reference.getBindings()){ 
+                                        // find the matching target service binding       
+                                        if (binding.getName().equals(newBinding.getName())){
+                                            if ((binding.getURI() != null) && 
+                                                (newBinding.getURI() != null) &&
+                                                !binding.getURI().equals(newBinding.getURI())){
+                                                binding.setURI(newBinding.getURI());
+                                                referenceChanged = true;
+                                                
+                                                logger.log(Level.INFO, "Updating binding " + 
+                                                                       component.getName() + 
+                                                                       " reference " + 
+                                                                       reference.getName() +
+                                                                       " binding " + 
+                                                                       binding.getClass().getName() + 
+                                                                       " URI " + 
+                                                                       binding.getURI());
+                                            }
+                                            bindingFound = true;
+                                        } else {
+                                            removeCandidates.add(binding);
+                                        }
+                                    }
+                                    
+                                    if (bindingFound == false){
+                                        addCandidates.add(newBinding);
+                                    }
+
+                                }
+                                
+                                for (Binding addBinding : addCandidates){
+                                    reference.getBindings().add(addBinding);
+                                    referenceChanged = true;
+                                    logger.log(Level.INFO, "Adding binding " + 
+                                            component.getName() + 
+                                            " reference " + 
+                                            reference.getName() +
+                                            " binding " + 
+                                            addBinding.getClass().getName() + 
+                                            " URI " + 
+                                            addBinding.getURI());                                        
+                                }
+                                
+                                // remove all of the old bindings
+                                for (Binding removeBinding : removeCandidates){
+                                    reference.getBindings().remove(removeBinding);
+                                    referenceChanged = true;
+                                    logger.log(Level.INFO, "Removing binding " + 
+                                            component.getName() + 
+                                            " reference " + 
+                                            reference.getName() +
+                                            " binding " + 
+                                            removeBinding.getClass().getName() + 
+                                            " URI " + 
+                                            removeBinding.getURI());
+                                }
+                                
+                                // if the node is running restart the reference and the component that holds it
+                                if (referenceChanged && nodeStarted){
+                                    try {
+                                        nodeRuntime.getCompositeActivator().stop((RuntimeComponent)component);
+                                        nodeRuntime.getCompositeActivator().deactivate((RuntimeComponent)component, 
+                                                (RuntimeComponentReference)reference);
+                                        nodeRuntime.getCompositeActivator().start((RuntimeComponent)component, 
+                                                (RuntimeComponentReference)reference);
+                                        nodeRuntime.getCompositeActivator().start((RuntimeComponent)component);
+                                       
+                                    } catch (Exception ex) {
+                                        throw new NodeException(ex);
+                                    }
+                                    
+                                }                                
+                            }
+                        }
+                    }
+                    
+                    // TODO - compare other parts of the component
+                }
+            }
+        }
+        
+        // TODO - Compare other parts of the composite?
+    }
 
 }

Modified: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainAPITestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainAPITestCase.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainAPITestCase.java (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainAPITestCase.java Tue Dec 18 17:38:46 2007
@@ -124,6 +124,8 @@
     @Test
     public void testAddAndUpdateContribution() throws Exception {  
         try {
+            
+System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");            
             domain.addContribution("nodeA", cl.getResource("nodeA/"));
             domain.addContribution("nodeB", cl.getResource("nodeB/"));
             domain.addToDomainLevelComposite(new QName("http://sample", "CalculatorA"));

Modified: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java Tue Dec 18 17:38:46 2007
@@ -78,12 +78,13 @@
             domain.addToDomainLevelComposite(new QName("http://sample", "CalculatorC"));
             
             domain.startComposite(new QName("http://sample", "CalculatorA"));
+           
             domain.startComposite(new QName("http://sample", "CalculatorB"));
             domain.startComposite(new QName("http://sample", "CalculatorC"));
             
             calculatorServiceA = domain.getService(CalculatorService.class, "CalculatorServiceComponentA");
             calculatorServiceB = domain.getService(CalculatorService.class, "CalculatorServiceComponentB");
-            
+ 
             
         } catch(Exception ex){
             ex.printStackTrace();
@@ -99,6 +100,12 @@
         nodeC.destroy();
         domain.destroy();
     }
+    
+    //@Test
+    public void testKeepServerRunning() throws Exception {
+        System.out.println("press enter to continue");
+        System.in.read();
+    }      
 
     @Test
     public void testCalculator() throws Exception {       

Modified: incubator/tuscany/java/sca/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingImpl.java?rev=605380&r1=605379&r2=605380&view=diff
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingImpl.java (original)
+++ incubator/tuscany/java/sca/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingImpl.java Tue Dec 18 17:38:46 2007
@@ -90,5 +90,10 @@
         this.requiredIntents = intents;
         
     }
+    
+    @Override
+    public Object clone() throws CloneNotSupportedException {
+        return super.clone();
+    }    
 
 }



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