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 2008/04/25 07:34:50 UTC

svn commit: r651490 [2/2] - in /incubator/tuscany/java/sca: itest/callablereferences/ itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/ itest/callablereferences/src/main/resources/nodeA/ itest/callablereferences/src/main/...

Modified: incubator/tuscany/java/sca/itest/oneway/src/test/java/org/apache/tuscany/sca/itest/oneway/OneWayTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/oneway/src/test/java/org/apache/tuscany/sca/itest/oneway/OneWayTestCase.java?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/oneway/src/test/java/org/apache/tuscany/sca/itest/oneway/OneWayTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/oneway/src/test/java/org/apache/tuscany/sca/itest/oneway/OneWayTestCase.java Thu Apr 24 22:34:47 2008
@@ -19,22 +19,22 @@
 
 package org.apache.tuscany.sca.itest.oneway;
 
+import java.io.File;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.logging.Handler;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
 import java.util.logging.Logger;
 
-import javax.xml.namespace.QName;
-
 import junit.framework.Assert;
 
 import org.apache.tuscany.sca.core.invocation.NonBlockingInterceptor;
-import org.apache.tuscany.sca.domain.SCADomain;
 import org.apache.tuscany.sca.itest.oneway.impl.OneWayClientImpl;
 import org.apache.tuscany.sca.itest.oneway.impl.OneWayServiceImpl;
-import org.apache.tuscany.sca.node.SCANode;
-import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -51,11 +51,8 @@
      */
     private static final int MAX_SLEEP_TIME = 10000;
 
-    /**
-     * The SCADomain that we are using for testing.
-     */
-    private SCADomain domain;
-
+    private SCANode2 node;
+    
     /**
      * Initialise the SCADomain.
      *
@@ -63,12 +60,15 @@
      */
     @Before
     public void setUp() throws Exception {
-        SCANode node = SCANodeFactory.newInstance().createSCANode(null, null);
-        node.addContribution("mycontribution",
-                             OneWayTestCase.class.getClassLoader().getResource("OneWayContribution/"));
-        node.addToDomainLevelComposite(new QName("http://oneway", "OneWayITest"));
+        
+        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+        node = nodeFactory.createSCANode(new File("src/main/resources/OneWayContribution/META-INF/sca-deployables/oneWay.composite").toURL().toString(),
+                                         new SCAContribution("TestContribution", 
+                                                                     new File("src/main/resources/OneWayContribution").toURL().toString()));
+                
+         
         node.start();
-        domain = node.getDomain();
+        
     }
 
     /**
@@ -78,9 +78,7 @@
      */
     @After
     public void tearDown() throws Exception {
-        if (domain != null) {
-            domain.destroy();
-        }
+        node.stop();
     }
 
     /**
@@ -92,7 +90,7 @@
     @Test
     public void testOneWay() throws Exception {
         OneWayClient client =
-            domain.getService(OneWayClient.class, "OneWayClientComponent");
+            ((SCAClient)node).getService(OneWayClient.class, "OneWayClientComponent");
 
         int count = 100;
 
@@ -128,8 +126,8 @@
     @Test
     public void testOneWayUsingNonBlockingInterceptorThrowsAnException() {
         OneWayClient client =
-            domain.getService(OneWayClient.class, "OneWayClientComponentSCABinding");
-
+            ((SCAClient)node).getService(OneWayClient.class, "OneWayClientComponentSCABinding");
+            
         // We need to modify the JDK Logger for the NonBlockingInterceptor so we
         // can check that it logs a message for the @OneWay invocation that throws
         // an Exception

Modified: incubator/tuscany/java/sca/itest/references/src/main/resources/AutoWiredReferencesTest.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/references/src/main/resources/AutoWiredReferencesTest.composite?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/references/src/main/resources/AutoWiredReferencesTest.composite (original)
+++ incubator/tuscany/java/sca/itest/references/src/main/resources/AutoWiredReferencesTest.composite Thu Apr 24 22:34:47 2008
@@ -17,7 +17,7 @@
     * under the License.
 -->
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:foo="http://foo" targetNamespace="http://foo"
-    name="InnerReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autowire="true">
+    name="AutowireReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autowire="true">
 
     <service name="AComponent" promote="AComponent">
         <interface.java interface="org.apache.tuscany.sca.itest.references.AComponent" />

Modified: incubator/tuscany/java/sca/itest/validation/src/test/java/calculator/ComponentReferenceTargetNotFoundTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/validation/src/test/java/calculator/ComponentReferenceTargetNotFoundTestCase.java?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/validation/src/test/java/calculator/ComponentReferenceTargetNotFoundTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/validation/src/test/java/calculator/ComponentReferenceTargetNotFoundTestCase.java Thu Apr 24 22:34:47 2008
@@ -47,7 +47,13 @@
         node = nodeFactory.createSCANode(new File("src/main/resources/ComponentReferenceTargetNotFound/Calculator.composite").toURL().toString(),
         		                 new SCAContribution("TestContribution", 
         		                                     new File("src/main/resources/ComponentReferenceTargetNotFound").toURL().toString()));
-        node.start();
+        
+        try {
+            node.start();
+        } catch (Exception ex){
+            // do nothing - the SCA binding throws and exception here 
+            // because the interface for the reference is not remotable
+        }
         calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
     }
 

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseWireBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseWireBuilderImpl.java?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseWireBuilderImpl.java (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseWireBuilderImpl.java Thu Apr 24 22:34:47 2008
@@ -143,7 +143,7 @@
                     }
                     if (!promoted && !componentReference.isCallback()) {
                         /*warning("No targets for reference: " + componentReference.getName(), composite);*/
-				warning("ReferenceWithoutTargets", composite, componentReference.getName());
+                        warning("ReferenceWithoutTargets", composite, composite.getName().toString(), componentReference.getName());
                     }
                 } else {
                     warning("Too many targets on reference: " + componentReference.getName(), composite);
@@ -278,7 +278,7 @@
     
                 } else {
                     /*warning("Promoted component service not found: " + promotedServiceName, composite);*/
-			    warning("PromotedServiceNotFound", composite, promotedServiceName);
+                    warning("PromotedServiceNotFound", composite, promotedServiceName);
                 }
             }
         }
@@ -342,7 +342,7 @@
                         }
                     } else {
                         /*warning("Promoted component reference not found: " + componentReferenceName, composite);*/
-				warning("PromotedReferenceNotFound", composite, componentReferenceName);
+                        warning("PromotedReferenceNotFound", composite, componentReferenceName);
                     }
                 }
             }
@@ -416,7 +416,7 @@
                                     + " : "
                                     + componentService.getName(),
                                 composite);*/
