incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r452146 [1/2] - in /incubator/yoko: branches/cxf_port/ trunk/api/ trunk/api/src/main/resources/schemas/wsdl/ trunk/bindings/ trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/ trunk/bindings/src/main/java/org/apache/yoko/bindings...
Date Mon, 02 Oct 2006 17:50:36 GMT
Author: bravi
Date: Mon Oct  2 10:50:34 2006
New Revision: 452146

URL: http://svn.apache.org/viewvc?view=rev&rev=452146
Log:
[YOKO-170] - Initial port of the bindings module to use the cxf api's. Created a corba2 package which will be renamed to be corba package once the complete port is done. Also some updates the api & tools module.

Added:
    incubator/yoko/branches/cxf_port/pom.xml   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaInInterceptor.java   (with props)
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java   (with props)
    incubator/yoko/trunk/bindings/src/main/resources/
    incubator/yoko/trunk/bindings/src/main/resources/META-INF/
    incubator/yoko/trunk/bindings/src/main/resources/META-INF/bus-extensions.xml   (with props)
    incubator/yoko/trunk/bindings/src/main/resources/META-INF/cxf/
    incubator/yoko/trunk/bindings/src/main/resources/META-INF/cxf/cxf-extension.xml   (with props)
    incubator/yoko/trunk/bindings/src/main/resources/META-INF/extensions.xml   (with props)
Modified:
    incubator/yoko/trunk/api/pom.xml
    incubator/yoko/trunk/api/src/main/resources/schemas/wsdl/wsdl.xsd
    incubator/yoko/trunk/bindings/pom.xml
    incubator/yoko/trunk/tools/pom.xml
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/WSDLToIDL.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlField.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlParam.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlSequence.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlStruct.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaProcessor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToProcessor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/TestUtils.java

