You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/07/31 00:11:47 UTC

svn commit: r681221 - in /tuscany/java/sca: itest/corba/ itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ itest/corba/src/test/resources/ modules/binding-corba-runtime/src/m...

Author: rfeng
Date: Wed Jul 30 15:11:46 2008
New Revision: 681221

URL: http://svn.apache.org/viewvc?rev=681221&view=rev
Log:
Apply the patch for TUSCANY-2469 from Wojtek. (sca-binding-sdo-problem-jira-2469-30-july.patch)

Added:
    tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java   (with props)
    tuscany/java/sca/itest/corba/src/test/resources/scenariofour.xsd   (with props)
    tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java   (with props)
    tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java   (with props)
Modified:
    tuscany/java/sca/itest/corba/pom.xml
    tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFourTestCase.java
    tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFour.java
    tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourImpl.java
    tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java
    tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java
    tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaServantTestCase.java
    tuscany/java/sca/modules/binding-sca-corba/pom.xml
    tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCABindingProviderFactory.java
    tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAReferenceBindingProvider.java
    tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAServiceBindingProvider.java
    tuscany/java/sca/modules/host-corba-jdk/src/test/java/org/apache/tuscany/sca/host/corba/testing/DefaultCorbaHostTestCase.java   (props changed)

Modified: tuscany/java/sca/itest/corba/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/corba/pom.xml?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/itest/corba/pom.xml (original)
+++ tuscany/java/sca/itest/corba/pom.xml Wed Jul 30 15:11:46 2008
@@ -1,73 +1,162 @@
 <?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.    
+	* 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.    
 -->
 <project>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.tuscany.sca</groupId>
-        <artifactId>tuscany-itest</artifactId>
-        <version>1.4-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-    <artifactId>itest-corba-binding</artifactId>
-    <name>Apache Tuscany SCA CORBA Binding Integration Tests</name>
-    <dependencies>
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.tuscany.sca</groupId>
+		<artifactId>tuscany-itest</artifactId>
+		<version>1.4-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+	<artifactId>itest-corba-binding</artifactId>
+	<name>Apache Tuscany SCA CORBA Binding Integration Tests</name>
+	<dependencies>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-host-embedded</artifactId>
+			<version>1.4-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-implementation-java-runtime</artifactId>
+			<version>1.4-SNAPSHOT</version>
+			<scope>runtime</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-binding-corba-runtime</artifactId>
+			<version>1.4-SNAPSHOT</version>
+			<scope>runtime</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-host-corba-jdk</artifactId>
+			<version>1.4-SNAPSHOT</version>
+			<scope>runtime</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-binding-sca</artifactId>
+			<version>1.4-SNAPSHOT</version>
+			<scope>runtime</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-binding-sca-corba</artifactId>
+			<version>1.4-SNAPSHOT</version>
+			<scope>runtime</scope>
+		</dependency>
+
+<!-- 
+		<dependency>
+			<groupId>org.apache.ws.commons.axiom</groupId>
+			<artifactId>axiom-api</artifactId>
+			<exclusions>
+				<exclusion>
+					<groupId>xerces</groupId>
+					<artifactId>xercesImpl</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>stax</groupId>
+					<artifactId>stax-api</artifactId>
+				</exclusion>
+			</exclusions>
+			<version>1.2.5</version>
+		</dependency>
+ -->        
+
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-embedded</artifactId>
-            <version>1.4-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-java-runtime</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-corba-runtime</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-host-corba-jdk</artifactId>
+            <artifactId>tuscany-databinding-axiom</artifactId>
             <version>1.4-SNAPSHOT</version>
             <scope>runtime</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-sca</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-sca-corba</artifactId>
-            <version>1.4-SNAPSHOT</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.2</version>
-            <scope>compile</scope>
-        </dependency>
-    </dependencies>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-databinding-sdo</artifactId>
+			<version>1.4-SNAPSHOT</version>
+			<scope>compile</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.2</version>
+			<scope>compile</scope>
+		</dependency>
+
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>build-helper-maven-plugin</artifactId>
+				<version>1.0</version>
+				<executions>
+					<execution>
+						<id>add-source</id>
+						<phase>generate-sources</phase>
+						<goals>
+							<goal>add-test-source</goal>
+						</goals>
+						<configuration>
+							<sources>
+								<source>target/sdo-source</source>
+							</sources>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.tuscany.sdo</groupId>
+				<artifactId>tuscany-sdo-plugin</artifactId>
+				<version>1.1-incubating</version>
+				<executions>
+					<execution>
+						<id>generate-scenariofour-sdo</id>
+						<phase>generate-sources</phase>
+						<configuration>
+							<schemaFile>
+								${basedir}/src/test/resources/scenariofour.xsd
+							</schemaFile>
+							<javaPackage>
+								org.apache.tuscany.sca.test.corba.scenariofour
+							</javaPackage>
+							<prefix>ScenarioFour</prefix>
+							<noNotification>true</noNotification>
+							<noContainer>true</noContainer>
+							<noUnsettable>true</noUnsettable>
+						</configuration>
+						<goals>
+							<goal>generate</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
 </project>

