Author: slaws
Date: Thu Aug 23 16:22:38 2007
New Revision: 569182

URL: http://svn.apache.org/viewvc?rev=569182&view=rev
Log:
Enable one way operation for the remote version of the sca binding

Added:
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/sca-contribution.xml
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/sca-contribution.xml
Modified:
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
    
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
    
incubator/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java

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=569182&r1=569181&r2=569182&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 Aug 23 16:22:38 2007
@@ -18,17 +18,11 @@
  */
 package org.apache.tuscany.sca.binding.sca.axis2;
 
-import java.net.URL;
 
 import junit.framework.Assert;
 
-import org.apache.tuscany.sca.assembly.Composite;
 import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
-import 
org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceLocal;
-import 
org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceRemote;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.service.ContributionService;
-import org.apache.tuscany.sca.distributed.domain.DistributedSCADomain;
+import 
org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl;
 import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -45,8 +39,8 @@
 
         try {
             // create and start domainA
-            domainA = createDomain("nodeE");
-            domainB = createDomain("nodeF");
+            domainA = createDomain("nodeG");
+            domainB = createDomain("nodeH");
             startDomain(domainA);
             startDomain(domainB);
 
@@ -65,12 +59,15 @@
     }   
     
     @Test
-    public void testHelloWorldAsynch() throws Exception {  
-/*        
+    public void testHelloWorldAsynch() throws Exception {        
         HelloWorldClient helloWorldClientB;
-        helloWorldClientB = domainB.getService(HelloWorldClient.class, 
"BHelloWorldClientCallbackLocal");
-        Assert.assertEquals("Hello callback fred", 
helloWorldClientB.getGreetings("fred"));  
-*/        
+        helloWorldClientB = domainA.getService(HelloWorldClient.class, 
"AHelloWorldClientCallbackRemote");
+        helloWorldClientB.getGreetings("fred");
+        System.out.println("Sleeping ...");
+        Thread.sleep(2000);
+        System.out.println("... Done");
+        Assert.assertEquals("callback fred", 
HelloWorldClientCallbackOnewayRemoteImpl.result );
+        
     }      
        
     

Added: 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.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/HelloWorldServiceCallbackOnewayRemote.java?rev=569182&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
 Thu Aug 23 16:22:38 2007
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.binding.sca.axis2.helloworld;
+
+import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.OneWay;
+import org.osoa.sca.annotations.Remotable;
+
[EMAIL PROTECTED]
[EMAIL PROTECTED](HelloWorldCallbackRemote.class)
+public interface HelloWorldServiceCallbackOnewayRemote {
+    
+    @OneWay
+    public void getGreetingsRemote(String s);
+
+}

Added: 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.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/HelloWorldClientCallbackOnewayRemoteImpl.java?rev=569182&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
 Thu Aug 23 16:22:38 2007
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl;
+
+import org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldClient;
+import 
org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackOnewayRemote;
+import 
org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackRemote;
+import org.osoa.sca.annotations.Reference;
+
+public class HelloWorldClientCallbackOnewayRemoteImpl implements 
HelloWorldClient {
+    
+    public static String result;
+
+    @Reference
+    public HelloWorldServiceCallbackOnewayRemote helloWorldService;
+    
+    public String getGreetings(String s) {
+        helloWorldService.getGreetingsRemote(s);
+        return null;
+    }
+    
+    public String getGreetingsCallbackRemote(String s) {
+        result =  "callback " + s;
+        return result;
+    }
+
+}

Modified: 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.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/HelloWorldClientCallbackRemoteImpl.java?rev=569182&r1=569181&r2=569182&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
 Thu Aug 23 16:22:38 2007
@@ -24,6 +24,8 @@
 import org.osoa.sca.annotations.Reference;
 
 public class HelloWorldClientCallbackRemoteImpl implements HelloWorldClient {
+    
+    public static String result;
 
     @Reference
     public HelloWorldServiceCallbackRemote helloWorldService;
@@ -33,7 +35,8 @@
     }
     
     public String getGreetingsCallbackRemote(String s) {
-        return "callback " + s;
+        result =  "callback " + s;
+        return result;
     }
 
 }