-				warning("ReferenceIncompatibleInterface", composite, componentReference.getName(), componentService.getName());
+                        warning("ReferenceIncompatibleInterface", composite, composite.getName().toString(), componentReference.getName(), componentService.getName());
                     }
                 } else {
                     // add all the reference bindings into the target so that they
@@ -425,9 +425,9 @@
                     
                     // The bindings will be cloned back into the reference when the 
                     // target is finally resolved. 
-                    
+              
                     /*warning("Component reference target not found, it might be a remote service: " + componentService.getName(), composite);*/
-			    warning("ComponentReferenceTargetNotFound", composite, componentService.getName());
+                    warning("ComponentReferenceTargetNotFound", composite, composite.getName().toString(), componentService.getName());
                 }
             }
         } else if (componentReference.getReference() != null) {
@@ -545,7 +545,20 @@
                 }
             }
                        
-            if (!targets.isEmpty()) {
+            
+            // Need to tidy up the reference binding list and add in the bindings that 
+            // have been selected above. The situation so far...
+            //    Wired reference (1 or more targets are specified)
+            //       Binding.uri = null  - remove as it's left over from target resolution
+            //                             the binding will have been moved to the target from where 
+            //                             it will be resolved later
+            //       Binding.uri != null - the selected and resolved reference binding
+            //    Unwired reference (0 targets)
+            //       Binding.uri = null  - Either a callback reference or the reference is yet to be wired
+            //                             by the implementation so leave the binding where it is
+            //       Binding.uri != null - from the composite file so leave it             
+            if ((componentReference.getTargets().size() > 0) ||
+                (!targets.isEmpty())){
 
                 // Add all the effective bindings
                 componentReference.getBindings().clear();
@@ -554,27 +567,43 @@
                     componentReference.getCallback().getBindings().clear();
                     componentReference.getCallback().getBindings().addAll(selectedCallbackBindings);
                 }
-            }
-            
-            // Need to tidy up the reference binding list. The situation so far...
-            //    Wired reference (1 or more targets are specified)
-            //       Binding.uri = null  - remove as its left over from target resolution
-            //                             the binding will have been moved to the target from where 
-            //                             it will be resolved later
-            //       Binding.uri != null - the reference was resolved
-            //    Unwired reference (0 targets)
-            //       Binding.uri = null  - Either a callback reference or the reference is yet to be wired
-            //                             either manually or via autowire so leave the binding where it is
-            //       Binding.uri != null - from the composite file so leave it 
-            if (componentReference.getTargets().size() > 0){
-                List<Binding> bindingsToRemove = new ArrayList<Binding>();
-                for(Binding binding : componentReference.getBindings()){
-                    if(binding.getURI() == null){
-                        bindingsToRemove.add(binding);
+               
+                // add in sca bindings to represent all unresolved targets. The sca binding
+                // will try to resolve the target at a later date. 
+                for (ComponentService service : componentReference.getTargets()) {
+                    if (service.isUnresolved()) {
+                        SCABinding scaBinding = null;    
+                    
+                        // find the sca binding amongst the candidate binding list. We want to 
+                        // find this one and clone it as it may have been configured with
+                        // policies
+                        for (Binding binding : service.getBindings()) {
+
+                            if (binding instanceof SCABinding) {
+                                try {
+                                    scaBinding = (SCABinding)((OptimizableBinding)binding).clone();
+                                } catch (CloneNotSupportedException ex){
+                                    // we know it is supported on the SCA binding
+                                }
+                                break;
+                            }
+                        }
+                        
+                        if (scaBinding != null) {
+                            // configure the cloned SCA binding for this reference target
+                            scaBinding.setName(service.getName());
+                            
+                            // this service object holds the list of candidate bindings which 
+                            // can be used for later matching
+                            ((OptimizableBinding)scaBinding).setTargetComponentService(service);
+                            componentReference.getBindings().add(scaBinding);
+                        } else {
+                           // not sure we need to raise a warning here as a warning will already been 
+                           // thrown previously to indicate the reason why there is no sca binding
+                           // warning("NoSCABindingAvailableForUnresolvedService", componentReference, componentReference.getName(), service.getName());
+                        }
                     }
                 }
-                
-                componentReference.getBindings().removeAll(bindingsToRemove);
             }
         }
     }

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/resources/assembly-validation-messages_en.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/resources/assembly-validation-messages_en.properties?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/resources/assembly-validation-messages_en.properties (original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/resources/assembly-validation-messages_en.properties Thu Apr 24 22:34:47 2008
@@ -39,4 +39,5 @@
 ReferenceWithoutTargets = No targets for reference: Composite = {0} Reference = {1}
 PromotedReferenceNotFound = Promoted component reference not found: Composite = {0} Reference = {1}
 PromotedServiceNotFound = Promoted component service not found: Composite = {0} Service = {1}
-ComponentReferenceTargetNotFound = Component reference target not found, it might be a remote service: Composite = {0} Service = {1}
\ No newline at end of file
+ComponentReferenceTargetNotFound = Component reference target not found, it might be a remote service: Composite = {0} Service = {1}
+NoSCABindingAvailableForUnresolvedService = A local service cannot be found for reference {0} target {1} and there is no SCA binding available to represent the unresolved target
\ No newline at end of file

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/pom.xml?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/pom.xml Thu Apr 24 22:34:47 2008
@@ -31,12 +31,6 @@
     <name>Apache Tuscany SCA Axis2-based Default Binding Extension</name>
 
     <dependencies>
-    
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-node</artifactId>
-            <version>2.0-incubating-SNAPSHOT</version>
-        </dependency>    
        
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingInvoker.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/Axis2SCABindingInvoker.java?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingInvoker.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCABindingInvoker.java Thu Apr 24 22:34:47 2008
@@ -37,8 +37,6 @@
     
     private final static Logger logger = Logger.getLogger(Axis2SCABindingInvoker.class.getName());    
     
-    private int retryCount = 100;
-    private int retryInterval = 5000; //ms
     private Invoker axis2Invoker;
     private Axis2SCAReferenceBindingProvider provider;
 
@@ -56,7 +54,7 @@
 
     /**
      * Fix up the URL for the message. The "to" EndPoint comes from the wire
-     * target and needs to b replaced with the endpoint from the registry. 
+     * target and needs to be replaced with the endpoint from the registry. 
      * The default URL for an Endpoint URI where there is no 
      * target component or service information, as in the case of a 
      * wire crossing a node boundary, is "/"
@@ -73,7 +71,7 @@
 
             EndpointReference eprTo = provider.getServiceEndpoint();
 
-            if (eprTo == null) {
+            if ( (eprTo == null) || (eprTo.getURI() == null)) {
                 throw new ServiceUnavailableException("Endpoint for service: " + provider.getSCABinding().getURI()
                     + " can't be found for component: "
                     + provider.getComponent().getName()
@@ -97,46 +95,6 @@
         }
 
         // do the axis2 stuff
-        Message returnMessage = null;
-        
-    //    for (int i =0; i < retryCount; i++){
-            
-            returnMessage = axis2Invoker.invoke(msg);
-   /*         
-            if ( AxisFault.class.isInstance(returnMessage.getBody())){
-                
-                AxisFault axisFault =  returnMessage.getBody();  
-                
-                if (axisFault.getCause().getClass() == ConnectException.class) {
-                    logger.log(Level.INFO, "Trying to send message to " + 
-                                           msg.getTo().getURI());
-                    
-                    // try and get the service endpoint again just in case
-                    // it's moved
-                    EndpointReference serviceEPR = provider.refreshServiceEndpoint();
-    
-                    if (serviceEPR == null) {
-                        throw new ServiceUnavailableException("Endpoint for service: " + provider.getSCABinding().getURI()
-                            + " can't be found for component: "
-                            + provider.getComponent().getName()
-                            + " reference: "
-                            + provider.getComponentReference().getName());
-                    }
-                    msg.setTo(serviceEPR);  
-                } else {
-                    break;
-                }
-          
-            } else {
-                break;
-            }
-            
-            try {
-                Thread.sleep(retryInterval);
-            } catch(InterruptedException ex) {
-            }
-         }            
-        */
-        return returnMessage;
+        return axis2Invoker.invoke(msg);
     }
 }

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAReferenceBindingProvider.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/Axis2SCAReferenceBindingProvider.java?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAReferenceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAReferenceBindingProvider.java Thu Apr 24 22:34:47 2008
@@ -122,114 +122,27 @@
      */
     public EndpointReference getServiceEndpoint(){
       
-        String endpointURL = null;
-        
-        if (binding.getURI() != null) {
-            // check if the binding URI is already resolved if it is use is if not 
-            try {
-                URI uri = new URI(binding.getURI());
-                 if (uri.isAbsolute()) {
-                     endpointURL = binding.getURI();
-                 } 
-            } catch(Exception ex) {
-                // do nothing
-            } 
+        if (serviceEPR == null){
+            String endpointURL = null;
             
-            if ( endpointURL == null) {  
-                SCADomainEventService domainProxy = (SCADomainEventService)nodeFactory.getNode().getDomain();
-                
+            if (binding.getURI() != null) {
+                // check if the binding URI is already resolved if it is use is if not 
                 try {
-                    endpointURL = 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() + " " +
-                               binding.getClass().getName());                    
-                }
-                
-                if (endpointURL.equals(SCADomainEventService.SERVICE_NOT_REGISTERED)){
-                    throw new IllegalStateException("Can't resolve reference as no SCA binding URI is available while trying to find target service. Component: "+
-                                                    component.getName() +
-                                                    " and reference: " + 
-                                                    reference.getName() ); 
-                }   
-            }  
-        }
-        
-        binding.setURI(endpointURL);
-
-        serviceEPR = new EndpointReferenceImpl(binding.getURI());
-            
-        
-/*        
-        if ( serviceEPR == null && nodeFactory.getNode() != null ){
-            // try to resolve the service endpoint with the registry 
-            SCADomainEventService domainProxy = (SCADomainEventService)nodeFactory.getNode().getDomain();
-            
-            if (domainProxy != null){
-            
-	            // The binding URI might be null in the case where this reference is completely
-	            // dynamic, for example, in the case of callbacks
-                    String bindingURIString = binding.getURI();
-	            if (bindingURIString != null) {
-	                String serviceURL  = null;
-	                URI bindingURI = null;
-	                
-	                // first time through here assume that the binding URI is correct
-	                try {
-	                    bindingURI = new URI(bindingURIString);
-	                    if (bindingURI.isAbsolute()){
-	                        serviceURL = bindingURIString;
-	                    }
-	                } catch(Exception ex) {
-	                    
-	                }
-	                
-	                if ( serviceURL == null) {   
-        	                try {
-        	                    serviceURL = domainProxy.findServiceEndpoint(nodeFactory.getNode().getDomain().getURI(), 
-        	                                                                 bindingURI.getPath(), 
-        	                                                                 binding.getClass().getName());
-        	                } catch (Exception ex) {
-        	                    logger.log(Level.WARNING, 
-        	                               "Unable to  find service service: "  +
-        	                               nodeFactory.getNode().getDomain().getURI() + " " +
-        	                               nodeFactory.getNode().getURI() + " " +
-        	                               binding.getURI() + " " +
-        	                               binding.getClass().getName());	                 
-        	                }
-	                }
-	                
-	                if ( (serviceURL != null ) &&
-	                     (!serviceURL.equals(""))){
-	                    serviceEPR = new EndpointReferenceImpl(serviceURL);
-	                }
-	            }
-            } else {
-	            throw new IllegalStateException("No domain service available while trying to find component: "+
-						                        component.getName() +
-						                        " and service: " + 
-						                        reference.getName());	 
+                    URI uri = new URI(binding.getURI());
+                     if (uri.isAbsolute()) {
+                         endpointURL = binding.getURI();
+                     } 
+                } catch(Exception ex) {
+                    // do nothing
+                } 
             }
+            
+            serviceEPR = new EndpointReferenceImpl(endpointURL);
         }
-*/        
         
         return serviceEPR;
     }
     
-    /**
-     * Go back to the distributed domain to go and get the service endpoint
-     * 
-     * @return An EPR for the target service that this reference refers to 
-     */
-    public EndpointReference refreshServiceEndpoint(){ 
-        serviceEPR= null;
-        return getServiceEndpoint();
-    }
     
     /**
      * Retrieves the URI of the callback service (that this reference has created)
@@ -265,8 +178,6 @@
     }    
 
     public void start() {
-        // Try and resolve the service endpoint just in case it is available now
-       // getServiceEndpoint();
         axisReferenceBindingProvider.start();
     }
 

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=651490&r1=651489&r2=651490&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 Thu Apr 24 22:34:47 2008
@@ -27,20 +27,20 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-public class AsynchTestCase extends BaseTest {
+public class AsynchTestCase {
     
     public static TestNode nodeA;
     public static TestNode nodeB;
 
     @BeforeClass
     public static void init() throws Exception {
-        System.out.println("Setting up distributed nodes");
+        System.out.println("Setting up nodes");
 
         try {
             // create and start domains
-            nodeA = createNode("http://localhost:8100/nodeG");
-            nodeB = createNode("http://localhost:8200/nodeH");
-            testDomain.start();
+            nodeA = new TestNode("nodeG");
+            nodeB = new TestNode("nodeH");
+
             nodeA.start();
             nodeB.start();
 
@@ -53,9 +53,9 @@
 
     @AfterClass
     public static void destroy() throws Exception {
-        nodeA.destroy();
-        nodeB.destroy();
-    }   
+        nodeA.stop();
+        nodeB.stop();
+    }    
     
     @Test
     public void testHelloWorldAsynch() throws Exception {        

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=651490&r1=651489&r2=651490&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 Thu Apr 24 22:34:47 2008
@@ -25,20 +25,20 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-public class CallbackTestCase extends BaseTest {
+public class CallbackTestCase {
     
     public static TestNode nodeA;
     public static TestNode nodeB;
 
     @BeforeClass
     public static void init() throws Exception {
-        System.out.println("Setting up distributed nodes");
+        System.out.println("Setting up nodes");
 
         try {
             // create and start domains
-            nodeA = createNode("http://localhost:8100/nodeE");
-            nodeB = createNode("http://localhost:8200/nodeF");
-            testDomain.start();
+            nodeA = new TestNode("nodeE");
+            nodeB = new TestNode("nodeF");
+
             nodeA.start();
             nodeB.start();
 
@@ -51,24 +51,27 @@
 
     @AfterClass
     public static void destroy() throws Exception {
-        nodeA.destroy();
-        nodeB.destroy();
-    }   
+        nodeA.stop();
+        nodeB.stop();
+    } 
     
     //@Test
+    public void testKeepServerRunning() throws Exception {
+        System.out.println("press enter to continue");
+        System.in.read();
+    } 
+    
+    @Test
     public void testHelloWorldCallbackLocal() throws Exception {  
         HelloWorldClient helloWorldClientB;
         helloWorldClientB = nodeB.getService(HelloWorldClient.class, "BHelloWorldClientCallbackLocal");
         Assert.assertEquals("Hello callback fred", helloWorldClientB.getGreetings("fred"));  
-    }      
+    }     
     
     @Test
     public void testHelloWorldCallbackRemote() throws Exception {  
-        //FIXME works in Eclipse, doesn't with Maven
-//        HelloWorldClient helloWorldClientA;
-//        helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote");
-//        Assert.assertEquals("Hello callback fred", helloWorldClientA.getGreetings("fred"));
-        
+        HelloWorldClient helloWorldClientA;
+        helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientCallbackRemote");
+        Assert.assertEquals("Hello callback fred", helloWorldClientA.getGreetings("fred"));
     }    
-    
 }

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=651490&r1=651489&r2=651490&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 Thu Apr 24 22:34:47 2008
@@ -18,24 +18,27 @@
  */
 package org.apache.tuscany.sca.binding.sca.axis2;
 
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-public class PromotionTestCase extends BaseTest {
+public class PromotionTestCase {
     
     public static TestNode nodeA;
     public static TestNode nodeB;
 
     @BeforeClass
     public static void init() throws Exception {
-        System.out.println("Setting up distributed nodes");
+        System.out.println("Setting up nodes");
 
         try {
             // create and start domains
-            nodeA = createNode("http://localhost:8100/nodeC");
-            nodeB = createNode("http://localhost:8200/nodeD");
-            testDomain.start();
+            nodeA = new TestNode("nodeC");
+            nodeB = new TestNode("nodeD");
+
             nodeA.start();
             nodeB.start();
 
@@ -48,17 +51,16 @@
 
     @AfterClass
     public static void destroy() throws Exception {
-        nodeA.destroy();
-        nodeB.destroy();
-    }    
+        nodeA.stop();
+        nodeB.stop();
+    }     
     
     @Test
     public void testHelloWorldPromotion() throws Exception {  
-/*        
         HelloWorldClient helloWorldClientA;
         helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemotePromotion");
         Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
-*/
+
     }      
   
 }

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=651490&r1=651489&r2=651490&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 Thu Apr 24 22:34:47 2008
@@ -24,21 +24,22 @@
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.osoa.sca.ServiceUnavailableException;
 
-public class SimpleTestCase extends BaseTest {
+public class SimpleTestCase {
     
     public static TestNode nodeA;
     public static TestNode nodeB;
 
     @BeforeClass
     public static void init() throws Exception {
-        System.out.println("Setting up distributed nodes");
+        System.out.println("Setting up nodes");
 
         try {
             // create and start domains
-            nodeA = createNode("http://localhost:8100/nodeA");
-            nodeB = createNode("http://localhost:8200/nodeB");
-            testDomain.start();
+            nodeA = new TestNode("nodeA");
+            nodeB = new TestNode("nodeB");
+
             nodeA.start();
             nodeB.start();
 
@@ -51,8 +52,8 @@
 
     @AfterClass
     public static void destroy() throws Exception {
-        nodeA.destroy();
-        nodeB.destroy();
+        nodeA.stop();
+        nodeB.stop();
     }    
     
     @Test
@@ -66,7 +67,12 @@
     public void testHelloWorldRemote() throws Exception {  
         HelloWorldClient helloWorldClientA;
         helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientRemote");
-        Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
+        try {
+            helloWorldClientA.getGreetings("fred");
+        } catch (ServiceUnavailableException ex){
+            return;
+        }
+        Assert.fail();
         
     }    
     
@@ -88,7 +94,7 @@
         Assert.assertEquals(helloWorldClientB.getGreetings("fred"), "Hello fred");
     }   
     
-    //@Test
+    @Test
     public void testHelloWorldMultipleBindings() throws Exception {  
         HelloWorldClient helloWorldClientA;
         helloWorldClientA = nodeA.getService(HelloWorldClient.class, "AHelloWorldClientMultipleBindings");

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=651490&r1=651489&r2=651490&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 Thu Apr 24 22:34:47 2008
@@ -53,31 +53,26 @@
 import org.osoa.sca.ServiceRuntimeException;
 
 /**
- * The very minimum domain implementation to get these tests going without creating a dependency on 
- * domain-impl
+ * The very minimum node implementation to get these tests going without creating a dependency on 
+ * any runtime/hosting implementation
  * 
  * @version $Rev: 552343 $ $Date: 2007-09-20 14:53:40 +0100 (Thu, 20 Sep 2007) $
  */
-public class TestNode implements SCANode {
+public class TestNode  {
     
     private final static Logger logger = Logger.getLogger(TestNode.class.getName());    
     
     private String nodeName;
-    private String domainURI;
     private ReallySmallRuntime nodeRuntime;
     
-    private ClassLoader cl = BaseTest.class.getClassLoader();
+    private ClassLoader cl = TestNode.class.getClassLoader();
+    
     private Composite nodeComposite = null;
     private Composite appComposite = null;
     
-    private SCADomain scaDomain;
-        
-    
-    public TestNode(String domainURI, String nodeName, SCADomain domain)
+    public TestNode(String nodeName)
       throws Exception {
-        this.domainURI = domainURI; 
         this.nodeName = nodeName;
-        this.scaDomain = domain;
               
         try {
 
@@ -85,49 +80,24 @@
             nodeRuntime = new ReallySmallRuntime(cl);
             nodeRuntime.start();
             
-            // If a non-null domain name is provided make the node available to the model
-            // this causes the runtime to start registering binding-sca service endpoints
-            // with the domain so only makes sense if we know we have a domain to talk to
-            if (domainURI != null) {
-                ModelFactoryExtensionPoint factories = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
-                NodeFactoryImpl nodeFactory = new NodeFactoryImpl(this);
-                factories.addFactory(nodeFactory);    
-            }
- 
-            // Configure the default server port
-            int port = URI.create(nodeName).getPort();
-            if (port != -1) {
-                ServletHostExtensionPoint servletHosts = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ServletHostExtensionPoint.class);
-                for (ServletHost servletHost: servletHosts.getServletHosts()) {
-                    servletHost.setDefaultPort(port);
-                }
-            }
-            
             // Create an in-memory domain level composite
             AssemblyFactory assemblyFactory = nodeRuntime.getAssemblyFactory();
             nodeComposite = assemblyFactory.createComposite();
             nodeComposite.setName(new QName(Constants.SCA10_NS, "domain"));
-            nodeComposite.setURI(domainURI);
+            nodeComposite.setURI("http://localhost");
             
             // add the top level composite into the composite activator
-            nodeRuntime.getCompositeActivator().setDomainComposite(nodeComposite);  
-            
-            // make the domain available to the model. 
-            ModelFactoryExtensionPoint factories = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
-            NodeFactoryImpl domainFactory = new NodeFactoryImpl(this);
-            factories.addFactory(domainFactory);                       
+            nodeRuntime.getCompositeActivator().setDomainComposite(nodeComposite);                     
 
             // add a contribution to the domain
             ContributionService contributionService = nodeRuntime.getContributionService();
 
             // find the current directory as a URL. This is where our contribution 
             // will come from
-            String contributionDirectory = nodeName.substring(nodeName.lastIndexOf('/') + 1);
-            URL contributionURL = Thread.currentThread().getContextClassLoader().getResource(contributionDirectory + "/");
+            URL contributionURL = Thread.currentThread().getContextClassLoader().getResource(nodeName + "/");
 
             // Contribute the SCA application
-            Contribution contribution = contributionService.contribute("http://calculator", contributionURL, null, //resolver, 
-                                                                       false);
+            Contribution contribution = contributionService.contribute("http://calculator", contributionURL, null, false);
             appComposite = contribution.getDeployables().get(0);
 
             // Add the deployable composite to the domain
@@ -135,12 +105,9 @@
             nodeRuntime.buildComposite(appComposite);
             nodeRuntime.getCompositeActivator().activate(appComposite);
             
-            ((TestDomain)domain).addComposite(appComposite);
-            
-            //registerRemoteServices(appComposite);
 
         } catch (Exception ex) {
-            System.err.println("Exception when creating domain " + ex.getMessage());
+            System.err.println("Exception when creating node " + ex.getMessage());
             ex.printStackTrace(System.err);
             throw ex;
         }         
@@ -150,7 +117,6 @@
         throws NodeException {
         
         try {
-
             nodeRuntime.getCompositeActivator().start(appComposite);
         } catch (Exception ex) {
             System.err.println("Exception when creating domain " + ex.getMessage());
@@ -159,11 +125,7 @@
         
     }
     
-    public void stop() 
-      throws NodeException {
-    }
-    
-    public void destroy() throws NodeException {
+    public void stop() throws NodeException {
         try {
             nodeRuntime.stop();
         } catch(Exception ex) {
@@ -171,35 +133,6 @@
         }
     }
     
-        
-    public String getURI(){
-        return nodeName;
-    }
-    
-    public SCADomain getDomain(){
-        return scaDomain;
-    }
-    
-    public void addContribution(String contributionURI, URL contributionURL) throws NodeException {
-        addContribution(contributionURI, contributionURL, null);
-    }
-        
-    public void addContribution(String contributionURI, URL contributionURL, ClassLoader contributionClassLoader ) throws NodeException {
-       
-    }
-    
-    public void removeContribution(String contributionURI) throws NodeException {
-    }
-
-    public void removeContributions() throws NodeException {
- 
-    }
-    
-    public void addToDomainLevelComposite(QName compositeName) throws NodeException {
-    }
-    
-    public void addToDomainLevelComposite(String compositePath) throws NodeException {
-    }
     
     public <B> B getService(Class<B> businessInterface, String serviceName) {
         ServiceReference<B> serviceReference = getServiceReference(businessInterface, serviceName);
@@ -302,8 +235,6 @@
             }
         }
     }
-
-    public void startContribution(String contributionURI) throws NodeException {
-    }     
+   
 }
 

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeA/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeA/HelloWorld.composite?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeA/HelloWorld.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeA/HelloWorld.composite Thu Apr 24 22:34:47 2008
@@ -42,30 +42,34 @@
     <!-- local and remote wires -->    
     <component name="AHelloWorldClientLocalAndRemote">
 		<implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" />
-        <reference name="helloWorldService" target="BHelloWorldServiceLocalAndRemote" />
+        <reference name="helloWorldService">
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceLocalAndRemote"/>
+        </reference>
     </component>  
     
     <!-- multiple services -->
     <component name="AHelloWorldClientMultipleServices">
 		<implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" />
-        <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote" />
+        <reference name="helloWorldService">
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/>
+        </reference>
     </component>  
     
     <component name="AHelloWorldClientMultipleServices2">
 		<implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemote2Impl" />
-        <reference name="helloWorldService" target="BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2" />
+        <reference name="helloWorldService">
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/>
+        </reference>        
     </component> 
     
     <!-- multiple bindings -->   
-    <!--component name="AHelloWorldClientMultipleBindings">
+    <component name="AHelloWorldClientMultipleBindings">
 		<implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientRemoteImpl" />
-        <reference name="helloWorldService" target="BHelloWorldServiceRemote" >
+        <reference name="helloWorldService" >
             <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote" />        
-            <binding.sca/>
+            <binding.sca uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-scabinding"/>
             <binding.ws/>
         </reference>
-    </component-->
-    
+    </component>
     
-
 </composite>

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeB/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeB/HelloWorld.composite?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeB/HelloWorld.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeB/HelloWorld.composite Thu Apr 24 22:34:47 2008
@@ -29,11 +29,17 @@
     <!-- unresolved remote wire --> 
     <component name="BHelloWorldServiceRemote">
         <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" />
+        <service name="HelloWorldServiceRemote">
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemote"/>
+        </service>
     </component>
     
     <!-- local and remote wires -->
     <component name="BHelloWorldServiceLocalAndRemote">
         <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" />
+        <service name="HelloWorldServiceRemote">
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceLocalAndRemote"/>
+        </service>
     </component>
     
     <component name="BHelloWorldClientLocalAndRemote">
@@ -44,6 +50,14 @@
     <!-- multiple services -->
     <component name="BHelloWorldServiceMultipleServices">
         <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceMultipleServicesImpl" />
+        <service name="HelloWorldServiceLocal">
+        </service>        
+        <service name="HelloWorldServiceRemote">
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote"/>
+        </service>        
+        <service name="HelloWorldServiceRemote2">
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceMultipleServices/HelloWorldServiceRemote2"/>
+        </service>
     </component>
     
     <component name="BHelloWorldClientMultipleServices">
@@ -52,14 +66,14 @@
     </component>
     
     <!-- multiple bindings --> 
-    <!--component name="BHelloWorldMultipleBindings">
+    <component name="BHelloWorldMultipleBindings">
         <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemoteImpl" />
         <service name="HelloWorldServiceRemote">
             <interface.java interface="org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote" />
-            <binding.ws/>
-            <binding.sca/>
+            <binding.ws uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-wsbinding"/>
+            <binding.sca uri="http://localhost:8085/BHelloWorldMultipleBindings/HelloWorldServiceRemote-scabinding"/>
         </service>
-    </component-->
+    </component>
      
     
     <!-- Dynamic interfaces -->

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorld.composite?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorld.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeC/HelloWorld.composite Thu Apr 24 22:34:47 2008
@@ -26,7 +26,9 @@
     <!-- composite hierarchy -->
     <component name="AHelloWorldClientRemotePromotion">
 		<implementation.composite name="sample:HelloWorldComponent" />
-		<reference name="AHelloWorldClientRemoteReference" target="BHelloWorldServiceRemotePromotion"/>
+		<reference name="AHelloWorldClientRemoteReference">
+		    <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemotePromotion"/>
+		</reference>
     </component>
     
 

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorld.composite?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorld.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeD/HelloWorld.composite Thu Apr 24 22:34:47 2008
@@ -26,6 +26,9 @@
     <!-- composite hierarchy -->
     <component name="BHelloWorldServiceRemotePromotion">
 		<implementation.composite name="sample:HelloWorldComponent" />
+		<service name="BHelloWorldServiceRemoteService">
+		    <binding.sca uri="http://localhost:8085/BHelloWorldServiceRemotePromotion"/>
+		</service>
     </component>   
 
     

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeE/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeE/HelloWorld.composite?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeE/HelloWorld.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeE/HelloWorld.composite Thu Apr 24 22:34:47 2008
@@ -25,7 +25,12 @@
     <!-- callback remote wire -->   
     <component name="AHelloWorldClientCallbackRemote">
 		<implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackRemoteImpl" />
-        <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote" />
+        <reference name="helloWorldService" >
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
+            <callback>
+                <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
+            </callback>
+        </reference>
     </component>
     
 </composite>

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeF/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeF/HelloWorld.composite?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeF/HelloWorld.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeF/HelloWorld.composite Thu Apr 24 22:34:47 2008
@@ -27,13 +27,17 @@
     <component name="BHelloWorldServiceCallbackRemote">
         <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceCallbackRemoteImpl" />
         <service name="HelloWorldServiceCallbackRemote">
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
+            <callback>
+                <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
+            </callback>            
         </service>
     </component>
     
     <!-- callback local wire -->   
-    <!--component name="BHelloWorldClientCallbackLocal">
+    <component name="BHelloWorldClientCallbackLocal">
 		<implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackRemoteImpl" />
         <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote" />
-    </component-->
+    </component>
 
 </composite>

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite Thu Apr 24 22:34:47 2008
@@ -25,7 +25,12 @@
     <!-- callback remote wire -->   
     <component name="AHelloWorldClientCallbackRemote">
 		<implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl" />
-        <reference name="helloWorldService" target="BHelloWorldServiceCallbackRemote" />
+        <reference name="helloWorldService" >
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
+            <callback>
+                <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
+            </callback>
+        </reference>
     </component>
     
 </composite>

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite (original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite Thu Apr 24 22:34:47 2008
@@ -26,6 +26,12 @@
     <!-- callback remote wire --> 
     <component name="BHelloWorldServiceCallbackRemote">
         <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceCallbackOnewayRemoteImpl" />
+        <service name="HelloWorldServiceCallbackOnewayRemote">
+            <binding.sca uri="http://localhost:8085/BHelloWorldServiceCallbackRemote"/>
+            <callback>
+                <binding.sca uri="http://localhost:8084/AHelloWorldClientCallbackRemote"/>
+            </callback>            
+        </service>
     </component>
     
 

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=651490&r1=651489&r2=651490&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 Thu Apr 24 22:34:47 2008
@@ -84,9 +84,6 @@
             (BindingProviderFactory<DistributedSCABinding>)factoryExtensionPoint
                 .getProviderFactory(DistributedSCABinding.class);
 
-        // determine if the target is remote. If we can tell now then this will
-        // do some initialization before we get to run time
-        //isTargetRemote();
     }
 
     public boolean isTargetRemote() {
@@ -95,13 +92,15 @@
         // first look at the target service and see if this has been resolved
         OptimizableBinding optimizableBinding = (OptimizableBinding)binding;
 
-        // The decision is based primary on the results of the wiring process in the assembly model
-        // however there are two notable situations when this process doesn't give the right answer
-        // 1. When a callback is in operation. A callback reference bindings sometimes has to 
-        //    act as though there is a local wire and sometimes as if there is a remote wire
-        // 2. When a reference is retrieved from the domain. In this case the reference
-        //    will not have been part of the original wiring process and will only have 
-        //    a target set if the target is local 
+        // The decision is based on the results of the wiring process in the assembly model
+        // The SCA binding is used to represent unresolved reference targets, i.e. those
+        // reference targets that need resolving at run time. We can tell by lookin if the 
+        // service to which this binding refers is resolved or not. 
+        //
+        // TODO - When a callback is in operation. A callback reference bindings sometimes has to 
+        //        act as though there is a local wire and sometimes as if there is a remote wire
+        //        what are the implications of this here?
+
         if (optimizableBinding.getTargetComponentService() != null) {
             if (optimizableBinding.getTargetComponentService().isUnresolved() == true) {
                 targetIsRemote = true;
@@ -109,50 +108,14 @@
                 targetIsRemote = false;
             }
         } else {
-            // deal with the case where the wire is completely dynamic (e.g. callbacks) and
-            // look at the provided URI to decide whether is a local or remote case
+            // the case where the wire is specified by URI, e.g. callbacks or user specified bindings, and
+            // look at the provided URI to decide whether it is a local or remote case
             try {
                 URI uri = new URI(binding.getURI());
                 if (uri.isAbsolute()) {
                     targetIsRemote = true;
                 } else {
-                    // look in the domain to see if this referenced service is available on this node
-                    // or on some other node
-                    String serviceNode = null;
-
-                    SCADomainEventService domainProxy = (SCADomainEventService)nodeFactory.getNode().getDomain();
-
-                    try {
-                        serviceNode =
-                            domainProxy.findServiceNode(nodeFactory.getNode().getDomain().getURI(),
-                                                        binding.getURI(),
-                                                        binding.getClass().getName());
-                    } catch (Exception ex) {
-                        logger.log(Level.WARNING,
-                                   "Unable to contact domain to find service node. Service: " + nodeFactory.getNode()
-                                       .getDomain().getURI()
-                                       + " "
-                                       + nodeFactory.getNode().getURI()
-                                       + " "
-                                       + binding.getURI()
-                                       + " "
-                                       + SCABinding.class.getName());
-
-                    }
-
-                    if (serviceNode.equals(domainProxy.SERVICE_NOT_KNOWN)) {
-                        throw new IllegalStateException("Can't resolve : " + component.getName()
-                            + " and reference: "
-                            + reference.getName()
-                            + " as the service "
-                            + binding.getURI()
-                            + " has not been contributed to the domain");
-                    } else if ((serviceNode.equals(domainProxy.SERVICE_NOT_REGISTERED)) || (!serviceNode
-                        .equals(nodeFactory.getNode().getURI()))) {
-                        targetIsRemote = true;
-                    } else {
-                        targetIsRemote = false;
-                    }
+                    targetIsRemote = false;
                 }
             } catch (Exception ex) {
                 targetIsRemote = false;
@@ -167,7 +130,7 @@
             // 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
+                    throw new IllegalStateException("Reference interface not remotable for component: " + component
                         .getName()
                         + " and reference: "
                         + reference.getName());
@@ -180,13 +143,6 @@
                         + reference.getName());
                 }
 
-                if ((nodeFactory != null) && (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);
@@ -194,7 +150,6 @@
                 distributedProvider =
                     distributedProviderFactory.createReferenceBindingProvider(component, reference, distributedBinding);
             }
-
         }
 
         return distributedProvider;
@@ -220,9 +175,6 @@
         }
     }
 
-    /**
-     * @param wire
-     */
     private Invoker getInvoker(RuntimeWire wire, Operation operation) {
         EndpointReference target = wire.getTarget();
         if (target != null) {
@@ -244,16 +196,14 @@
             RuntimeWire wire = reference.getRuntimeWire(binding);
             Invoker invoker = getInvoker(wire, operation);
             if (invoker == null) {
-                throw new ServiceUnavailableException("Service not found for component " + component.getName()
+                throw new ServiceUnavailableException("Unable to create SCA binding invoker for local target " + component.getName()
                     + " reference "
                     + reference.getName()
                     + " (bindingURI="
                     + binding.getURI()
                     + " operation="
                     + operation.getName()
-                    + "). Ensure that the composite containing the service is loaded and "
-                    + "started somewhere in the SCA domain and that if running in a "
-                    + "remote node that the interface of the target service marked as @Remotable");
+                    + ")" );
             }
             return invoker;
         }

Modified: incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAServiceBindingProvider.java?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAServiceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAServiceBindingProvider.java Thu Apr 24 22:34:47 2008
@@ -70,7 +70,6 @@
             // Check the things that will generally be required to set up a 
             // distributed sca domain reference provider. I.e. make sure that we have a
             // - distributed implementation of the sca binding available
-            // - distributed domain in which to look for remote endpoints 
             // - remotable interface on the service
             if (distributedProviderFactory != null) {
                 
@@ -81,14 +80,7 @@
                     
                 }
                 
-                if (((this.nodeFactory != null) && (this.nodeFactory.getNode() != null)) ||
-                      ((serviceURI != null) &&(serviceURI.isAbsolute()))) {
-                    if (!service.getInterfaceContract().getInterface().isRemotable()) {
-                        throw new IllegalStateException("Reference interface not remoteable for component: "+
-                                                        component.getName() +
-                                                        " and service: " + 
-                                                        service.getName());
-                    }           
+                if ((serviceURI != null) && (serviceURI.isAbsolute())) {          
                     
                     //  create a nested provider to handle the remote case
                     distributedBinding = new DistributedSCABindingImpl();

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=651490&r1=651489&r2=651490&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 Thu Apr 24 22:34:47 2008
@@ -216,64 +216,8 @@
      * @param reference
      */
     private void resolveTargets(RuntimeComponentReference reference) {
-        
-/* 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 
-        //        is currently the SCA binding so we assume that
-        for (ComponentService service : reference.getTargets()) {
-            if (service.isUnresolved()) {
-                for (Binding binding : service.getBindings()) {
-                    
-
-                    //binding.setURI(service.getName());
-                    
-                    // TODO - we should look at all the bindings now associated with the 
-                    //        unresolved target but we assume the SCA binding here as
-                    //        its currently the only wireable one
-                    if (binding instanceof SCABinding) {
-                        OptimizableBinding scaBinding = (OptimizableBinding)binding;
-
-                        // clone the SCA binding and fill in service details 
-                        // its cloned as each target 
-                        SCABinding clonedSCABinding = null;
-                        try {
-                            clonedSCABinding = (SCABinding)((OptimizableBinding)scaBinding).clone();
-                            // TODO - Reusing the name here to store the target name so the 
-                            //        binding can be found again once the URI is set to the real endpoint
-                            clonedSCABinding.setName(service.getName());
-                            clonedSCABinding.setURI(service.getName());
-                            // wireable binding stuff needs to go. SCA binding uses it
-                            // currently to get to the service to work out if the service
-                            // is resolved. 
-                            OptimizableBinding endpoint = ((OptimizableBinding)clonedSCABinding);
-                            endpoint.setTargetComponentService(service);
-                            //endpoint.setTargetComponent(component); - not known for unresolved target
-                            //endpoint.setTargetBinding(serviceBinding); - not known for unresolved target
-
-                            // add the cloned SCA binding to the reference as it will be used to look up the 
-                            // provider later
-                            reference.getBindings().remove(binding);
-                            reference.getBindings().add(clonedSCABinding);
-                        } catch (Exception e) {
-                            // 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(
-                                                        "Unable to create a distributed SCA binding provider for reference: " + reference
-                                                            .getName()
-                                                            + " and target: "
-                                                            + service.getName());
-                     
-                    }
-                }
-            }
-        }
-*/        
+        // The code that used to be here to resolved unresolved targets is now 
+        // at the bottom of BaseWireBuilder.connectComponentReferences()
     }
 
     /**

Copied: incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCaseOFF.java (from r650777, incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCaseOFF.java?p2=incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCaseOFF.java&p1=incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java&r1=650777&r2=651490&rev=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCaseOFF.java Thu Apr 24 22:34:47 2008
@@ -37,7 +37,7 @@
  * This server can be replaced with any registry that is appropriate but the components
  * in each node that talk to the registry should be replaced also. 
  */
-public class DomainImplTestCase {
+public class DomainImplTestCaseOFF {
 
     private static SCADomain domain;
     private static SCADomainEventService domainEventService;
@@ -47,7 +47,7 @@
     public static void init() throws Exception {
              
         try {
-            cl = DomainImplTestCase.class.getClassLoader();
+            cl = DomainImplTestCaseOFF.class.getClassLoader();
             SCADomainFactory domainFactory = SCADomainFactory.newInstance();
             domain = domainFactory.createSCADomain("http://localhost:9999"); 
             domainEventService = (SCADomainEventService)domain;

Modified: incubator/tuscany/java/sca/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-node/src/test/java/org/apache/tuscany/sca/implementation/node/builder/impl/CalculateBindingURITestCase.java Thu Apr 24 22:34:47 2008
@@ -45,8 +45,6 @@
 import org.apache.tuscany.sca.monitor.Problem;
 import org.apache.tuscany.sca.monitor.Problem.Severity;
 
-import com.sun.org.apache.xerces.internal.impl.xs.opti.DefaultNode;
-
 public class CalculateBindingURITestCase extends TestCase {
     private final static Logger logger = Logger.getLogger(CalculateBindingURITestCase.class.getName());
     private AssemblyFactory assemblyFactory;

Copied: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCaseOFF.java (from r650777, 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/DomainDrivenTestCaseOFF.java?p2=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCaseOFF.java&p1=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/DomainDrivenTestCase.java&r1=650777&r2=651490&rev=651490&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/DomainDrivenTestCaseOFF.java Thu Apr 24 22:34:47 2008
@@ -39,7 +39,7 @@
  * Runs a distributed domain in a single VM by using and in memory 
  * implementation of the distributed domain
  */
-public class DomainDrivenTestCase {
+public class DomainDrivenTestCaseOFF {
     
     private static SCADomain domain;
     private static SCANode   nodeA;
@@ -60,7 +60,7 @@
             
             System.out.println("Setting up calculator nodes");
             
-            ClassLoader cl = DomainDrivenTestCase.class.getClassLoader();
+            ClassLoader cl = DomainDrivenTestCaseOFF.class.getClassLoader();
             
             SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
             

Copied: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCaseOFF.java (from r650777, incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCaseOFF.java?p2=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCaseOFF.java&p1=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java&r1=650777&r2=651490&rev=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeDrivenTestCaseOFF.java Thu Apr 24 22:34:47 2008
@@ -40,7 +40,7 @@
  * Runs a distributed domain in a single VM by using and in memory 
  * implementation of the distributed domain
  */
-public class NodeDrivenTestCase {
+public class NodeDrivenTestCaseOFF {
     
     private static SCADomain domain;
     private static SCANode   nodeA;
@@ -64,7 +64,7 @@
             
             System.out.println("Setting up calculator nodes");
             
-            ClassLoader cl = NodeDrivenTestCase.class.getClassLoader();
+            ClassLoader cl = NodeDrivenTestCaseOFF.class.getClassLoader();
             
             SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
             

Copied: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeMemoryTestCaseOFF.java (from r650777, incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeMemoryTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeMemoryTestCaseOFF.java?p2=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeMemoryTestCaseOFF.java&p1=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeMemoryTestCase.java&r1=650777&r2=651490&rev=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeMemoryTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeMemoryTestCaseOFF.java Thu Apr 24 22:34:47 2008
@@ -37,7 +37,7 @@
  * creates and destroys the node to see if memory is being leaked.
  * Looking for leaked memory is a manual task.
  */
-public class NodeMemoryTestCase {
+public class NodeMemoryTestCaseOFF {
     
     @Test
     public void testDoNothing() throws Exception {
@@ -47,7 +47,7 @@
     //@Test
     public void testNodeMemoryUseage() throws Exception {   
         
-        ClassLoader cl = NodeMemoryTestCase.class.getClassLoader();
+        ClassLoader cl = NodeMemoryTestCaseOFF.class.getClassLoader();
         SCANodeFactory nodeFactory;
         SCANode   node;
         CalculatorService calculatorServiceB;

Copied: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/StandaloneNodeTestCaseOFF.java (from r650777, incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/StandaloneNodeTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/StandaloneNodeTestCaseOFF.java?p2=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/StandaloneNodeTestCaseOFF.java&p1=incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/StandaloneNodeTestCase.java&r1=650777&r2=651490&rev=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/StandaloneNodeTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/StandaloneNodeTestCaseOFF.java Thu Apr 24 22:34:47 2008
@@ -38,7 +38,7 @@
  * Runs a distributed domain in a single VM by using and in memory 
  * implementation of the distributed domain
  */
-public class StandaloneNodeTestCase {
+public class StandaloneNodeTestCaseOFF {
     
     private static SCANodeFactory nodeFactory;
     private static SCANode   node;
@@ -56,7 +56,7 @@
         try {
             System.out.println("Setting up add node");
             
-            cl = StandaloneNodeTestCase.class.getClassLoader();
+            cl = StandaloneNodeTestCaseOFF.class.getClassLoader();
             nodeFactory = SCANodeFactory.newInstance();
             
         } catch(Exception ex){

Modified: incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java?rev=651490&r1=651489&r2=651490&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java (original)
+++ incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java Thu Apr 24 22:34:47 2008
@@ -239,6 +239,11 @@
         // Include the node composite in the top-level composite 
         tempComposite.getIncludes().add(composite);
         
+        // set the top level composite on the composite activator as 
+        // logic in callable reference resolution relies on this being 
+        // available
+        compositeActivator.setDomainComposite(tempComposite);
+        
         // Build the composite
         runtime.buildComposite(composite);
     }
@@ -354,6 +359,15 @@
     public ExtensionPointRegistry getExtensionPointRegistry() {
         return runtime.getExtensionPointRegistry();
     }
+    
+    /**
+     * Returns the composite being run by this node.
+     * 
+     * @return
+     */
+    public Composite getComposite() {
+        return composite;
+    }    
 
     /**
      * Returns contribution JARs available on the classpath.