tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r567466 - in /incubator/tuscany/java/sca/modules: binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/ binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/ binding-sca-axis2/src/test/java/org/a...
Date Sun, 19 Aug 2007 21:00:13 GMT
Author: slaws
Date: Sun Aug 19 14:00:11 2007
New Revision: 567466

URL: http://svn.apache.org/viewvc?rev=567466&view=rev
Log: (empty)

Modified:
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/main/java/org/apache/tuscany/sca/binding/sca/axis2/impl/Axis2SCAReferenceBindingProvider.java
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BaseTest.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/helloworld/impl/HelloWorldClient.java
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeA/HelloWorld.composite
    incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeB/HelloWorld.composite
    incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAServiceBindingProvider.java
    incubator/tuscany/java/sca/modules/distributed-impl/src/main/java/org/apache/tuscany/sca/distributed/node/impl/EmbeddedNode.java
    incubator/tuscany/java/sca/modules/distributed-impl/src/test/resources/management/management.composite

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=567466&r1=567465&r2=567466&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
Sun Aug 19 14:00:11 2007
@@ -139,7 +139,8 @@
                                                                      binding.getURI(), 
                                                                      SCABinding.class.getName());
             
-            if (!serviceUrl.equals("")){
+            if ( (serviceUrl != null ) &&
+                 (!serviceUrl.equals(""))){
                 serviceEPR = new EndpointReferenceImpl(serviceUrl);
             }
         }

