You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by br...@apache.org on 2006/10/19 14:31:56 UTC
svn commit: r465642 [1/5] - in /incubator/yoko/branches/cxf_port: ./ api/
bindings/ bindings/src/main/java/org/apache/yoko/bindings/corba2/
bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/ tools/
tools/src/main/java/org/apache/yoko/...
Author: bravi
Date: Thu Oct 19 07:31:44 2006
New Revision: 465642
URL: http://svn.apache.org/viewvc?view=rev&rev=465642
Log:
[YOKO-170] - Updates to the cxf_port branch.
Added:
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaInInterceptor.java (with props)
incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java (with props)
Modified:
incubator/yoko/branches/cxf_port/api/.checkstyle
incubator/yoko/branches/cxf_port/api/.pmd
incubator/yoko/branches/cxf_port/api/.ruleset
incubator/yoko/branches/cxf_port/api/checkstyle.xml
incubator/yoko/branches/cxf_port/api/pom.xml
incubator/yoko/branches/cxf_port/bindings/pom.xml
incubator/yoko/branches/cxf_port/pom.xml
incubator/yoko/branches/cxf_port/tools/pom.xml
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/CorbaPrimitiveMap.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/XmlSchemaPrimitiveMap.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ArrayVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/EnumVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/ExceptionVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/FixedVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/StructVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesUtils.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/UnionVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToProcessor.java
incubator/yoko/branches/cxf_port/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java
incubator/yoko/branches/cxf_port/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
incubator/yoko/branches/cxf_port/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java
incubator/yoko/branches/cxf_port/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java
incubator/yoko/branches/cxf_port/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/Const.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/Enum.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/Exception.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/Fixed.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/Oneway.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/Struct.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/Union.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/expected_Const.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/expected_Enum.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/expected_Exception.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/expected_Fixed.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/expected_HelloWorld.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/expected_Oneway.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/expected_Primitives.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/expected_Struct.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idl/expected_Union.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/TypeInheritance.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/alltype.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/anonfixed.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/anontype.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/any.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/array.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/content.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/enum.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/exceptions.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_alltype.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_anonfixed.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_anontype.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_any.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_array.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_content.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_enum.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_exceptions.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_fixed.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_integertypes.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_sequencetype.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_stringtypes.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_struct.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/expected_typeInheritance.idl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/fixed.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/integertypes.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/sequencetype.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/stringtypes.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/struct.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/idlgen/uniontypes.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/TypeInheritance.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/alltype.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/anonfixed.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/any.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/array.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/atype.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/content.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/exceptions.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/fixed.wsdl
incubator/yoko/branches/cxf_port/tools/src/test/resources/wsdl/sequencetype.wsdl
Modified: incubator/yoko/branches/cxf_port/api/.checkstyle
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/api/.checkstyle?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/api/.checkstyle (original)
+++ incubator/yoko/branches/cxf_port/api/.checkstyle Thu Oct 19 07:31:44 2006
@@ -1,4 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?><fileset-config file-format-version="1.1.0" simple-config="false">
+<?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.
+-->
+<fileset-config file-format-version="1.1.0" simple-config="false">
<fileset name="all" enabled="true" check-config-name="Yoko Checks" type="external" description=""><file-match-pattern match-pattern="^src[/\\]." include-pattern="true"/>
</fileset>
</fileset-config>
Modified: incubator/yoko/branches/cxf_port/api/.pmd
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/api/.pmd?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/api/.pmd (original)
+++ incubator/yoko/branches/cxf_port/api/.pmd Thu Oct 19 07:31:44 2006
@@ -1,2 +1,20 @@
<?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.
+-->
<pmd><useProjectRuleSet>true</useProjectRuleSet><rules/></pmd>
Modified: incubator/yoko/branches/cxf_port/api/.ruleset
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/api/.ruleset?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/api/.ruleset (original)
+++ incubator/yoko/branches/cxf_port/api/.ruleset Thu Oct 19 07:31:44 2006
@@ -1,4 +1,22 @@
<?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.
+-->
<ruleset name="pmd-eclipse">
<description>PMD Plugin preferences rule set</description>
Modified: incubator/yoko/branches/cxf_port/api/checkstyle.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/api/checkstyle.xml?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/api/checkstyle.xml (original)
+++ incubator/yoko/branches/cxf_port/api/checkstyle.xml Thu Oct 19 07:31:44 2006
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+ * 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.
+-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
Modified: incubator/yoko/branches/cxf_port/api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/api/pom.xml?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/api/pom.xml (original)
+++ incubator/yoko/branches/cxf_port/api/pom.xml Thu Oct 19 07:31:44 2006
@@ -1,3 +1,22 @@
+<?xml version="1.0"?>
+<!--
+ * 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 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>
@@ -29,25 +48,18 @@
<version>2.0-20050821.154600</version>
<scope>test</scope>
</dependency> -->
-
<dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-common</artifactId>
- <version>${cxf.version}</version>
+ <artifactId>cxf-common-utilities</artifactId>
</dependency>
-
<dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-tools-common</artifactId>
- <version>${cxf.version}</version>
+ <artifactId>cxf-api</artifactId>
</dependency>
-
<dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-api</artifactId>
- <version>${cxf.version}</version>
+ <artifactId>cxf-tools-common</artifactId>
</dependency>
-
</dependencies>
@@ -94,7 +106,7 @@
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-codegen-plugin</artifactId>
+ <artifactId>cxf-common-xsd</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
@@ -105,7 +117,7 @@
<xsdOptions>
<xsdOption>
<xsd>${basedir}/src/main/resources/schemas/wsdl/corba-binding.xsd</xsd>
- </xsdOption>
+ </xsdOption>
</xsdOptions>
</configuration>
<goals>
Modified: incubator/yoko/branches/cxf_port/bindings/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/pom.xml?view=diff&rev=465642&r1=465641&r2=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/pom.xml (original)
+++ incubator/yoko/branches/cxf_port/bindings/pom.xml Thu Oct 19 07:31:44 2006
@@ -1,3 +1,22 @@
+<?xml version="1.0"?>
+<!--
+ * 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 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>
@@ -21,6 +40,21 @@
<groupId>junit</groupId>
<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>
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java Thu Oct 19 07:31:44 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/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBinding.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java Thu Oct 19 07:31:44 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/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingException.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java Thu Oct 19 07:31:44 2006
@@ -0,0 +1,112 @@
+/**
+ * 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.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.getOutInterceptors().add(new CorbaOutInterceptor());
+ //binding.getOutFaultInterceptors().add(new CorbaFaultInterceptor());
+ return binding;
+ }
+
+ public Conduit getConduit(EndpointInfo endpointInfo)
+ throws IOException {
+ return getConduit(endpointInfo, null);
+ }
+
+ public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target)
+ throws IOException {
+ return new CorbaConduit(endpointInfo, target);
+ }
+
+ public Destination getDestination(EndpointInfo endpointInfo)
+ throws IOException {
+ return new CorbaDestination(endpointInfo);
+ }
+}
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaBindingFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java Thu Oct 19 07:31:44 2006
@@ -0,0 +1,119 @@
+/**
+ * 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.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.message.Message;
+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.apache.yoko.wsdl.CorbaConstants;
+
+import org.omg.CORBA.ORB;
+
+public class CorbaConduit implements Conduit {
+ private static final Logger LOG = LogUtils.getL7dLogger(CorbaConduit.class);
+
+ private EndpointInfo endpointInfo;
+ private EndpointReferenceType target;
+ private MessageObserver incomingObserver;
+ private ORB orb;
+
+
+ public CorbaConduit(EndpointInfo ei, EndpointReferenceType ref) {
+ endpointInfo = ei;
+ target = getTargetReference(ref);
+ }
+
+ public void send(Message message) throws IOException {
+ System.out.println("send message...");
+ // TODO: Set any additional properties needed to initialize the ORB before
+ // we initialize it. We will get this information from the Celtix configuration
+ // that is used with the current application.
+ 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-Client-Binding");
+
+ orb = ORB.init(new String[0], props);
+ if (orb == null) {
+ LOG.severe("Could not create instance of the ORB");
+ throw new CorbaBindingException("Could not create instance of the ORB");
+ }
+
+ try {
+ AddressType address = endpointInfo.getExtensor(AddressType.class);
+
+ if (address == null) {
+ LOG.log(Level.SEVERE, "Unable to locate a valid CORBA address");
+ throw new CorbaBindingException("Unable to locate a valid CORBA address");
+ }
+ org.omg.CORBA.Object targetObject = CorbaUtils.importObjectReference(orb, address.getLocation());
+ message.put(CorbaConstants.CORBA_ENDPOINT_OBJECT, targetObject);
+ } catch (java.lang.Exception ex) {
+ LOG.log(Level.SEVERE, "Could not resolve target object");
+ throw new CorbaBindingException(ex);
+ }
+ }
+
+ public void close(Message message) throws IOException {
+ }
+
+ public EndpointReferenceType getTarget() {
+ return target;
+ }
+
+ public Destination getBackChannel() {
+ return null;
+ }
+
+ public void close() {
+ }
+
+ public void setMessageObserver(MessageObserver observer) {
+ incomingObserver = observer;
+ }
+
+ public EndpointReferenceType getTargetReference(EndpointReferenceType t) {
+ EndpointReferenceType ref = null;
+ if (null == t) {
+ ref = new EndpointReferenceType();
+ AttributedURIType address = new AttributedURIType();
+ address.setValue(getAddress());
+ ref.setAddress(address);
+ } else {
+ ref = t;
+ }
+ return ref;
+ }
+
+ private String getAddress() {
+ return endpointInfo.getAddress();
+ }
+}
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java Thu Oct 19 07:31:44 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/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDSIServant.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java Thu Oct 19 07:31:44 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/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaDestination.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java Thu Oct 19 07:31:44 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/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java Thu Oct 19 07:31:44 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/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaTypeMap.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java Thu Oct 19 07:31:44 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/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaUtils.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties Thu Oct 19 07:31:44 2006
@@ -0,0 +1 @@
+// TODO: Add messages here for exceptions
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/Messages.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaInInterceptor.java?view=auto&rev=465642
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaInInterceptor.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaInInterceptor.java Thu Oct 19 07:31:44 2006
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.yoko.bindings.corba2.interceptors;
+
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class CorbaInInterceptor extends AbstractPhaseInterceptor<Message> {
+
+ public CorbaInInterceptor() {
+ super();
+ setPhase(Phase.UNMARSHAL);
+ }
+
+ public void handleMessage(Message message) {
+ System.out.println("handleMessage() in CorbaInInterceptor...");
+ }
+}
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaInInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaInInterceptor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date