Added: incubator/yoko/branches/cxf_port/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/pom.xml?view=auto&rev=452146
==============================================================================
--- incubator/yoko/branches/cxf_port/pom.xml (added)
+++ incubator/yoko/branches/cxf_port/pom.xml Mon Oct  2 10:50:34 2006
@@ -0,0 +1,479 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.yoko</groupId>
+    <artifactId>yoko</artifactId>
+    <version>1.0-incubating-M1-SNAPSHOT</version>
+    <name>Yoko CORBA Server</name>
+    <url>http://incubator.apache.org/yoko/</url>
+
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>api</module>
+        <module>tools</module>
+        <module>bindings</module>
+    </modules>
+
+    <!-- These properties should be defined in top level pom.xml -->
+     <properties>
+        <!-- The current version -->
+        <yoko.version>1.0-incubating-M1-SNAPSHOT</yoko.version>
+
+        <!--  CORBA spec version -->
+        <yoko.spec.version>${yoko.version}</yoko.spec.version>
+
+        <!-- versions of external dependencies -->
+        <ant.version>1.6.5</ant.version>
+        <antlr.version>2.7.5</antlr.version>
+        <bcel.version>5.2</bcel.version>
+        <cxf.version>2.0-incubator-M1-SNAPSHOT</cxf.version>
+        <celtix.version>1.1-SNAPSHOT</celtix.version>
+        <commons.logging.version>1.0.4</commons.logging.version>
+        <concurrent.version>1.3.4</concurrent.version>
+        <junit.version>3.8.2</junit.version>
+        <maven.version>2.0.1</maven.version>
+        <xmlschema.version>1.0.2</xmlschema.version>
+
+        <compiler.version>2.0.1</compiler.version>
+        <javadoc.version>2.0-beta-3</javadoc.version>
+        <jar.version>2.0</jar.version>
+        <java.source.version>1.5</java.source.version>
+        <compile.flags>-Xlint:unchecked,deprecation,fallthrough,finally</compile.flags>
+        <java.endorsed.dirs>${basedir}/target/classes</java.endorsed.dirs>
+        <site.version>2.0-beta-4</site.version>
+        <compile.forked>false</compile.forked>
+        <java.source.version>1.5</java.source.version>
+        <compile.flags>-Xlint:unchecked,deprecation,fallthrough,finally</compile.flags>
+        <topDirectoryLocation>.</topDirectoryLocation>
+        <no.checkstyle>false</no.checkstyle>
+        <no.pmd>false</no.pmd>
+        <notice.dir>.</notice.dir>
+     </properties>
+
+     <dependencyManagement>
+         <dependencies>
+             <!--  Yoko modules -->
+             <dependency>
+                 <groupId>org.apache.yoko</groupId>
+                 <artifactId>yoko-core</artifactId>
+                 <version>${yoko.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.yoko</groupId>
+                 <artifactId>yoko-spec-corba</artifactId>
+                 <version>${yoko.spec.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.yoko</groupId>
+                 <artifactId>yoko-api</artifactId>
+                 <version>${yoko.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.yoko</groupId>
+                 <artifactId>yoko-tools</artifactId>
+                 <version>${yoko.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.yoko</groupId>
+                 <artifactId>yoko-bindings</artifactId>
+                 <version>${yoko.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.yoko</groupId>
+                 <artifactId>yoko-rmi</artifactId>
+                 <version>${yoko.version}</version>
+             </dependency>
+             <!--  External dependencies -->
+             <dependency>
+                 <groupId>junit</groupId>
+                 <artifactId>junit</artifactId>
+                 <version>${junit.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.bcel</groupId>
+                 <artifactId>bcel</artifactId>
+                 <version>${bcel.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>antlr</groupId>
+                 <artifactId>antlr</artifactId>
+                 <version>${antlr.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.ws.commons</groupId>
+                 <artifactId>XmlSchema</artifactId>
+                 <version>${xmlschema.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.cxf</groupId>
+                 <artifactId>cxf-common-utilities</artifactId>
+                 <version>${cxf.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.cxf</groupId>
+                 <artifactId>cxf-tools-common</artifactId>
+                 <version>${cxf.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.cxf</groupId>
+                 <artifactId>cxf-api</artifactId>
+                 <version>${cxf.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.cxf</groupId>
+                 <artifactId>cxf-rt-core</artifactId>
+                 <version>${cxf.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.objectweb.celtix</groupId>
+                 <artifactId>celtix-common</artifactId>
+                 <version>${celtix.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.objectweb.celtix</groupId>
+                 <artifactId>celtix-tools</artifactId>
+                 <version>${celtix.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.objectweb.celtix</groupId>
+                 <artifactId>celtix-api</artifactId>
+                 <version>${celtix.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.objectweb.celtix</groupId>
+                 <artifactId>celtix-rt</artifactId>
+                 <version>${celtix.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.maven</groupId>
+                 <artifactId>maven-plugin-api</artifactId>
+                 <version>${maven.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>org.apache.maven</groupId>
+                 <artifactId>maven-project</artifactId>
+                 <version>${maven.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>ant</groupId>
+                 <artifactId>ant</artifactId>
+                 <version>${ant.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>ant</groupId>
+                 <artifactId>ant-nodeps</artifactId>
+                 <version>${ant.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>concurrent</groupId>
+                 <artifactId>concurrent</artifactId>
+                 <version>${concurrent.version}</version>
+                 <scope>test</scope>
+             </dependency>
+             <dependency>
+                 <groupId>commons-logging</groupId>
+                 <artifactId>commons-logging</artifactId>
+                 <version>${commons.logging.version}</version>
+             </dependency>
+             <dependency>
+                 <groupId>woodstox</groupId>
+                 <artifactId>wstx-asl</artifactId>
+                 <version>2.9</version>
+             </dependency>
+         </dependencies>
+     </dependencyManagement>
+
+     <build>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>target/generated/src/main/resources</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>${notice.dir}</directory>
+                <targetPath>META-INF</targetPath>
+                <filtering>true</filtering>
+                <includes>
+                    <include>LICENSE</include>
+                    <include>NOTICE</include>
+                    <include>DISCLAIMER.txt</include>
+                </includes>
+            </resource>
+        </resources>
+        <testResources>
+            <testResource>
+                <directory>src/test/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </testResource>
+            <testResource>
+                <directory>src/test/resources</directory>
+                <includes>
+                    <include>**</include>
+                </includes>
+            </testResource>
+        </testResources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>${jar.version}</version>
+            </plugin>
+            <plugin>
+              <artifactId>maven-one-plugin</artifactId>
+              <executions>
+                <execution>
+                  <goals>
+                    <goal>install-maven-one-repository</goal>
+                    <goal>deploy-maven-one-repository</goal>
+                  </goals>
+                  <configuration>
+                    <remoteRepositoryId>apache-snapshot-repository</remoteRepositoryId>
+                    <remoteRepositoryUrl>scpexe://people.apache.org/www/people.apache.org/repository</remoteRepositoryUrl>
+                  </configuration>
+                </execution>
+              </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>${compiler.version}</version>
+                <configuration>
+                    <source>${java.source.version}</source>
+                    <target>${java.source.version}</target>
+                    <showDeprecation>true</showDeprecation>
+                    <fork>${compile.forked}</fork>
+                    <compilerArgument>${compile.flags}</compilerArgument>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-site-plugin</artifactId>
+                <version>${site.version}</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <configuration>
+                    <downloadSources>true</downloadSources>
+                    <buildcommands>
+                        <java.lang.String>org.eclipse.jdt.core.javabuilder</java.lang.String>
+                        <java.lang.String>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</java.lang.String>
+                        <java.lang.String>net.sourceforge.pmd.eclipse.pmdBuilder</java.lang.String>
+                    </buildcommands>
+                    <projectnatures>
+                        <nature>org.eclipse.jdt.core.javanature</nature>
+                        <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
+                        <nature>net.sourceforge.pmd.eclipse.pmdNature</nature>
+                    </projectnatures>
+                </configuration>
+            </plugin>
+        </plugins>
+        <defaultGoal>install</defaultGoal>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <version>2.0-SNAPSHOT</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.1.3</version>
+                    <configuration>
+                        <includes>
+                            <include>**/*Test.java</include>
+                            <include>**/*TestCase.java</include>
+                        </includes>
+                        <excludes>
+                            <exclude>**/*$*</exclude>
+                        </excludes>
+                        <reportFormat>brief</reportFormat>
+                        <useFile>false</useFile>
+                        <forkMode>once</forkMode>
+                        <childDelegation>false</childDelegation>
+                        <argLine>-ea</argLine>
+                    </configuration>
+                </plugin>
+                <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>process-sources</id>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <configLocation>${basedir}/checkstyle.xml</configLocation>
+                            <consoleOutput>true</consoleOutput>
+                            <failsOnError>true</failsOnError>
+                        </configuration>
+                        <goals>
+                            <goal>checkstyle</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            </plugins>
+        </pluginManagement>
+
+
+        <extensions>
+            <extension>
+              <groupId>org.apache.maven.wagon</groupId>
+              <artifactId>wagon-ssh-external</artifactId>
+              <version>1.0-alpha-5</version>
+            </extension>
+       </extensions>
+
+    </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-clover-plugin</artifactId>
+      </plugin>
+      <!--plugin>
+        <artifactId>maven-pmd-plugin</artifactId>
+      </plugin!-->
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <repositories>
+      <repository>
+          <id>objectweb-repo</id>
+          <name>ObjectWeb repo</name>
+          <url>http://maven.objectweb.org/maven2-snapshot</url>
+          <releases>
+              <enabled>true</enabled>
+          </releases>
+          <snapshots>
+              <enabled>true</enabled>
+          </snapshots>
+      </repository>
+      <repository>
+          <id>java.net</id>
+          <name>java.net Maven Repository</name>
+          <url>https://maven-repository.dev.java.net/nonav/repository/</url>
+          <layout>legacy</layout>
+      </repository>
+  </repositories>
+
+  <pluginRepositories>
+      <pluginRepository>
+          <id>objectweb_snapshots</id>
+          <name>ObjectWeb Snapshot Repository</name>
+          <url>http://maven.objectweb.org/maven2-snapshot</url>
+          <layout>default</layout>
+          <snapshots>
+              <enabled>true</enabled>
+          </snapshots>
+          <releases>
+              <updatePolicy>never</updatePolicy>
+          </releases>
+      </pluginRepository>
+      <pluginRepository>
+          <id>codehaus-repo</id>
+          <name>Codehaus Repository</name>
+          <url>http://snapshots.repository.codehaus.org</url>
+          <layout>default</layout>
+          <snapshots>
+              <enabled>true</enabled>
+          </snapshots>
+          <releases>
+              <updatePolicy>never</updatePolicy>
+          </releases>
+       </pluginRepository>
+       <pluginRepository>
+         <id>plugin-snapshots</id>
+         <name>Maven Central Plugins Development Repository</name>
+         <url>http://snapshots.maven.codehaus.org/maven2</url>
+         <layout>default</layout>
+         <snapshots>
+             <enabled>true</enabled>
+         </snapshots>
+         <releases>
+             <updatePolicy>never</updatePolicy>
+         </releases>
+       </pluginRepository>
+        <pluginRepository>
+            <id>apache-plugin-snapshots</id>
+            <name>Maven apache plugins snapshot repository</name>
+            <url>http://people.apache.org/maven-snapshot-repository</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+            <releases>
+                <updatePolicy>never</updatePolicy>
+            </releases>
+        </pluginRepository>
+  </pluginRepositories>
+
+  <distributionManagement>
+    <snapshotRepository>
+       <id>apache-snapshot-repository</id>
+       <name>Apache SNAPSHOT Repository</name>
+       <url>scpexe://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
+    </snapshotRepository>
+  </distributionManagement>
+  
+  <profiles>
+    <profile>
+        <!-- this is a hack for eclipse - taken from Tuscany. Eclipse doesn't 
+        like "." as a resource directory as then you have source directories 
+        inside a src directory which causes all sorts of problems.  so the 
+        resources directory gets pointed back to the resources directory  so 
+        the NOTICE.txt, LICENSE.txt and DISCLAIMER.txt files won't be included 
+        in the eclipse builds.
+        -->
+        <id>eclipse</id>
+        <properties>
+                <notice.dir>src/main/resources</notice.dir>
+        </properties>
+        <build>
+          <defaultGoal>process-test-sources</defaultGoal>
+          <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>setup.eclipse.project</id>
+                        <phase>process-test-sources</phase>
+                        <goals>
+                            <goal>eclipse</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+          </plugins>
+        </build>
+    </profile>
+  </profiles>
+
+</project>

Propchange: incubator/yoko/branches/cxf_port/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/branches/cxf_port/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/yoko/branches/cxf_port/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/yoko/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/api/pom.xml?view=diff&rev=452146&r1=452145&r2=452146
==============================================================================
--- incubator/yoko/trunk/api/pom.xml (original)
+++ incubator/yoko/trunk/api/pom.xml Mon Oct  2 10:50:34 2006
@@ -31,18 +31,18 @@
         </dependency> -->
     
         <dependency>
-            <groupId>org.objectweb.celtix</groupId>
-            <artifactId>celtix-common</artifactId>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-common-utilities</artifactId>
         </dependency>
             
         <dependency>
-            <groupId>org.objectweb.celtix</groupId>
-            <artifactId>celtix-tools</artifactId>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-tools-common</artifactId>
         </dependency>
         
         <dependency>
-            <groupId>org.objectweb.celtix</groupId>
-            <artifactId>celtix-api</artifactId>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-api</artifactId>
         </dependency>
         
     </dependencies>
@@ -90,9 +90,9 @@
                 </executions>
             </plugin>
             <plugin>
-                <groupId>org.objectweb.celtix</groupId>
-                <artifactId>celtix-codegen-plugin</artifactId>
-                <version>${celtix.version}</version>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-common-xsd</artifactId>
+                <version>${cxf.version}</version>
                 <executions>
                     <execution>
                         <id>generate-sources</id>

Modified: incubator/yoko/trunk/api/src/main/resources/schemas/wsdl/wsdl.xsd
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/api/src/main/resources/schemas/wsdl/wsdl.xsd?view=diff&rev=452146&r1=452145&r2=452146
==============================================================================
--- incubator/yoko/trunk/api/src/main/resources/schemas/wsdl/wsdl.xsd (original)
+++ incubator/yoko/trunk/api/src/main/resources/schemas/wsdl/wsdl.xsd Mon Oct  2 10:50:34 2006
@@ -29,7 +29,7 @@
     <xs:annotation>
         <xs:appinfo>
             <jaxb:schemaBindings>
-                <jaxb:package name="org.objectweb.celtix.wsdl"/>
+                <jaxb:package name="org.apache.cxf.wsdl"/>
             </jaxb:schemaBindings>
             <jaxb:globalBindings generateIsSetMethod="true"/>
         </xs:appinfo>
@@ -333,7 +333,7 @@
     <xs:complexType name="tExtensibilityElement" abstract="true" >
         <xs:annotation>
             <xs:appinfo>
-                <jaxb:class implClass="org.objectweb.celtix.wsdl.TExtensibilityElementImpl"/>
+                <jaxb:class implClass="org.apache.cxf.wsdl.TExtensibilityElementImpl"/>
             </xs:appinfo>
         </xs:annotation>
 

Modified: incubator/yoko/trunk/bindings/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/pom.xml?view=diff&rev=452146&r1=452145&r2=452146
==============================================================================
--- incubator/yoko/trunk/bindings/pom.xml (original)
+++ incubator/yoko/trunk/bindings/pom.xml Mon Oct  2 10:50:34 2006
@@ -22,6 +22,21 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-common-utilities</artifactId>
+        </dependency>
+            
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-core</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-api</artifactId>
+        </dependency>
     
         <dependency>
             <groupId>org.objectweb.celtix</groupId>

Added: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java?view=auto&rev=452146
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java (added)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java Mon Oct  2 10:50:34 2006
@@ -0,0 +1,72 @@
+/**
+ * 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.yoko.bindings.corba2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.binding.Binding;
+import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+
+public class CorbaBinding extends AbstractBasicInterceptorProvider implements Binding {
+
+    private List<Interceptor> in;
+    private List<Interceptor> out;
+    private List<Interceptor> fault;
+    private Interceptor outFaultInterceptor;
+    private Interceptor inFaultInterceptor;
+    
+    public CorbaBinding() {
+        in = new ArrayList<Interceptor>();
+        out = new ArrayList<Interceptor>();
+        fault = new ArrayList<Interceptor>();        
+    }
+    
+    public Message createMessage() {
+        return createMessage(new MessageImpl());
+    }
+
+    public Message createMessage(Message m) {
+        return new CorbaMessage(m);
+    }
+
+    public List<Interceptor> getFaultInterceptors() {
+        return fault;
+    }
+
+    public List<Interceptor> getInInterceptors() {
+        return in;
+    }
+
+    public List<Interceptor> getOutInterceptors() {
+        return out;
+    }
+
+    public Interceptor getInFaultInterceptor() {
+        return inFaultInterceptor;
+    }
+
+    public Interceptor getOutFaultInterceptor() {
+        return outFaultInterceptor;
+    }
+}

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java?view=auto&rev=452146
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java (added)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java Mon Oct  2 10:50:34 2006
@@ -0,0 +1,46 @@
+/**
+ * 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.yoko.bindings.corba2;
+
+import javax.xml.ws.ProtocolException;
+
+// NOTE: This exception provides basic functionality for throwing exceptions within the binding.
+// At the momemnt, we just want to support the ability to throw a message (and accompanying 
+// exception) but it may be necessary to break up this functionality into separate exceptions 
+// or make this exception a bit more complex.
+public class CorbaBindingException extends ProtocolException {
+
+    public static final long serialVersionUID = 8493263228127324876L;
+
+    public CorbaBindingException() {
+        super();
+    }
+
+    public CorbaBindingException(String msg) {
+        super(msg);
+    }
+
+    public CorbaBindingException(String msg, Throwable t) {
+        super(msg, t);
+    }
+
+    public CorbaBindingException(Throwable t) {
+        super(t);
+    }
+}

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java?view=auto&rev=452146
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java (added)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java Mon Oct  2 10:50:34 2006
@@ -0,0 +1,118 @@
+/**
+ * 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.yoko.bindings.corba2;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.binding.AbstractBindingFactory;
+import org.apache.cxf.binding.Binding;
+import org.apache.cxf.binding.BindingFactoryManager;
+
+import org.apache.cxf.interceptor.StaxInInterceptor;
+import org.apache.cxf.interceptor.StaxOutInterceptor;
+
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.ConduitInitiator;
+import org.apache.cxf.transport.ConduitInitiatorManager;
+import org.apache.cxf.transport.Destination;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
+
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+
+import org.apache.yoko.bindings.corba2.interceptors.CorbaInInterceptor;
+import org.apache.yoko.bindings.corba2.interceptors.CorbaOutInterceptor;
+
+public class CorbaBindingFactory
+    extends AbstractBindingFactory
+    implements ConduitInitiator, DestinationFactory {
+
+    private Bus bus;
+    private Collection<String> activationNamespaces;
+
+    @Resource
+    public void setBus(Bus b) {
+        bus = b;
+    }
+    
+    @Resource
+    public void setActivationNamespaces(Collection<String> ans) {
+        activationNamespaces = ans;
+    }
+
+    @PostConstruct
+    void registerSelf() {
+        if (null == bus) {
+            return;
+        }
+        BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
+        if (null != bfm) {
+            for (String ns : activationNamespaces) {
+                bfm.registerBindingFactory(ns, this);
+            }
+        }
+    }
+
+    @PostConstruct
+    void registerWithBindingManager() {
+        ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
+        for (String ns : activationNamespaces) {
+            cim.registerConduitInitiator(ns, this);
+        }
+        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+        for (String ns : activationNamespaces) {
+            dfm.registerDestinationFactory(ns, this);
+        }
+    }
+
+    public Binding createBinding(BindingInfo bindingInfo) {
+        CorbaBinding binding = new CorbaBinding();
+        binding.getInInterceptors().add(new CorbaInInterceptor());
+        binding.getInInterceptors().add(new StaxInInterceptor());
+        binding.getOutInterceptors().add(new StaxOutInterceptor());
+        binding.getOutInterceptors().add(new CorbaOutInterceptor());
+        binding.getOutFaultInterceptors().add(new StaxOutInterceptor());
+        //binding.getOutFaultInterceptors().add(new CorbaFaultInterceptor());
+        return binding;
+    }
+
+    public Conduit getConduit(EndpointInfo endpointInfo)
+        throws IOException {
+        return null;
+    }
+
+    public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target)
+        throws IOException {
+        return null;
+    }
+
+    public Destination getDestination(EndpointInfo endpointInfo)
+        throws IOException {
+        return new CorbaDestination(endpointInfo);
+    }
+}

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java?view=auto&rev=452146
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java (added)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java Mon Oct  2 10:50:34 2006
@@ -0,0 +1,245 @@
+/**
+ * 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.yoko.bindings.corba2;
+
+//import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+//import javax.xml.namespace.QName;
+//import javax.xml.ws.WebServiceException;
+//import javax.xml.ws.handler.MessageContext;
+
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.transport.MessageObserver;
+
+import org.apache.schemas.yoko.bindings.corba.BindingType;
+//import org.apache.schemas.yoko.bindings.corba.ModeType;
+//import org.apache.schemas.yoko.bindings.corba.OperationType;
+//import org.apache.schemas.yoko.bindings.corba.ParamType;
+//import org.apache.yoko.bindings.corba.types.CorbaHandlerUtils;
+//import org.apache.yoko.bindings.corba.types.CorbaObjectHandler;
+
+//import org.omg.CORBA.Any;
+//import org.omg.CORBA.NVList;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.ServerRequest;
+import org.omg.PortableServer.DynamicImplementation;
+import org.omg.PortableServer.POA;
+
+public class CorbaDSIServant extends DynamicImplementation {
+
+    private final ORB orb;
+    private final POA servantPOA;
+    private List<String> interfaces;
+    private MessageObserver incomingObserver;
+    private CorbaDestination destination;
+
+    public CorbaDSIServant(ORB theOrb,
+                           POA poa,
+                           CorbaDestination dest,
+                           MessageObserver observer) {
+        orb = theOrb;
+        servantPOA = poa;
+        destination = dest;
+        incomingObserver = observer;
+
+        // Get the list of interfaces that this servant will support
+        try {
+            BindingType bindType = destination.getBindingInfo().getExtensor(BindingType.class);
+            if (bindType == null) {
+                throw new CorbaBindingException("Unable to determine corba binding information");
+            }
+
+            List<String> bases = bindType.getBases();
+            interfaces = new ArrayList<String>();
+            interfaces.add(bindType.getRepositoryID());
+            for (Iterator<String> iter = bases.iterator(); iter.hasNext();) {
+                interfaces.add(iter.next());
+            }
+        } catch (java.lang.Exception ex) {
+            // TODO: For now, this exception is consumed. Revisit this to see if
+            // it is the best way to handle this.
+        }
+    }
+
+    public void invoke(ServerRequest request) throws CorbaBindingException {
+        MessageImpl msg = new MessageImpl();
+        msg.setDestination(destination);
+        incomingObserver.onMessage(msg);
+        /*
+        try {
+            CorbaMessageContext corbaCtx = 
+                (CorbaMessageContext)serverBinding.getBindingImpl().
+                    createBindingMessageContext(new GenericMessageContext());
+            corbaCtx.setMessage(new CorbaMessage());
+            corbaCtx.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.TRUE);
+
+            QName operationName = new QName(request.operation());
+            corbaCtx.put(MessageContext.WSDL_OPERATION, operationName);
+
+            ObjectMessageContext objectCtx = serverBinding.createObjectContext();
+            DataBindingCallback.Mode mode = sbeCallback.getServiceMode();
+            DataBindingCallback callback = 
+                sbeCallback.getDataBindingCallback((QName)corbaCtx.get(MessageContext.WSDL_OPERATION),
+                                                   objectCtx, 
+                                                   mode);
+            callback.initObjectContext(objectCtx);
+            objectCtx.putAll(corbaCtx);
+
+            // Get the WSDL definition for the operation being invoked 
+            // TODO: Verify that two operations can't be overloaded.
+            OperationType opElement = CorbaUtils.getCorbaOperationType(operationName.getLocalPart(), 
+                                                                       serverBinding.getBus(),
+                                                                       serverBinding.getEndpointReference());
+            if (opElement == null) {
+                throw new CorbaBindingException("Unable to locate operation type definition");
+            }
+
+            List<ParamType> paramTypes = opElement.getParam();
+            List<CorbaTypeMap> typeMaps = 
+                ((CorbaBindingImpl)serverBinding.getBindingImpl()).getCorbaTypeMaps();
+
+            // Build a list of streamables that correspond to the values that should be contained in the
+            // argument list of the ServerRequest, build the correct NVList and retreive the arguments
+            CorbaStreamable[] arguments = new CorbaStreamable[paramTypes.size()];
+            NVList list = prepareDIIArgsList(corbaCtx, objectCtx, arguments, paramTypes, typeMaps, callback);
+            request.arguments(list);
+
+            serverBinding.getBindingImpl().unmarshal(corbaCtx, objectCtx, callback);
+
+            boolean isOneWay = callback.isOneWay();
+            doCeltixInvocation(callback, objectCtx);
+
+            corbaCtx.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.FALSE);
+            if (!isOneWay) {
+                if (objectCtx.getException() != null) {
+                    serverBinding.getBindingImpl().marshalFault(objectCtx, corbaCtx, callback);
+                    Any exAny = orb.create_any();
+                    exAny.insert_Streamable(corbaCtx.getMessage().getStreamableException());
+                    request.set_exception(exAny);
+                } else {
+                    serverBinding.getBindingImpl().marshal(objectCtx, corbaCtx, callback);
+
+                    arguments = corbaCtx.getMessage().getStreamableArguments();
+                    for (int i = 0; i < arguments.length; ++i) {
+                        if (list.item(i).flags() != org.omg.CORBA.ARG_IN.value) {
+                            list.item(i).value().insert_Streamable(arguments[i]);
+                        }
+                    }
+
+                    CorbaStreamable resultValue = corbaCtx.getMessage().getStreamableReturn();
+                    if (resultValue != null) {
+                        Any resultAny = orb.create_any();
+                        resultAny.insert_Streamable(resultValue);
+                        request.set_result(resultAny);
+                    }
+                }
+            }
+
+        } catch (java.lang.Exception ex) {
+            throw new CorbaBindingException("Exception during invoke", ex);
+        }
+        */
+    }
+    /*
+    public NVList prepareDIIArgsList(CorbaMessageContext corbaCtx, ObjectMessageContext objContext, 
+                                     CorbaStreamable[] streamables, List<ParamType> params,  
+                                     List<CorbaTypeMap> typeMaps, DataBindingCallback callback) {
+        NVList list = orb.create_list(streamables.length);
+
+        // We need to check to see if Celtix is using the return type of the operation as the method for
+        // passing back the value of a CORBA out parameter.
+        Object[] args = objContext.getMessageObjects();
+        boolean hasOutParamReturn = false;
+        if (args != null) {
+            hasOutParamReturn = params.size() != args.length;
+        } else {
+            hasOutParamReturn = params.size() > 0;
+        }
+        
+        int paramOffset = 0;
+        int cbParamCount = 0;
+        for (Iterator<ParamType> iter = params.iterator(); iter.hasNext();) {
+            int index = cbParamCount + paramOffset;
+            ParamType pType = iter.next();
+            QName paramName = null;
+            if (pType.getMode().equals(ModeType.OUT) && hasOutParamReturn) {
+                paramName = new QName(callback.getWebResult().targetNamespace(),
+                                      callback.getWebResult().name());
+                paramOffset = 1;
+            } else {
+                paramName = new QName(callback.getWebParam(cbParamCount).targetNamespace(),
+                                      callback.getWebParam(cbParamCount).name());
+                cbParamCount++;
+            }
+            QName paramIdlType = pType.getIdltype();
+            ModeType paramMode = pType.getMode();
+
+            CorbaObjectHandler obj = 
+                CorbaHandlerUtils.initializeObjectHandler(orb, paramName, paramIdlType, typeMaps);
+
+            streamables[index] = new CorbaStreamable(obj, paramName);
+            if (paramMode.value().equals("in")) {
+                streamables[index].setMode(org.omg.CORBA.ARG_IN.value);
+            } else if (paramMode.value().equals("out")) {
+                streamables[index].setMode(org.omg.CORBA.ARG_OUT.value);
+            } else {
+                streamables[index].setMode(org.omg.CORBA.ARG_INOUT.value);
+            }
+
+            Any value = orb.create_any();
+            value.insert_Streamable(streamables[index]);
+            list.add_value(streamables[index].getName(), value, streamables[index].getMode());
+            corbaCtx.getMessage().addStreamableArgument(streamables[index]);
+        }
+        return list;
+    }
+
+    public void doCeltixInvocation(DataBindingCallback callback, ObjectMessageContext objectCtx) {
+        try {
+            ServerDataBindingCallback method = (ServerDataBindingCallback) callback;
+            new WebServiceContextImpl(objectCtx);
+            method.invoke(objectCtx);
+        } catch (WebServiceException ex) {
+            Throwable cause = ex.getCause();
+            if (cause != null) {
+                objectCtx.setException(cause);
+            } else {
+                objectCtx.setException(ex);
+            }
+        } catch (InvocationTargetException ex) {
+            Throwable cause = ex.getCause();
+            if (cause != null) {
+                objectCtx.setException(cause);
+            } else {
+                objectCtx.setException(ex);
+            }
+        }
+    }
+    */
+    public String[] _all_interfaces(POA poa, byte[] objectId) {
+        return interfaces.toArray(new String[interfaces.size()]);
+    }
+
+    public POA _default_POA() {
+        return servantPOA;
+    }
+}

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java?view=auto&rev=452146
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java (added)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java Mon Oct  2 10:50:34 2006
@@ -0,0 +1,205 @@
+/**
+ * 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.yoko.bindings.corba2;
+
+import java.io.IOException;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.Destination;
+import org.apache.cxf.transport.MessageObserver;
+import org.apache.cxf.ws.addressing.AttributedURIType;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+
+import org.apache.schemas.yoko.bindings.corba.AddressType;
+
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.Policy;
+import org.omg.PortableServer.POA;
+import org.omg.PortableServer.POAHelper;
+import org.omg.PortableServer.POAManager;
+
+public class CorbaDestination implements Destination {
+    
+    private static final Logger LOG = LogUtils.getL7dLogger(CorbaDestination.class);
+    private AddressType address;
+    private EndpointReferenceType reference;
+    private ORB orb;
+    private BindingInfo binding;
+
+    public CorbaDestination(EndpointInfo ei) {
+        address = ei.getExtensor(AddressType.class);
+        binding = ei.getBinding();
+        reference = new EndpointReferenceType();
+        AttributedURIType addr = new AttributedURIType();
+        addr.setValue(address.getLocation());
+        reference.setAddress(addr);
+    }
+
+    public EndpointReferenceType getAddress() {
+        return reference;
+    }    
+
+    public Conduit getBackChannel(Message inMessage,
+                                  Message partialResponse,
+                                  EndpointReferenceType ref)
+        throws IOException {
+        return null;
+    }
+
+    public BindingInfo getBindingInfo() {
+        return binding;
+    }
+
+    public void shutdown() {
+        if (orb != null) {
+            try {
+                orb.destroy();
+            } catch (Exception ex) {
+                // TODO: For now, we just consume.  Revisit.
+            }
+        }
+    }
+
+    public synchronized void setMessageObserver(MessageObserver observer) {
+        String location = address.getLocation();
+        LOG.info("Service address retrieved: " + location);
+        
+        // TODO: Get any configuration options for the ORB and set the appropriate properties.
+        java.util.Properties props = System.getProperties();
+        props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
+        props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton");
+        props.put("yoko.orb.id", "Yoko-Server-Binding");
+
+        // If we have one of these two types of addresses, we should specify the address
+        // and port information as properties to the ORB during initialization.
+        if (location.startsWith("IOR:")) {
+            // TODO: How to handle this? Can we obtain port/host information from the IOR
+            // or do we just want to let the ORB pick the port and export the IOR to the 
+            // Logs?
+        } else if (location.startsWith("corbaloc")) {
+            int corbalocIndex = location.indexOf(":");
+            int protocolIndex = location.indexOf(":", corbalocIndex + 1);
+            String protocol = location.substring(corbalocIndex + 1, protocolIndex);
+            int hostIndex = location.indexOf(":", protocolIndex + 1);
+            String host = location.substring(protocolIndex + 1, hostIndex);
+            // the port number should be followed by a '/' character
+            int portIndex = location.indexOf("/", hostIndex + 1);
+            String port = location.substring(hostIndex + 1, portIndex);
+            if (protocol.length() == 0) {
+                // This means no protocol was defined.  Default to iiop
+                protocol = "iiop";
+            }
+            props.put("yoko.orb.oa.endpoint", new String(protocol + " --host " + host + " --port " + port));
+            LOG.info("Set server endpoint: " + protocol + " --host " + host + " --port " + port);
+        }
+        orb = ORB.init(new String[0], props);
+        activate(observer);
+    }
+
+    public void activate(MessageObserver observer) {
+        // Get the address that the DSI servant should be publishing
+        String location = address.getLocation();
+
+        org.omg.CORBA.Object obj = null;
+        try {
+            POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
+            POAManager poaManager = rootPOA.the_POAManager();
+
+            Policy[] policies = new Policy[3];
+            policies[0] = rootPOA
+                    .create_lifespan_policy(
+                        org.omg.PortableServer.LifespanPolicyValue.PERSISTENT);
+            policies[1] = rootPOA
+                    .create_implicit_activation_policy(
+                        org.omg.PortableServer.ImplicitActivationPolicyValue.NO_IMPLICIT_ACTIVATION);
+            policies[2] = rootPOA
+                    .create_id_uniqueness_policy(
+                        org.omg.PortableServer.IdUniquenessPolicyValue.UNIQUE_ID);
+
+            POA bindingPOA = rootPOA.create_POA("BindingPOA", poaManager, policies);
+            CorbaDSIServant servant = new CorbaDSIServant(orb, bindingPOA, this, observer);
+            byte[] objectId = bindingPOA.activate_object(servant);
+            obj = bindingPOA.id_to_reference(objectId);
+            
+            if (location.startsWith("relfile:")) {
+                String iorFile = location.substring("relfile:".length(), location.length());
+                // allow for up to 3 '/' to match common uses of relfile url format
+                for (int n = 0; n < 3; n++) {
+                    if (iorFile.charAt(0) != '/') {
+                        break;
+                    } else {
+                        iorFile = iorFile.substring(1);
+                    }
+                }
+
+                CorbaUtils.exportObjectReferenceToFile(obj, orb, iorFile);
+            } else if (location.startsWith("file:")) {
+                String iorFile = location.substring("file:".length(), location.length());
+                // allow for up to 3 '/' to match common uses of file url format
+                for (int n = 0; n < 3; n++) {
+                    if (iorFile.charAt(0) != '/') {
+                        break;
+                    } else {
+                        iorFile = iorFile.substring(1);
+                    }
+                }
+                // to match the ORB, file must have complete path information, therefore we add
+                // a '/' prefix to the address
+                //iorFile = "/" + iorFile;
+                CorbaUtils.exportObjectReferenceToFile(obj, orb, iorFile);
+            } else if (location.startsWith("corbaloc")) {
+                // Try add the key to the boot manager.  This is required for a corbaloc
+                try {
+                    int keyIndex = location.indexOf('/');
+                    String key = location.substring(keyIndex + 1);
+                    org.apache.yoko.orb.OB.BootManager bootManager = 
+                        org.apache.yoko.orb.OB.BootManagerHelper.narrow(
+                            orb.resolve_initial_references("BootManager"));
+                    bootManager.add_binding(key.getBytes(), obj);
+                    LOG.info("Added key " + key + " to bootmanager");
+                } catch (Exception ex) {
+                    // TODO: Continue without for now
+                }
+                String ior = orb.object_to_string(obj);
+                address.setLocation(ior);
+                String iorFile = "endpoint.ior";
+                CorbaUtils.exportObjectReferenceToFile(obj, orb, iorFile);
+            } else {
+                String ior = orb.object_to_string(obj);
+                address.setLocation(ior);
+                String iorFile = "endpoint.ior";
+                CorbaUtils.exportObjectReferenceToFile(obj, orb, iorFile);
+                LOG.info("Object Reference: " + orb.object_to_string(obj));
+            }
+            // TODO: Provide other export mechanisms? 
+            
+            poaManager.activate();
+        } catch (Exception ex) {
+            // TODO: Throw appropriate exception
+            throw new CorbaBindingException("Unable to active CORBA servant", ex);
+        }
+    }    
+
+}

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java?view=auto&rev=452146
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java (added)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java Mon Oct  2 10:50:34 2006
@@ -0,0 +1,30 @@
+/**
+ * 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.yoko.bindings.corba2;
+
+import org.apache.cxf.message.AbstractWrappedMessage;
+import org.apache.cxf.message.Message;
+
+public class CorbaMessage extends AbstractWrappedMessage {
+
+    public CorbaMessage(Message m) {
+        super(m);
+    }
+}

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java?view=auto&rev=452146
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java (added)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java Mon Oct  2 10:50:34 2006
@@ -0,0 +1,58 @@
+/**
+ * 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.yoko.bindings.corba2;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.yoko.wsdl.CorbaTypeImpl;
+
+public class CorbaTypeMap {
+
+    private String targetNamespace;
+    private String prefix;
+    private Map<String, CorbaTypeImpl> typeMap;
+
+    public CorbaTypeMap(String namespace) {
+        targetNamespace = namespace;
+        typeMap = new HashMap<String, CorbaTypeImpl>();
+    }
+
+    public void addType(String name, CorbaTypeImpl type) {
+        typeMap.put(name, type);
+    }
+
+    public CorbaTypeImpl getType(String name) {
+        assert name != null;
+
+        return typeMap.get(name);
+    }
+
+    public String getTargetNamespace() {
+        return targetNamespace;
+    }
+
+    public void setPrefix(String pfx) {
+        prefix = pfx;
+    }
+
+    public String getPrefix() {
+        return prefix;
+    }
+}

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java?view=auto&rev=452146
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java (added)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java Mon Oct  2 10:50:34 2006
@@ -0,0 +1,404 @@
+/**
+ * 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.yoko.bindings.corba2;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import javax.wsdl.Definition;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.common.logging.LogUtils;
+
+import org.apache.schemas.yoko.bindings.corba.Alias;
+import org.apache.schemas.yoko.bindings.corba.Anonarray;
+import org.apache.schemas.yoko.bindings.corba.Anonfixed;
+import org.apache.schemas.yoko.bindings.corba.Anonsequence;
+import org.apache.schemas.yoko.bindings.corba.Anonstring;
+import org.apache.schemas.yoko.bindings.corba.Anonwstring;
+import org.apache.schemas.yoko.bindings.corba.Array;
+import org.apache.schemas.yoko.bindings.corba.CaseType;
+import org.apache.schemas.yoko.bindings.corba.Const;
+import org.apache.schemas.yoko.bindings.corba.CorbaType;
+import org.apache.schemas.yoko.bindings.corba.Enum;
+import org.apache.schemas.yoko.bindings.corba.Enumerator;
+import org.apache.schemas.yoko.bindings.corba.Exception;
+import org.apache.schemas.yoko.bindings.corba.Fixed;
+import org.apache.schemas.yoko.bindings.corba.MemberType;
+import org.apache.schemas.yoko.bindings.corba.Sequence;
+import org.apache.schemas.yoko.bindings.corba.Struct;
+import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
+import org.apache.schemas.yoko.bindings.corba.Union;
+import org.apache.schemas.yoko.bindings.corba.Unionbranch;
+import org.apache.yoko.wsdl.CorbaConstants;
+import org.apache.yoko.wsdl.CorbaTypeImpl;
+
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.StructMember;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.UnionMember;
+
+public class CorbaUtils {
+
+    static Map<QName, TCKind> PRIMITIVE_TYPECODES = new HashMap<QName, TCKind>();
+   
+    private static final Logger LOG = LogUtils.getL7dLogger(CorbaUtils.class);
+    
+    public static TypeCode getTypeCode(ORB orb, QName type, List<CorbaTypeMap> typeMaps) {
+        TypeCode tc = null;
+
+        // first see if it is a primitive
+        tc = getPrimitiveTypeCode(orb, type);
+        if (tc == null) {
+            // this means it is not a primitive type
+            CorbaTypeMap currentMap = null;
+            for (int i = 0; i < typeMaps.size(); ++i) {
+                if (typeMaps.get(i).getTargetNamespace().equals(type.getNamespaceURI())) {
+                    currentMap = typeMaps.get(i);
+                    break;
+                }
+            }
+
+            if (currentMap == null) {
+                throw new CorbaBindingException("Unable to locate typemap for namespace \"" 
+                                                + type.getNamespaceURI() + "\"");
+            }
+
+            CorbaType obj = currentMap.getType(type.getLocalPart());
+            if (obj == null) {
+                throw new CorbaBindingException("Unable to locate object definition");
+            }
+
+            tc = getComplexTypeCode(orb, type, obj, typeMaps);
+        }
+        return tc;
+    }
+
+    public static TypeCode getPrimitiveTypeCode(ORB orb, QName type) {
+        TCKind kind = PRIMITIVE_TYPECODES.get(type);
+        if (kind != null) {
+            return orb.get_primitive_tc(kind);
+        }
+
+        // There is a possiblitity that the idl type will not have its namespace URI set if it has
+        // been read directly from the WSDL file as a string. Try with the standard corba namespace URI.
+        if (type.getNamespaceURI() == null) {
+            QName uriIdltype = new QName(CorbaConstants.NU_WSDL_CORBA, type.getLocalPart(), type.getPrefix());
+
+            kind = PRIMITIVE_TYPECODES.get(uriIdltype);
+            if (kind != null) {
+                return orb.get_primitive_tc(kind);
+            }
+        }
+        return null;
+    }
+
+    public static TypeCode getComplexTypeCode(ORB orb, QName type, Object obj, List<CorbaTypeMap> typeMaps) {
+
+        TypeCode tc = null;
+        
+        // Split all of these up into separate get*** methods.  One big method will not satisfy checkstyle
+        // rules
+        if (obj instanceof Alias) {
+            Alias aliasType = (Alias)obj;
+            tc = orb.create_alias_tc(aliasType.getRepositoryID(), 
+                                     aliasType.getName(), 
+                                     getTypeCode(orb, aliasType.getBasetype(), typeMaps));
+        } else if (obj instanceof Anonarray) {
+            Anonarray anonArrayType = (Anonarray)obj;
+            tc = orb.create_array_tc((int) anonArrayType.getBound(), 
+                                     getTypeCode(orb, anonArrayType.getElemtype(), typeMaps));
+        } else if (obj instanceof Anonfixed) {
+            Anonfixed anonFixedType = (Anonfixed) obj;
+            tc = orb.create_fixed_tc((short) anonFixedType.getDigits(), (short) anonFixedType.getScale());
+        } else if (obj instanceof Anonsequence) {
+            Anonsequence anonSeqType = (Anonsequence)obj;
+            tc = orb.create_sequence_tc((int) anonSeqType.getBound(), 
+                                        getTypeCode(orb, anonSeqType.getElemtype(), typeMaps));
+        } else if (obj instanceof Anonstring) {
+            Anonstring anonStringType = (Anonstring)obj;
+            tc = orb.create_string_tc((int)anonStringType.getBound());
+        } else if (obj instanceof Anonwstring) {
+            Anonwstring anonWStringType = (Anonwstring)obj;
+            tc = orb.create_wstring_tc((int)anonWStringType.getBound());
+        } else if (obj instanceof Array) {
+            Array arrayType = (Array)obj;
+            tc = orb.create_array_tc((int) arrayType.getBound(), 
+                                     getTypeCode(orb, arrayType.getElemtype(), typeMaps));
+        } else if (obj instanceof Const) {
+            Const constType = (Const)obj;
+            tc = getTypeCode(orb, constType.getIdltype(), typeMaps);
+        } else if (obj instanceof Enum) {
+            Enum enumType = (Enum)obj;
+            String name = enumType.getName();
+            List enums = enumType.getEnumerator();
+            String[] members = new String[enums.size()];
+
+            for (int i = 0; i < members.length; ++i) {
+                members[i] = ((Enumerator) enums.get(i)).getValue();
+            }
+            tc = orb.create_enum_tc(enumType.getRepositoryID(), name, members);
+        } else if (obj instanceof Exception) {
+            Exception exceptType = (Exception)obj;
+
+            // TODO: check to see if this is a recursive type.
+            List list = exceptType.getMember();
+            StructMember[] members = new StructMember[list.size()];
+            for (int i = 0; i < members.length; ++i) {
+                MemberType member = (MemberType) list.get(i);
+                members[i] = new StructMember(member.getName(), 
+                                              getTypeCode(orb, member.getIdltype(), typeMaps), null);
+            }
+            String name = exceptType.getName();
+            tc = orb.create_exception_tc(exceptType.getRepositoryID(), name, members);
+        } else if (obj instanceof Fixed) {
+            Fixed fixedType = (Fixed) obj;
+            tc = orb.create_fixed_tc((short) fixedType.getDigits(), (short) fixedType.getScale());
+        } else if (obj instanceof Sequence) {
+            Sequence seqType = (Sequence)obj;
+            tc = orb.create_sequence_tc((int) seqType.getBound(), 
+                                        getTypeCode(orb, seqType.getElemtype(), typeMaps));
+        } else if (obj instanceof Struct) {
+            Struct structType = (Struct)obj;
+
+            // TODO: check to see if this is a recursive type.
+            List list = structType.getMember();
+            StructMember[] members = new StructMember[list.size()];
+            for (int i = 0; i < members.length; ++i) {
+                MemberType member = (MemberType) list.get(i);
+                members[i] = new StructMember(member.getName(), 
+                                              getTypeCode(orb, member.getIdltype(), typeMaps), null);
+            }
+            String name = structType.getName();
+            tc = orb.create_struct_tc(structType.getRepositoryID(), name, members);
+        } else if (obj instanceof Union) {
+            tc = getUnionTypeCode(orb, obj, typeMaps);
+        }
+        return tc;
+    }
+    
+    public static TypeCode getUnionTypeCode(ORB orb, Object obj, List<CorbaTypeMap> typeMaps) {
+        Union unionType = (Union)obj;
+        
+        TypeCode discTC = getTypeCode(orb, unionType.getDiscriminator(), typeMaps);
+        Map<String, UnionMember> members = new LinkedHashMap<String, UnionMember>();
+        List<Unionbranch> branches = unionType.getUnionbranch();
+        for (Iterator<Unionbranch> branchIter = branches.iterator(); branchIter.hasNext();) {
+            Unionbranch branch = branchIter.next();
+            List<CaseType> cases = branch.getCase();
+            for (Iterator<CaseType> caseIter = cases.iterator(); caseIter.hasNext();) {
+                CaseType cs = caseIter.next();
+                UnionMember member = new UnionMember();
+                member.name = branch.getName();
+                member.type = getTypeCode(orb, branch.getIdltype(), typeMaps);
+                member.label = orb.create_any();
+                
+                // We need to insert the labels in a way that depends on the type of the discriminator.  
+                // According to the CORBA specification, the following types are permissable as 
+                // discriminator types:
+                //    * signed & unsigned short
+                //    * signed & unsigned long
+                //    * signed & unsigned long long
+                //    * char
+                //    * boolean
+                switch (discTC.kind().value()) {
+                case TCKind._tk_short:
+                    member.label.insert_short(Short.parseShort(cs.getLabel()));
+                    break;
+                case TCKind._tk_ushort:
+                    member.label.insert_ushort(Short.parseShort(cs.getLabel()));
+                    break;
+                case TCKind._tk_long:
+                    member.label.insert_long(Integer.parseInt(cs.getLabel()));
+                    break;
+                case TCKind._tk_ulong:
+                    member.label.insert_ulong(Integer.parseInt(cs.getLabel()));
+                    break;
+                case TCKind._tk_longlong:
+                    member.label.insert_longlong(Long.parseLong(cs.getLabel()));
+                    break;
+                case TCKind._tk_ulonglong:
+                    member.label.insert_ulonglong(Long.parseLong(cs.getLabel()));
+                    break;
+                case TCKind._tk_char:
+                    member.label.insert_char(cs.getLabel().charAt(0));
+                    break;
+                case TCKind._tk_boolean:
+                    member.label.insert_boolean(Boolean.parseBoolean(cs.getLabel()));
+                    break;
+                default:
+                    // TODO: Throw exception since this is an unsupported discriminator type
+                }
+                // Yoko orb is strict on how the case labels are stored for each member.  So we can't
+                // simply insert the labels as strings 
+                members.put(cs.getLabel(), member);
+            }
+        }
+        return orb.create_union_tc(unionType.getRepositoryID(), 
+                                   unionType.getName(), 
+                                   discTC, 
+                                   (UnionMember[])members.values().toArray(new UnionMember[members.size()]));
+    }
+
+    public static boolean isPrimitiveIdlType(QName idltype) {
+        TCKind kind = PRIMITIVE_TYPECODES.get(idltype);
+        if (kind != null) {
+            return true;
+        }
+
+        // There is a possiblitity that the idl type will not have its namespace URI set if it has
+        // been read directly from the WSDL file as a string. Try with the standard corba namespace URI.
+        if (idltype.getNamespaceURI() == null) {
+            QName uriIdltype = new QName(CorbaConstants.NU_WSDL_CORBA, idltype.getLocalPart(), 
+                                         idltype.getPrefix());
+            kind = PRIMITIVE_TYPECODES.get(uriIdltype);
+            if (kind != null) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    public static CorbaTypeImpl getCorbaType(QName idlType, List<CorbaTypeMap> typeMaps) {
+        CorbaTypeMap currentMap = null;
+        for (int i = 0; i < typeMaps.size(); ++i) {
+            currentMap = typeMaps.get(i);
+            if (currentMap.getTargetNamespace().equals(idlType.getNamespaceURI())) {
+                return (CorbaTypeImpl) currentMap.getType(idlType.getLocalPart());
+            }
+        }
+
+        return null;
+    }
+
+    public static void getTypeMapFromDefinition(List<CorbaTypeMap> typeMaps, Definition wsdlDef) {
+        List extElements = wsdlDef.getExtensibilityElements();
+
+        for (Iterator iter = extElements.iterator(); iter.hasNext();) {
+            Object e = iter.next();
+            if (e instanceof TypeMappingType) {
+                TypeMappingType tmType = (TypeMappingType) e;
+
+                CorbaTypeMap map = null;
+                for (Iterator<CorbaTypeMap> it = typeMaps.iterator(); it.hasNext();) {
+                    CorbaTypeMap tm = it.next();
+                    if (tm.getTargetNamespace().equals(tmType.getTargetNamespace())) {
+                        LOG.info("Found an existing typemap with the same namespace");
+                        map = tm;
+                        break;
+                    }
+                }
+                
+                if (map == null) {
+                    map = new CorbaTypeMap(tmType.getTargetNamespace());
+                    map.setPrefix(wsdlDef.getPrefix(tmType.getTargetNamespace()));
+                    typeMaps.add(map);
+                }
+                
+                LOG.info("Found typemap in WSDL (Namespace: " + tmType.getTargetNamespace()
+                         + ", Prefix: " + wsdlDef.getPrefix(tmType.getTargetNamespace()));
+
+                List<CorbaTypeImpl> types = tmType.getStructOrExceptionOrUnion();
+                LOG.info("Found " + types.size() + " types defined in the typemap");
+                for (Iterator<CorbaTypeImpl> it = types.iterator(); it.hasNext();) {
+                    CorbaTypeImpl corbaType = it.next();
+                    map.addType(corbaType.getName(), corbaType);
+                    LOG.info("Adding type " + corbaType.getName());
+                }
+            }
+        }
+    }
+    
+    public static void exportObjectReferenceToFile(org.omg.CORBA.Object obj, ORB orb, String iorFile) 
+        throws IOException {
+        String ref = orb.object_to_string(obj);
+        FileOutputStream file = new FileOutputStream(iorFile);
+        PrintWriter out = new PrintWriter(file);
+        out.println(ref);
+        out.flush();
+        file.close();
+    }
+
+    public static org.omg.CORBA.Object importObjectReference(ORB orb,
+                                                             String url) {
+        org.omg.CORBA.Object result;
+
+        if (url.startsWith("file:")) {
+            return importObjectReferenceFromFile(orb, url.substring(5));
+        } else if ((url.equals("ior:")) || (url.equals("IOR:"))) {
+            throw new RuntimeException("Proxy not initialized. URL contains a invalid ior");
+        }
+        
+        try {
+            result = orb.string_to_object(url.trim());
+        } catch (java.lang.Exception ex) {
+            throw new RuntimeException(ex);
+        }
+
+        return result;
+    }
+
+    public static org.omg.CORBA.Object importObjectReferenceFromFile(ORB orb,
+                                                                     String url) {
+        org.omg.CORBA.Object result;
+
+        try {
+            java.io.File file = new java.io.File(url);
+            if (!file.exists()) {
+                throw new RuntimeException("Could not find file " + url + " to read the object reference");
+            }
+            java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader(file));
+            String ior = reader.readLine();
+            if (ior == null) {
+                throw new RuntimeException("Invalid object reference found in file " + url);
+            }
+            result = orb.string_to_object(ior.trim());
+        } catch (java.io.IOException ex) {
+            throw new RuntimeException(ex);
+        }
+        return result;
+    }
+
+    static {
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_BOOLEAN, TCKind.from_int(TCKind._tk_boolean));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_CHAR, TCKind.from_int(TCKind._tk_char));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_WCHAR, TCKind.from_int(TCKind._tk_wchar));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_OCTET, TCKind.from_int(TCKind._tk_octet));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_USHORT, TCKind.from_int(TCKind._tk_ushort));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_SHORT, TCKind.from_int(TCKind._tk_short));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_LONG, TCKind.from_int(TCKind._tk_long));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_ULONG, TCKind.from_int(TCKind._tk_ulong));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_LONGLONG, TCKind.from_int(TCKind._tk_longlong));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_ULONGLONG, TCKind.from_int(TCKind._tk_ulonglong));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_FLOAT, TCKind.from_int(TCKind._tk_float));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_DOUBLE, TCKind.from_int(TCKind._tk_double));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_STRING, TCKind.from_int(TCKind._tk_string));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_WSTRING, TCKind.from_int(TCKind._tk_wstring));
+        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_ANY, TCKind.from_int(TCKind._tk_any));
+    }
+}

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties?view=auto&rev=452146
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties (added)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties Mon Oct  2 10:50:34 2006
@@ -0,0 +1 @@
+// TODO: Add messages here for exceptions

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message