Modified: tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFourTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFourTestCase.java?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFourTestCase.java (original)
+++ tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFourTestCase.java Wed Jul 30 15:11:46 2008
@@ -26,13 +26,17 @@
 import org.apache.tuscany.sca.host.corba.naming.TransientNameServer;
 import org.apache.tuscany.sca.host.corba.naming.TransientNameService;
 import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.test.corba.scenariofour.ScenarioFourFactory;
+import org.apache.tuscany.sca.test.corba.scenariofour.ScenarioFourSdo;
 import org.apache.tuscany.sca.test.corba.types.ScenarioFour;
 import org.apache.tuscany.sca.test.corba.types.ScenarioFourComponent;
+import org.apache.tuscany.sca.test.corba.types.ScenarioFourException;
 import org.apache.tuscany.sca.test.corba.types.ScenarioFourStruct;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+
 /**
  * Tests SCA default binding over CORBA binding
  */
@@ -42,6 +46,8 @@
     private static int ORB_INITIAL_PORT = 5060;
     private static SCADomain domain;
     private static TransientNameServer server;
+    private static ScenarioFourComponent scenarioFourComponent;
+    private static ScenarioFour scenarioFour;
 
     /**
      * Sets up name service, creates and registers traditional CORBA service,
@@ -63,6 +69,8 @@
             }
             // obtain domain
             domain = SCADomain.newInstance("ScenarioFour.composite");
+            scenarioFourComponent = domain.getService(ScenarioFourComponent.class, "ScenarioFour");
+            scenarioFour = scenarioFourComponent.getScenarioFour();
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -76,16 +84,17 @@
         server.stop();
     }
 
+    /**
+     * General tests for passing JAXB objects
+     */
     @Test
-    public void test_generalTest() {
+    public void test_generalJAXB() {
         try {
-            ScenarioFourComponent soc = domain.getService(ScenarioFourComponent.class, "ScenarioFour");
-            ScenarioFour so = soc.getScenarioFour();
             ScenarioFourStruct input = new ScenarioFourStruct();
             input.field1 = "Test";
             input.field2 = 1;
             input.field3 = new double[1];
-            ScenarioFourStruct output = so.setStruct(input);
+            ScenarioFourStruct output = scenarioFour.setStruct(input);
             assertTrue(input.equals(output));
         } catch (Exception e) {
             e.printStackTrace();
@@ -93,4 +102,36 @@
         }
     }
     
+    /**
+     * Test for JAXB exceptions
+     */
+    @Test
+    public void test_exceptionsJAXB() {
+        try {
+            scenarioFour.exceptionTest();
+            fail();
+        } catch (ScenarioFourException e) {
+            assertTrue(ScenarioFourException.DEFAULT_CONTENT.equals(e.getContent()));
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail();
+        }
+    }
+    
+    /**
+     * General test for passing SDO objects
+     */
+    @Test
+    public void test_generalSDO() {
+        try {
+            ScenarioFourSdo scenarioFourSdo = ScenarioFourFactory.INSTANCE.createScenarioFourSdo();
+            scenarioFourSdo.setMessage("Test1");
+            scenarioFourSdo.setSymbol("Test2");
+            ScenarioFourSdo result = scenarioFour.passScenarioFourStruct(scenarioFourSdo);
+            assertTrue(scenarioFourSdo.getMessage().equals(result.getMessage()) && scenarioFourSdo.getSymbol().equals(result.getSymbol()));
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail();
+        }
+    }    
 }

Modified: tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFour.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFour.java?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFour.java (original)
+++ tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFour.java Wed Jul 30 15:11:46 2008
@@ -19,6 +19,7 @@
 
 package org.apache.tuscany.sca.test.corba.types;
 
+import org.apache.tuscany.sca.test.corba.scenariofour.ScenarioFourSdo;
 import org.osoa.sca.annotations.Remotable;
 
 /**
@@ -29,4 +30,8 @@
 
     ScenarioFourStruct setStruct(ScenarioFourStruct struct);
 
+    void exceptionTest() throws ScenarioFourException;
+
+    ScenarioFourSdo passScenarioFourStruct(ScenarioFourSdo scenarioFourSdo);
+
 }

Added: tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java?rev=681221&view=auto
==============================================================================
--- tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java (added)
+++ tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java Wed Jul 30 15:11:46 2008
@@ -0,0 +1,37 @@
+/*
+ * 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.test.corba.types;
+
+public class ScenarioFourException extends Exception {
+
+    public static final String DEFAULT_CONTENT = "Test";
+    
+    private static final long serialVersionUID = 1L;
+    private String content;
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+}

Propchange: tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourImpl.java?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourImpl.java (original)
+++ tuscany/java/sca/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourImpl.java Wed Jul 30 15:11:46 2008
@@ -19,6 +19,8 @@
 
 package org.apache.tuscany.sca.test.corba.types;
 
+import org.apache.tuscany.sca.test.corba.scenariofour.ScenarioFourSdo;
+
 /**
  * Implementation of ScenarioFour service
  */