Modified: incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BaseTest.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/BaseTest.java?rev=567466&r1=567465&r2=567466&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BaseTest.java
(original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/BaseTest.java
Sun Aug 19 14:00:11 2007
@@ -126,8 +126,8 @@
 
         // get a reference to the calculator service from domainA
         // which will be running this component
-        helloWorldClientA = domainA.getService(HelloWorld.class, "HelloWorldClient");
-        //helloWorldClientB = domainB.getService(HelloWorld.class, "HelloWorldClient"); 
     
+        helloWorldClientA = domainA.getService(HelloWorld.class, "HelloWorldClientRemote");
+        helloWorldClientB = domainB.getService(HelloWorld.class, "HelloWorldClientLocal");
      
 
     }
 

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=567466&r1=567465&r2=567466&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
Sun Aug 19 14:00:11 2007
@@ -25,13 +25,18 @@
 public class SimpleTestCase extends BaseTest {
     
     @Test
-    public void testHelloWorld() throws Exception {    
+    public void testHelloWorldRemote() throws Exception {    
         
-        System.out.println(helloWorldClientA.getGreetings("fred"));
+        //System.out.println(helloWorldClientA.getGreetings("fred"));
         
-        // Calculate
         Assert.assertEquals(helloWorldClientA.getGreetings("fred"), "Hello fred");
         
     }
-
+    
+    @Test
+    public void testHelloWorldLocalAndRemote() throws Exception {    
+                
+        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/helloworld/impl/HelloWorldClient.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/helloworld/impl/HelloWorldClient.java?rev=567466&r1=567465&r2=567466&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClient.java
(original)
+++ incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClient.java
Sun Aug 19 14:00:11 2007
@@ -26,10 +26,10 @@
 public class HelloWorldClient implements HelloWorld {
 
     @Reference
-    public HelloWorldRemote helloWorldWS;
+    public HelloWorldRemote helloWorldService;
     
     public String getGreetings(String s) {
-        return helloWorldWS.getGreetings(s);
+        return helloWorldService.getGreetings(s);
     }
 
 }

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=567466&r1=567465&r2=567466&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
Sun Aug 19 14:00:11 2007
@@ -22,9 +22,9 @@
            xmlns:sample="http://sample"
            name="HelloWorld">
 
-    <component name="HelloWorldClient">
+    <component name="HelloWorldClientRemote">
 		<implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClient"
/>
-        <reference name="helloWorldWS" target="HelloWorldService" />
+        <reference name="helloWorldService" target="HelloWorldServiceRemote" />
     </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=567466&r1=567465&r2=567466&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
Sun Aug 19 14:00:11 2007
@@ -22,8 +22,17 @@
            xmlns:sample="http://sample"
            name="HelloWorld">
            
-    <component name="HelloWorldService">
+    <component name="HelloWorldServiceLocal">
+        <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldService"
/>
+    </component>
+               
+    <component name="HelloWorldServiceRemote">
         <implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceRemote"
/>
+    </component>
+    
+    <component name="HelloWorldClientLocal">
+		<implementation.java class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClient"
/>
+        <reference name="helloWorldService" target="HelloWorldService" />
     </component>
     
 </composite>

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=567466&r1=567465&r2=567466&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
Sun Aug 19 14:00:11 2007
@@ -80,54 +80,62 @@
             // - distributed implementation of the sca binding available
             // - distributed domain in which to look for remote endpoints 
             // - remotable interface on the service
-            if (distributedProviderFactory == null) {
+            if (distributedProviderFactory != null) {
+                if (((SCABindingImpl)binding).getDistributedDomain() != null) {
+                    if (!service.getInterfaceContract().getInterface().isRemotable()) {
+                        throw new IllegalStateException("Reference interface not remoteable
for component: "+
+                                                        component.getName() +
+                                                        " and service: " + 
+                                                        service.getName());
+                    }           
+                    
+                    //  create a nested provider to handle the remote case
+                    distributedBinding = new DistributedSCABindingImpl();
+                    distributedBinding.setSCABinging(binding);
+                    
+                    distributedProvider = (ServiceBindingProvider2)
+                                          distributedProviderFactory.createServiceBindingProvider(component,
service, distributedBinding);
+                    
+                    // get the url out of the binding and send it to the registry if
+                    // a distributed domain is configured
+                    DistributedSCADomain distributedDomain = ((SCABindingImpl)binding).getDistributedDomain();
+                    
+                    ServiceDiscovery serviceDiscovery = distributedDomain.getServiceDiscovery();
+                    
+                    // register endpoint twice to take account the formats 
+                    //  ComponentName
+                    //  ComponentName/ServiceName
+                    // TODO - Can't we get this from somewhere? What happens with nested
components. 
+                    serviceDiscovery.registerServiceEndpoint(distributedDomain.getDomainName(),

+                                                             distributedDomain.getNodeName(),

+                                                             component.getName(), 
+                                                             SCABinding.class.getName(),

+                                                             binding.getURI());
+                    serviceDiscovery.registerServiceEndpoint(distributedDomain.getDomainName(),

+                                                             distributedDomain.getNodeName(),

+                                                             component.getName() + "/" +
service.getName(), 
+                                                             SCABinding.class.getName(),

+                                                             binding.getURI());
+                
+                } else {
+                     /* do nothing at the moment as only apps using the node inplementation
+                      * will currently have the distributed domain set. 
+                      * 
+                    throw new IllegalStateException("No distributed domain available for
component: "+
+                            component.getName() +
+                            " and service: " + 
+                            service.getName());
+                    */
+                }
+            } else {
+                /* do nothing at the moment as all services with remotable interfaces
+                 * are marked as remote
                 throw new IllegalStateException("No distributed SCA binding available for
component: "+
-                                                component.getName() +
-                                                " and service: " + 
-                                                service.getName());
+                        component.getName() +
+                        " and service: " + 
+                        service.getName());
+                */
             }
-            
-            if (((SCABindingImpl)binding).getDistributedDomain() == null) {
-                throw new IllegalStateException("No distributed domain available for component:
"+
-                                                component.getName() +
-                                                " and service: " + 
-                                                service.getName());
-            }
-            
-            if (!service.getInterfaceContract().getInterface().isRemotable()) {
-                throw new IllegalStateException("Reference interface not remoteable for component:
"+
-                                                component.getName() +
-                                                " and service: " + 
-                                                service.getName());
-            }           
-            
-            //  create a nested provider to handle the remote case
-            distributedBinding = new DistributedSCABindingImpl();
-            distributedBinding.setSCABinging(binding);
-            
-            distributedProvider = (ServiceBindingProvider2)
-                                  distributedProviderFactory.createServiceBindingProvider(component,
service, distributedBinding);
-            
-            // get the url out of the binding and send it to the registry if
-            // a distributed domain is configured
-            DistributedSCADomain distributedDomain = ((SCABindingImpl)binding).getDistributedDomain();
-            
-            ServiceDiscovery serviceDiscovery = distributedDomain.getServiceDiscovery();
-            
-            // register endpoint twice to take account the formats 
-            //  ComponentName
-            //  ComponentName/ServiceName
-            // TODO - Can't we get this from somewhere? What happens with nested components.

-            serviceDiscovery.registerServiceEndpoint(distributedDomain.getDomainName(), 
-                                                     distributedDomain.getNodeName(), 
-                                                     component.getName(), 
-                                                     SCABinding.class.getName(), 
-                                                     binding.getURI());
-            serviceDiscovery.registerServiceEndpoint(distributedDomain.getDomainName(), 
-                                                     distributedDomain.getNodeName(), 
-                                                     component.getName() + "/" + service.getName(),

-                                                     SCABinding.class.getName(), 
-                                                     binding.getURI());
         } 
     }
 

Modified: incubator/tuscany/java/sca/modules/distributed-impl/src/main/java/org/apache/tuscany/sca/distributed/node/impl/EmbeddedNode.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/distributed-impl/src/main/java/org/apache/tuscany/sca/distributed/node/impl/EmbeddedNode.java?rev=567466&r1=567465&r2=567466&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/distributed-impl/src/main/java/org/apache/tuscany/sca/distributed/node/impl/EmbeddedNode.java
(original)
+++ incubator/tuscany/java/sca/modules/distributed-impl/src/main/java/org/apache/tuscany/sca/distributed/node/impl/EmbeddedNode.java
Sun Aug 19 14:00:11 2007
@@ -157,7 +157,7 @@
                 contributionURL = Thread.currentThread().getContextClassLoader().getResource(nodeName
+ "/");
             } 
          
-            addContribution(domainName, contributionURL);
+            loadContribution(domainName, contributionURL);
         
         } catch(ActivationException ex) {
             throw ex;

Modified: incubator/tuscany/java/sca/modules/distributed-impl/src/test/resources/management/management.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/distributed-impl/src/test/resources/management/management.composite?rev=567466&r1=567465&r2=567466&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/distributed-impl/src/test/resources/management/management.composite
(original)
+++ incubator/tuscany/java/sca/modules/distributed-impl/src/test/resources/management/management.composite
Sun Aug 19 14:00:11 2007
@@ -26,6 +26,7 @@
     <component name="ServiceDiscoveryComponent">
         <implementation.java class="org.apache.tuscany.sca.distributed.management.impl.ServiceDiscoveryNetworkImpl"
/>
         <reference name="serviceDiscovery">
+            <interface.java interface="org.apache.tuscany.sca.distributed.management.ServiceDiscovery"
/>
             <binding.ws uri="http://localhost:8080/ServiceDiscoveryComponent/ServiceDiscovery"/>
         </reference>
     </component>



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


Mime
View raw message