Added: 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.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/HelloWorldServiceCallbackOnewayRemoteImpl.java?rev=569182&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
 Thu Aug 23 16:22:38 2007
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl;
+
+import 
org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldCallbackRemote;
+import 
org.apache.tuscany.sca.binding.sca.axis2.helloworld.HelloWorldServiceCallbackOnewayRemote;
+import org.osoa.sca.annotations.Callback;
+
+
+public class HelloWorldServiceCallbackOnewayRemoteImpl implements 
HelloWorldServiceCallbackOnewayRemote {
+
+    @Callback
+    protected HelloWorldCallbackRemote theCallback;
+
+    public void getGreetingsRemote(String s) {
+        theCallback.getGreetingsCallbackRemote(s);
+    }
+
+}

Added: 
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=569182&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite
 (added)
+++ 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/HelloWorld.composite
 Thu Aug 23 16:22:38 2007
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
+           targetNamespace="http://sample";
+           xmlns:sample="http://sample";
+           name="HelloWorld">
+   
+    <!-- callback remote wire -->   
+    <component name="AHelloWorldClientCallbackRemote">
+               <implementation.java 
class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldClientCallbackOnewayRemoteImpl"
 />
+        <reference name="helloWorldService" 
target="BHelloWorldServiceCallbackRemote" />
+    </component>
+    
+</composite>

Added: 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/sca-contribution.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/sca-contribution.xml?rev=569182&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/sca-contribution.xml
 (added)
+++ 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeG/META-INF/sca-contribution.xml
 Thu Aug 23 16:22:38 2007
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * Licensed to the Apache Software Foundation (ASF) under one
+    * or more contributor license agreements.  See the NOTICE file
+    * distributed with this work for additional information
+    * regarding copyright ownership.  The ASF licenses this file
+    * to you under the Apache License, Version 2.0 (the
+    * "License"); you may not use this file except in compliance
+    * with the License.  You may obtain a copy of the License at
+    * 
+    *   http://www.apache.org/licenses/LICENSE-2.0
+    * 
+    * Unless required by applicable law or agreed to in writing,
+    * software distributed under the License is distributed on an
+    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    * KIND, either express or implied.  See the License for the
+    * specific language governing permissions and limitations
+    * under the License.    
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0";
+             targetNamespace="http://sample";
+              xmlns:sample="http://sample";>
+   <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file

Added: 
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=569182&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite
 (added)
+++ 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/HelloWorld.composite
 Thu Aug 23 16:22:38 2007
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
+           targetNamespace="http://sample";
+           xmlns:sample="http://sample";
+           name="HelloWorld">
+            
+     
+    <!-- callback remote wire --> 
+    <component name="BHelloWorldServiceCallbackRemote">
+        <implementation.java 
class="org.apache.tuscany.sca.binding.sca.axis2.helloworld.impl.HelloWorldServiceCallbackOnewayRemoteImpl"
 />
+        <service name="HelloWorldServiceCallbackOnewayRemote">
+            <!-- explicit uri required as callback service will also come up 
on 8085 -->
+            <binding.sca 
uri="http://localhost:8086/BHelloWorldServiceCallbackRemote"/>
+        </service>
+    </component>
+    
+
+</composite>

Added: 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/sca-contribution.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/sca-contribution.xml?rev=569182&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/sca-contribution.xml
 (added)
+++ 
incubator/tuscany/java/sca/modules/binding-sca-axis2/src/test/resources/nodeH/META-INF/sca-contribution.xml
 Thu Aug 23 16:22:38 2007
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * Licensed to the Apache Software Foundation (ASF) under one
+    * or more contributor license agreements.  See the NOTICE file
+    * distributed with this work for additional information
+    * regarding copyright ownership.  The ASF licenses this file
+    * to you under the Apache License, Version 2.0 (the
+    * "License"); you may not use this file except in compliance
+    * with the License.  You may obtain a copy of the License at
+    * 
+    *   http://www.apache.org/licenses/LICENSE-2.0
+    * 
+    * Unless required by applicable law or agreed to in writing,
+    * software distributed under the License is distributed on an
+    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    * KIND, either express or implied.  See the License for the
+    * specific language governing permissions and limitations
+    * under the License.    
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0";
+             targetNamespace="http://sample";
+              xmlns:sample="http://sample";>
+   <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file

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=569182&r1=569181&r2=569182&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 Aug 23 16:22:38 2007
@@ -164,7 +164,11 @@
     }
 
     public boolean supportsAsyncOneWayInvocation() {
-        return false;
+        if (isTargetRemote()) {
+            return distributedProvider.supportsAsyncOneWayInvocation();
+        } else {
+            return false;
+        }        
     }
     
     /**



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

Reply via email to