@@ -28,4 +30,14 @@
         return struct;
     }
 
+    public void exceptionTest() throws ScenarioFourException {
+        ScenarioFourException exception = new ScenarioFourException();
+        exception.setContent(ScenarioFourException.DEFAULT_CONTENT);
+        throw exception;
+    }
+
+    public ScenarioFourSdo passScenarioFourStruct(ScenarioFourSdo scenarioFourSdo) {
+        return scenarioFourSdo;
+    }
+
 }

Added: tuscany/java/sca/itest/corba/src/test/resources/scenariofour.xsd
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/corba/src/test/resources/scenariofour.xsd?rev=681221&view=auto
==============================================================================
--- tuscany/java/sca/itest/corba/src/test/resources/scenariofour.xsd (added)
+++ tuscany/java/sca/itest/corba/src/test/resources/scenariofour.xsd Wed Jul 30 15:11:46 2008
@@ -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.    
+-->
+<schema targetNamespace="http://example.com/scenariofour" xmlns="http://www.w3.org/2001/XMLSchema">
+
+    <element name="ScenarioFourSdo">
+        <complexType>
+            <sequence>
+                <element name="message" minOccurs="1" type="string" />
+                <element name="symbol" minOccurs="1" type="string" />
+            </sequence>
+        </complexType>
+    </element>
+
+</schema>

Propchange: tuscany/java/sca/itest/corba/src/test/resources/scenariofour.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/itest/corba/src/test/resources/scenariofour.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java (original)
+++ tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/CorbaServiceBindingProvider.java Wed Jul 30 15:11:46 2008
@@ -20,9 +20,13 @@
 package org.apache.tuscany.sca.binding.corba.impl;
 
 import org.apache.tuscany.sca.binding.corba.CorbaBinding;
+import org.apache.tuscany.sca.binding.corba.impl.service.ComponentInvocationProxy;
 import org.apache.tuscany.sca.binding.corba.impl.service.DynaCorbaServant;
+import org.apache.tuscany.sca.binding.corba.impl.service.InvocationProxy;
+import org.apache.tuscany.sca.binding.corba.impl.types.util.Utils;
 import org.apache.tuscany.sca.host.corba.CorbaHost;
 import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
 import org.apache.tuscany.sca.provider.ServiceBindingProvider;
 import org.apache.tuscany.sca.runtime.RuntimeComponentService;
 import org.osoa.sca.ServiceRuntimeException;
@@ -55,7 +59,9 @@
      */
     public void start() {
         try {
-            servant = new DynaCorbaServant(service, binding);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(binding), javaClass);
+            servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             servant.setIds(new String[] {binding.getId()});
             host.registerServant(binding.getCorbaname(), servant);
         } catch (Exception e) {

Modified: tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java (original)
+++ tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/DynaCorbaServant.java Wed Jul 30 15:11:46 2008
@@ -19,24 +19,14 @@
 
 package org.apache.tuscany.sca.binding.corba.impl.service;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
-import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
 import org.apache.tuscany.sca.binding.corba.impl.types.TypeTree;
 import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeCreator;
 import org.apache.tuscany.sca.binding.corba.impl.types.util.TypeHelpersProxy;
 import org.apache.tuscany.sca.binding.corba.impl.types.util.Utils;
-import org.apache.tuscany.sca.binding.corba.impl.util.OperationMapper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
 import org.omg.CORBA.MARSHAL;
 import org.omg.CORBA.portable.InputStream;
 import org.omg.CORBA.portable.InvokeHandler;
@@ -49,114 +39,23 @@
  */
 public class DynaCorbaServant extends ObjectImpl implements InvokeHandler {
 
-    private RuntimeComponentService service;
-    private Binding binding;
     private String[] ids;
-    private Map<Operation, OperationTypes> operationsCache = new HashMap<Operation, OperationTypes>();
-    private Class<?> javaClass;
-    private Map<String, Method> operationsMap;
-    private Map<Method, Operation> methodOperationMapping;
-    private boolean scaBindingRules;
-    
-    /**
-     * Creates servant with CORBA binding mapping rules in default
-     * 
-     * @param service backed service
-     * @param binding binding object
-     * @throws RequestConfigurationException
-     */
-    public DynaCorbaServant(RuntimeComponentService service, Binding binding) throws RequestConfigurationException {
-        // use CORBA binding rules by default 
-        this(service, binding, false);
-    }
+    private InvocationProxy invocationProxy;
+    private String typeId;
     
     /**
      * Creates servant object
-     * 
-     * @param service backed service
-     * @param binding binding object
-     * @param scaBindingRules apply SCA default binding mapping rules
+     * @param invocationProxy
+     * @param typeId
      * @throws RequestConfigurationException
      */
-    public DynaCorbaServant(RuntimeComponentService service, Binding binding, boolean scaBindingRules) throws RequestConfigurationException {
-        this.scaBindingRules = scaBindingRules;
-        this.service = service;
-        this.binding = binding;
-        this.javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
-        this.operationsMap = OperationMapper.mapOperationToMethod(javaClass);
-        cacheOperationTypes(service.getInterfaceContract().getInterface().getOperations());
-        createMethod2OperationMapping();
+    public DynaCorbaServant(InvocationProxy invocationProxy, String typeId) throws RequestConfigurationException {
+        this.invocationProxy = invocationProxy;
+        this.typeId = typeId;
         setDefaultIds();
     }
 
     /**
-     * Maps Java methods to Tuscany operations
-     */
-    private void createMethod2OperationMapping() {
-        // for every operation find all methods with the same name, then
-        // compare operations and methods parameters
-        this.methodOperationMapping = new HashMap<Method, Operation>();
-        for (Operation operation : service.getInterfaceContract().getInterface().getOperations()) {
-            List<DataType> inputTypes = operation.getInputType().getLogical();
-            Method[] methods = javaClass.getMethods();
-            for (int i = 0; i < methods.length; i++) {
-                if (methods[i].getName().equals(operation.getName()) && inputTypes.size() == methods[i]
-                    .getParameterTypes().length) {
-                    Class<?>[] parameterTypes = methods[i].getParameterTypes();
-                    int j = 0;
-                    boolean parameterMatch = true;
-                    for (DataType dataType : inputTypes) {
-                        if (!dataType.getPhysical().equals(parameterTypes[j])) {
-                            parameterMatch = false;
-                            break;
-                        }
-                        j++;
-                    }
-                    if (parameterMatch) {
-                        // match found
-                        methodOperationMapping.put(methods[i], operation);
-                        break;
-                    }
-                }
-            }
-
-        }
-    }
-
-    /**
-     * Caches TypeTree for every operation in backed component
-     * @param operations
-     * @throws RequestConfigurationException
-     */
-    private void cacheOperationTypes(List<Operation> operations) throws RequestConfigurationException {
-        for (Operation operation : operations) {
-            try {
-                OperationTypes operationTypes = new OperationTypes();
-                List<TypeTree> inputInstances = new ArrayList<TypeTree>();
-                // cache output type tree
-                if (operation.getOutputType() != null && operation.getOutputType().getPhysical() != null
-                    && !operation.getOutputType().getPhysical().equals(void.class)) {
-                    TypeTree outputType = TypeTreeCreator.createTypeTree(operation.getOutputType().getPhysical(), scaBindingRules);
-                    operationTypes.setOutputType(outputType);
-                }
-                // cache input types trees
-                if (operation.getInputType() != null) {
-                    for (DataType<List<DataType>> type : operation.getInputType().getLogical()) {
-                        Class<?> forClass = type.getPhysical();
-                        TypeTree inputType = TypeTreeCreator.createTypeTree(forClass, scaBindingRules);
-                        inputInstances.add(inputType);
-                    }
-
-                }
-                operationTypes.setInputType(inputInstances);
-                operationsCache.put(operation, operationTypes);
-            } catch (RequestConfigurationException e) {
-                throw e;
-            }
-        }
-    }
-
-    /**
      * Sets CORBA object ID
      * @param ids
      */
@@ -172,16 +71,12 @@
     }
 
     public OutputStream _invoke(String operationName, InputStream in, ResponseHandler rh) {
-        Operation operation = null;
-        Method method = operationsMap.get(operationName);
-        // searching for proper operation
-        operation = methodOperationMapping.get(method);
-        if (operation == null) {
+        OperationTypes types = invocationProxy.getOperationTypes(operationName);
+        if (types == null) {
             // operation wasn't found
             throw new org.omg.CORBA.BAD_OPERATION(0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
         } else {
             List<Object> inputInstances = new ArrayList<Object>();
-            OperationTypes types = operationsCache.get(operation);
             try {
                 // retrieving in arguments
                 for (TypeTree tree : types.getInputType()) {
@@ -195,19 +90,19 @@
             }
             try {
                 // invocation and sending result
-                Object result = service.getRuntimeWire(binding).invoke(operation, inputInstances.toArray());
+                Object result = invocationProxy.invoke(operationName, inputInstances);
                 OutputStream out = rh.createReply();
                 if (types.getOutputType() != null) {
                     TypeTree tree = types.getOutputType();
                     TypeHelpersProxy.write(tree.getRootNode(), out, result);
                 }
                 return out;
-            } catch (InvocationTargetException ie) {
+            } catch (InvocationException ie) {
                 // handling user exception
                 try {
                     OutputStream out = rh.createExceptionReply();
                     Class<?> exceptionClass = ie.getTargetException().getClass();
-                    TypeTree tree = TypeTreeCreator.createTypeTree(exceptionClass, scaBindingRules);
+                    TypeTree tree = TypeTreeCreator.createTypeTree(exceptionClass, false);
                     String exceptionId = Utils.getTypeId(exceptionClass);
                     out.write_string(exceptionId);
                     TypeHelpersProxy.write(tree.getRootNode(), out, ie.getTargetException());
@@ -234,8 +129,7 @@
      * Sets servant ID to default, based on Java class name
      */
     private void setDefaultIds() {
-        String id = Utils.getTypeId(javaClass);
-        this.ids = new String[] {id};
+        this.ids = new String[] {typeId};
     }
 
 }

Added: tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java?rev=681221&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java (added)
+++ tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java Wed Jul 30 15:11:46 2008
@@ -0,0 +1,45 @@
+/*
+ * 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.corba.impl.service;
+
+import java.util.List;
+
+/**
+ * Target proxy interface for service bindings
+ */
+public interface InvocationProxy {
+
+    /**
+     * Gets operations types for target
+     * @param operationName
+     * @return
+     */
+    public OperationTypes getOperationTypes(String operationName);
+    
+    /**
+     * Invokes target operation
+     * @param operationName
+     * @param arguments
+     * @return
+     * @throws InvocationException
+     */
+    public Object invoke(String operationName, List<Object> arguments) throws InvocationException;
+    
+}

Propchange: tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/impl/service/InvocationProxy.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaServantTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaServantTestCase.java?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaServantTestCase.java (original)
+++ tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaServantTestCase.java Wed Jul 30 15:11:46 2008
@@ -30,7 +30,10 @@
 import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
 import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaRequest;
 import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaResponse;
+import org.apache.tuscany.sca.binding.corba.impl.service.ComponentInvocationProxy;
 import org.apache.tuscany.sca.binding.corba.impl.service.DynaCorbaServant;
+import org.apache.tuscany.sca.binding.corba.impl.service.InvocationProxy;
+import org.apache.tuscany.sca.binding.corba.impl.types.util.Utils;
 import org.apache.tuscany.sca.binding.corba.testing.enums.Color;
 import org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager;
 import org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper;
@@ -58,6 +61,7 @@
 import org.apache.tuscany.sca.binding.corba.testing.service.mocks.TestRuntimeComponentService;
 import org.apache.tuscany.sca.host.corba.naming.TransientNameServer;
 import org.apache.tuscany.sca.host.corba.naming.TransientNameService;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -138,7 +142,9 @@
         try {
             PrimitivesSetter primitivesSetter = new PrimitivesSetterServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(primitivesSetter);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             String[] ids =
                 new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/PrimitivesSetter:1.0"};
             servant.setIds(ids);
@@ -187,7 +193,9 @@
         try {
             ArraysSetter arraysSetter = new ArraysSetterServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(arraysSetter);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/ArraysSetter:1.0"};
             servant.setIds(ids);
             java.lang.Object result = null;
@@ -244,7 +252,9 @@
         try {
             TestObject to = new TestObjectServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(to);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
             servant.setIds(ids);
             bindServant(servant, "TestObject");
@@ -279,7 +289,9 @@
         try {
             TestObjectServant tos = new TestObjectServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(tos);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
             servant.setIds(ids);
             bindServant(servant, "TestObject");
@@ -298,7 +310,9 @@
         try {
             InvalidTestObjectServant tos = new InvalidTestObjectServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(tos);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
             servant.setIds(ids);
             bindServant(servant, "InvalidTestObject");
@@ -328,7 +342,9 @@
         try {
             CalcServant calc = new CalcServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(calc);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             String[] ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
             servant.setIds(ids);
             bindServant(servant, "Calc");
@@ -347,7 +363,9 @@
         try {
             CalcServant calc = new CalcServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(calc);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             String[] ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/exceptions/Calc:1.0"};
             servant.setIds(ids);
             bindServant(servant, "Calc");
@@ -372,7 +390,9 @@
         try {
             EnumManagerServant ems = new EnumManagerServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(ems);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             String[] ids = {"IDL:org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager:1.0"};
             servant.setIds(ids);
             bindServant(servant, "Enum");
@@ -390,7 +410,9 @@
         try {
             NonCorbaServant ncs = new NonCorbaServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(ncs);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             bindServant(servant, "NonCorbaServant");
             // it's non corba servant so we don't have stubs to test them
             DynaCorbaRequest request = new DynaCorbaRequest(bindReference("NonCorbaServant"), "setString");
@@ -406,7 +428,9 @@
         try {
             NonCorbaServant ncs = new NonCorbaServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(ncs);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             bindServant(servant, "NonCorbaServant");
             // it's non corba servant so we don't have stubs to test them
             DynaCorbaRequest request = new DynaCorbaRequest(bindReference("NonCorbaServant"), "throwException");
@@ -431,7 +455,9 @@
         try {
             CalcServant calc = new CalcServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(calc);
-            DynaCorbaServant servant = new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
             servant.setIds(ids);
             bindServant(servant, "Calc");
@@ -459,7 +485,9 @@
             InvalidTypesServant its = new InvalidTypesServant();
             TestRuntimeComponentService service = new TestRuntimeComponentService(its);
             //expecting exception...
-            new DynaCorbaServant(service, null);
+            Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
+            InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
+            DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
             fail();
         } catch (Exception e) {
             if (e instanceof RequestConfigurationException) {

Modified: tuscany/java/sca/modules/binding-sca-corba/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-sca-corba/pom.xml?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-sca-corba/pom.xml (original)
+++ tuscany/java/sca/modules/binding-sca-corba/pom.xml Wed Jul 30 15:11:46 2008
@@ -1,87 +1,132 @@
 <?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.
+	* 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.
 -->
 <project>
 
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.tuscany.sca</groupId>
-        <artifactId>tuscany-modules</artifactId>
-        <version>1.4-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>tuscany-binding-sca-corba</artifactId>
-    <name>Apache Tuscany SCA CORBA-based Default Binding Extension</name>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-sca</artifactId>
-            <version>1.4-SNAPSHOT</version>
-        </dependency>
-
-	<dependency>
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
 		<groupId>org.apache.tuscany.sca</groupId>
-		<artifactId>tuscany-binding-corba</artifactId>
+		<artifactId>tuscany-modules</artifactId>
 		<version>1.4-SNAPSHOT</version>
-        </dependency>
-	
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+
+	<artifactId>tuscany-binding-sca-corba</artifactId>
+	<name>
+		Apache Tuscany SCA CORBA-based Default Binding Extension
+	</name>
+
+	<dependencies>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-binding-sca</artifactId>
+			<version>1.4-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-binding-corba</artifactId>
+			<version>1.4-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-binding-corba-runtime</artifactId>
+			<version>1.4-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-host-corba</artifactId>
+			<version>1.4-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-host-corba-jdk</artifactId>
+			<version>1.4-SNAPSHOT</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-interface-wsdl</artifactId>
+			<version>1.4-SNAPSHOT</version>
+		</dependency>
+
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-binding-corba-runtime</artifactId>
+            <artifactId>tuscany-databinding-axiom</artifactId>
             <version>1.4-SNAPSHOT</version>
         </dependency>
 
-	<dependency>
-		<groupId>org.apache.tuscany.sca</groupId>
-		<artifactId>tuscany-host-corba</artifactId>
-		<version>1.4-SNAPSHOT</version>
-	</dependency>
-	
-	<dependency>
-		<groupId>org.apache.tuscany.sca</groupId>
-		<artifactId>tuscany-host-corba-jdk</artifactId>
-		<version>1.4-SNAPSHOT</version>
-		<scope>test</scope>
-	</dependency>
-
-    </dependencies>
-
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-
-                <configuration>
-                    <instructions>
-                        <Bundle-Version>${tuscany.version}</Bundle-Version>
-                        <Bundle-SymbolicName>org.apache.tuscany.sca.binding.sca.corba</Bundle-SymbolicName>
-                        <Bundle-Description>${pom.name}</Bundle-Description>
-                        <Export-Package>org.apache.tuscany.sca.binding.sca.corba*</Export-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
+       <!--
+		<dependency>
+			<groupId>org.apache.ws.commons.axiom</groupId>
+			<artifactId>axiom-api</artifactId>
+			<exclusions>
+				<exclusion>
+					<groupId>xerces</groupId>
+					<artifactId>xercesImpl</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>stax</groupId>
+					<artifactId>stax-api</artifactId>
+				</exclusion>
+			</exclusions>
+			<version>1.2.5</version>
+		</dependency>
+        -->
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-binding-ws-wsdlgen</artifactId>
+			<version>1.4-SNAPSHOT</version>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+
+				<configuration>
+					<instructions>
+						<Bundle-Version>
+							${tuscany.version}
+						</Bundle-Version>
+						<Bundle-SymbolicName>
+							org.apache.tuscany.sca.binding.sca.corba
+						</Bundle-SymbolicName>
+						<Bundle-Description>
+							${pom.name}
+						</Bundle-Description>
+						<Export-Package>
+							org.apache.tuscany.sca.binding.sca.corba*
+						</Export-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 
 </project>

Modified: tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCABindingProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCABindingProviderFactory.java?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCABindingProviderFactory.java (original)
+++ tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCABindingProviderFactory.java Wed Jul 30 15:11:46 2008
@@ -38,22 +38,24 @@
 
     private CorbaHostExtensionPoint chep;
     private CorbaHost host;
+    private ExtensionPointRegistry extensions;
 
-    public CorbaSCABindingProviderFactory(ExtensionPointRegistry registry) {
-        chep = registry.getExtensionPoint(CorbaHostExtensionPoint.class);
+    public CorbaSCABindingProviderFactory(ExtensionPointRegistry extensions) {
+        this.extensions = extensions;
+        chep = extensions.getExtensionPoint(CorbaHostExtensionPoint.class);
         host = new ExtensibleCorbaHost(chep);
     }
 
     public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component,
                                                                    RuntimeComponentReference reference,
                                                                    DistributedSCABinding binding) {
-        return new CorbaSCAReferenceBindingProvider(binding.getSCABinding(), host, reference);
+        return new CorbaSCAReferenceBindingProvider(binding.getSCABinding(), host, component, reference, extensions);
     }
 
     public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component,
                                                                RuntimeComponentService service,
                                                                DistributedSCABinding binding) {
-        return new CorbaSCAServiceBindingProvider(binding.getSCABinding(), host, service);
+        return new CorbaSCAServiceBindingProvider(binding.getSCABinding(), host, component, service, extensions);
     }
 
     public Class<DistributedSCABinding> getModelType() {

Added: tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java?rev=681221&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java (added)
+++ tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java Wed Jul 30 15:11:46 2008
@@ -0,0 +1,113 @@
+/*
+ * 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.corba.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException;
+import org.apache.tuscany.sca.binding.corba.impl.service.InvocationException;
+import org.apache.tuscany.sca.binding.corba.impl.service.InvocationProxy;
+import org.apache.tuscany.sca.binding.corba.impl.service.OperationTypes;
+import org.apache.tuscany.sca.binding.corba.impl.types.TypeTree;
+import org.apache.tuscany.sca.binding.corba.impl.types.TypeTreeCreator;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.util.FaultException;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.invocation.MessageFactory;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+
+/**
+ * Invocation proxy for SCA default binding over CORBA binding
+ */
+public class CorbaSCAInvocationProxy implements InvocationProxy {
+
+    private RuntimeWire wire;
+    private Interface componentInterface;
+    private OperationTypes types = new OperationTypes();
+    private MessageFactory messageFactory;
+
+    public CorbaSCAInvocationProxy(RuntimeWire wire, Interface componentInterface, MessageFactory messageFactory) {
+        this.wire = wire;
+        this.componentInterface = componentInterface;
+        this.messageFactory = messageFactory;
+        try {
+            List<TypeTree> inputType = new ArrayList<TypeTree>();
+            inputType.add(TypeTreeCreator.createTypeTree(String.class, false));
+            types.setInputType(inputType);
+            types.setOutputType(TypeTreeCreator.createTypeTree(String.class, false));
+        } catch (RequestConfigurationException e) {
+            // ignore - string type should not cause this exception
+        }
+    }
+
+    public Object invoke(String operationName, List<Object> arguments) throws InvocationException {
+        try {
+            OMElement omContent = AXIOMUtil.stringToOM((String)arguments.get(0));
+            String componentOperationName = omContent.getQName().getLocalPart();
+            Operation componentOperation = null;
+            for (Operation operation : componentInterface.getOperations()) {
+                if (operation.getName().equals(componentOperationName)) {
+                    componentOperation = operation;
+                    break;
+                }
+            }
+            if (componentOperation == null) {
+                // TODO: throw an exception - no such operation
+            } else {
+                Message msg = messageFactory.createMessage();
+                msg.setOperation(componentOperation);
+                Object[] args = new Object[1];
+                args[0] = omContent;
+                msg.setBody(args);
+                OMElement omResult = (OMElement)wire.invoke(componentOperation, msg);
+                return omResult.toStringWithConsume();
+            }
+        } catch (XMLStreamException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (InvocationTargetException e) {
+            OMElement omException = (OMElement)((FaultException)e.getCause()).getFaultInfo();
+            try {
+                WrappedSCAException wrappedException = new WrappedSCAException(omException.toStringWithConsume());
+                InvocationException exception = new InvocationException(wrappedException);
+                throw exception;
+            } catch (XMLStreamException e1) {
+                // TODO Auto-generated catch block
+                e1.printStackTrace();
+            }
+            
+        }
+
+        return null;
+    }
+
+    public OperationTypes getOperationTypes(String operationName) {
+        // ignoring operationName - only one operation for this proxy is allowed
+        return types;
+    }
+
+}

Propchange: tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAReferenceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAReferenceBindingProvider.java?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAReferenceBindingProvider.java (original)
+++ tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAReferenceBindingProvider.java Wed Jul 30 15:11:46 2008
@@ -19,19 +19,20 @@
 
 package org.apache.tuscany.sca.binding.sca.corba.impl;
 
-import java.lang.reflect.Method;
-import java.util.Map;
 import java.util.logging.Logger;
 
+import org.apache.axiom.om.OMElement;
 import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.binding.corba.impl.CorbaInvoker;
-import org.apache.tuscany.sca.binding.corba.impl.util.OperationMapper;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
+import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.host.corba.CorbaHost;
 import org.apache.tuscany.sca.interfacedef.InterfaceContract;
 import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
 import org.omg.CORBA.Object;
 
@@ -44,23 +45,27 @@
 
     private SCABinding binding;
     private CorbaHost host;
-    private RuntimeComponentReference reference;
     private Object remoteObject;
     private Class<?> referenceClass;
-    private Map<Method, String> operationsMap = null;
+    private InterfaceContract wsdlInterfaceContract; 
 
     public CorbaSCAReferenceBindingProvider(SCABinding binding,
                                             CorbaHost host,
-                                            RuntimeComponentReference reference) {
+                                            RuntimeComponent component,
+                                            RuntimeComponentReference reference,
+                                            ExtensionPointRegistry extensions) {
         this.binding = binding;
         this.host = host;
-        this.reference = reference;
-        this.referenceClass = ((JavaInterface)reference.getInterfaceContract().getInterface()).getJavaClass();
-        operationsMap = OperationMapper.mapMethodToOperation(referenceClass);
+        
+        WebServiceBindingFactory wsFactory = extensions.getExtensionPoint(WebServiceBindingFactory.class);
+        WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
+        BindingWSDLGenerator.generateWSDL(component, reference, wsBinding, extensions, null);
+        wsdlInterfaceContract = wsBinding.getBindingInterfaceContract();
+        wsdlInterfaceContract.getInterface().resetDataBinding(OMElement.class.getName());
     }
 
     public InterfaceContract getBindingInterfaceContract() {
-        return reference.getInterfaceContract();
+        return wsdlInterfaceContract;
     }
 
     public boolean supportsOneWayInvocation() {
@@ -72,7 +77,7 @@
             if (remoteObject == null) {
                 remoteObject = host.lookup(binding.getURI());
             }
-            return new CorbaInvoker(remoteObject, referenceClass, operationsMap, true);
+            return new CorbaSCAInvoker(remoteObject, referenceClass, null, true);
         } catch (Exception e) {
             logger.warning(e.getMessage());
         }

Modified: tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAServiceBindingProvider.java?rev=681221&r1=681220&r2=681221&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAServiceBindingProvider.java (original)
+++ tuscany/java/sca/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAServiceBindingProvider.java Wed Jul 30 15:11:46 2008
@@ -19,35 +19,55 @@
 
 package org.apache.tuscany.sca.binding.sca.corba.impl;
 
+import org.apache.axiom.om.OMElement;
 import org.apache.tuscany.sca.assembly.SCABinding;
 import org.apache.tuscany.sca.binding.corba.impl.service.DynaCorbaServant;
+import org.apache.tuscany.sca.binding.corba.impl.service.InvocationProxy;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
+import org.apache.tuscany.sca.binding.ws.wsdlgen.BindingWSDLGenerator;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.host.corba.CorbaHost;
 import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.invocation.MessageFactory;
 import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentService;
 import org.osoa.sca.ServiceRuntimeException;
 
+
 /**
  * Service binding provider for SCA default binding over CORBA binding
  */
 public class CorbaSCAServiceBindingProvider implements ServiceBindingProvider {
-    
+
     private SCABinding binding;
     private CorbaHost host;
     private RuntimeComponentService service;
     private DynaCorbaServant servant;
-
+    private MessageFactory messageFactory;
+    private InterfaceContract wsdlInterfaceContract;
 
     public CorbaSCAServiceBindingProvider(SCABinding binding,
                                           CorbaHost host,
-                                          RuntimeComponentService service) {
+                                          RuntimeComponent component,
+                                          RuntimeComponentService service,
+                                          ExtensionPointRegistry extensions) {
         this.binding = binding;
         this.host = host;
         this.service = service;
+        
+        messageFactory = extensions.getExtensionPoint(MessageFactory.class);
+        
+        WebServiceBindingFactory wsFactory = extensions.getExtensionPoint(WebServiceBindingFactory.class);
+        WebServiceBinding wsBinding = wsFactory.createWebServiceBinding();
+        BindingWSDLGenerator.generateWSDL(component, service, wsBinding, extensions, null);
+        wsdlInterfaceContract = wsBinding.getBindingInterfaceContract();
+        wsdlInterfaceContract.getInterface().resetDataBinding(OMElement.class.getName());
     }
 
     public InterfaceContract getBindingInterfaceContract() {
-        return service.getInterfaceContract();
+        return wsdlInterfaceContract;
     }
 
     public boolean supportsOneWayInvocation() {
@@ -56,19 +76,20 @@
 
     public void start() {
         try {
-            servant = new DynaCorbaServant(service, binding, true);
+            InvocationProxy proxy = new CorbaSCAInvocationProxy(service.getRuntimeWire(binding), service.getInterfaceContract().getInterface(), messageFactory);
+            servant = new DynaCorbaServant(proxy, "IDL:org/apache/tuscany/sca/binding/sca/corba/Service:1.0");
             host.registerServant(binding.getURI(), servant);
         } catch (Exception e) {
             throw new ServiceRuntimeException(e);
-        }        
+        }
     }
 
     public void stop() {
         try {
             host.unregisterServant(binding.getURI());
-       } catch (Exception e) {
-           throw new ServiceRuntimeException(e);
-       }
+        } catch (Exception e) {
+            throw new ServiceRuntimeException(e);
+        }
 
     }
 

Propchange: tuscany/java/sca/modules/host-corba-jdk/src/test/java/org/apache/tuscany/sca/host/corba/testing/DefaultCorbaHostTestCase.java
            ('svn:mergeinfo' removed)