cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r636437 - in /incubator/cxf/trunk: common/common/ common/common/src/main/java/org/apache/cxf/common/util/ distribution/src/main/release/samples/corba/bank/ distribution/src/main/release/samples/corba/bank/src/yoko/client/ distribution/src/m...
Date Wed, 12 Mar 2008 18:00:45 GMT
Author: dkulp
Date: Wed Mar 12 11:00:32 2008
New Revision: 636437

URL: http://svn.apache.org/viewvc?rev=636437&view=rev
Log:
Port yoko bank demo
More workarounds for the very broken Sun ORB
Grab the Yoko generated SystemExceptionHelper since the JDK doesn't seem to contain it.

Added:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java
      - copied, changed from r636320, incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/util/ASMHelper.java
    incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/
      - copied from r636322, incubator/yoko/trunk/distribution/src/main/samples/ws/bank/
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/SystemExceptionHelper.java   (with props)
Removed:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/util/
Modified:
    incubator/cxf/trunk/common/common/pom.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/README.txt
    incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/build.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/client/Client.java
    incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/BankImpl.java
    incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/Server.java
    incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt
    incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaAnyHelper.java
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaUtils.java
    incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/OrbConfig.java
    incubator/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java

Modified: incubator/cxf/trunk/common/common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/pom.xml?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/pom.xml (original)
+++ incubator/cxf/trunk/common/common/pom.xml Wed Mar 12 11:00:32 2008
@@ -46,7 +46,7 @@
         <dependency>
             <groupId>asm</groupId>
             <artifactId>asm</artifactId>
-            <scope>test</scope>
+            <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>

Copied: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java (from r636320, incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/util/ASMHelper.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java?p2=incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java&p1=incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/util/ASMHelper.java&r1=636320&r2=636437&rev=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/util/ASMHelper.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/ASMHelper.java Wed Mar 12 11:00:32 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.jaxws.util;
+package org.apache.cxf.common.util;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
@@ -25,7 +25,6 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.cxf.common.util.WeakIdentityHashMap;
 import org.objectweb.asm.ClassWriter;
 
 public class ASMHelper {

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/README.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/README.txt?rev=636437&r1=636322&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/README.txt (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/README.txt Wed Mar 12 11:00:32 2008
@@ -1,88 +1,46 @@
-Bank Demo
-================
+CORBA Bank Demo
+===============
 
-Prerequisites
-=============
+This demo illustrates the user of JAX-WS API's for creating a service
+that uses the CORBA/IIOP protocol for communication.  It also 
+shows throwing exceptions accross that connection.
 
-If your environment already includes yoko-${current-yoko-version}.jar on the
-CLASSPATH, and the JDK and ant bin directories on the PATH
-it is not necessary to run the environment script described in
-the samples directory README.  If your environment is not
-properly configured, or if you are planning on using wsdl2idl/idl2wsdl,
-javac, and java to build and run the demos, you must include the 
-yoko-${current-yoko-version}.jar in the CLASSPATH. Also set 
-YOKO_HOME to the installation directory.
-
-Demo Use Cases
-==============
-
-This demo allows the user to run three use cases.
-
-- Case 1: Web services client & Web services server.
-
-  In this use case, a Web services client talks to a Web services server
-through the IIOP protocol. Both the client and the server are implemented using
-the CXF Web services framework and the IIOP protocol is enabled by installing
-the Yoko CORBA binding into CXF.
-
-  Note: CXF is _not_ part of the Yoko product, but a CXF kit is bundled
-with Yoko for convenience of testing and running the Web services demos.
-
-
-Building the Demo
-=================
-
-To build the demo code, perform the following steps:
-
-1. Open a command prompt and move into the directory <YOKO_HOME>/samples/ws/bank
 
-2. From the samples/ws/bank directory, enter the following command (UNIX or Windows):
 
-     ant
+Prerequisite
+------------
 
-  This command uses the CXF wsdl2java utility to generate the server & client code.
-
-
-Running the Demo - Use Case 1
-=============================
-
-To run the demo for the first use case, perform the following steps:
-
-1. Open a command prompt and move into the directory <YOKO_HOME>/samples/ws/bank
-
-2. Enter the following command to start the server (on a single command line):
-
-   UNIX (must use forward slashes):
-
-     java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-spec-corba-1.0-incubating-SNAPSHOT.jar:$YOKO_HOME/lib/yoko-core-1.0-incubating-SNAPSHOT.jar \
-     -Dcxf.config.file=file:$YOKO_HOME/samples/ws/etc/corba_bus_config.xml \
-     -classpath $CLASSPATH:build/classes yoko.server.Server &
+If your environment already includes cxf-manifest-incubator.jar on the
+CLASSPATH, and the JDK and ant bin directories on the PATH
+it is not necessary to set the environment as described in
+the samples directory README.  If your environment is not
+properly configured, or if you are planning on using wsdl2java,
+javac, and java to build and run the demos, you must set the
+environment.
 
-   Windows (may use either forward or back slashes):
 
-     start java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-spec-corba-1.0-incubating-SNAPSHOT.jar;%YOKO_HOME%\lib\yoko-core-1.0-incubating-SNAPSHOT.jar 
-        -Dcxf.config.file=file:/%YOKO_HOME%\samples\ws\etc\corba_bus_config.xml
-        -classpath %CLASSPATH%;build\classes yoko.server.Server
 
-  The server process starts in the background. We have to set the Xbootclasspath,
-  because the ORB classes in Yoko conflict with the JDK ORB classes.
+Building and running the demo using Ant
+---------------------------------------
+From the base directory of this sample (i.e., where this README file is
+located), the Ant build.xml file can be used to build and run the demo. 
+The server and client targets automatically build the demo.
 
-3. Enter the following command to start the client:
+First, if using the Sun ORB built into the JDK, you need to start the orbd
+nameing service.   From a command prompt, run:
 
-   UNIX:
+  orbd -ORBInitialPort 1050 -serverPollingTime 200
 
-     java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-spec-corba-1.0-incubating-SNAPSHOT.jar:$YOKO_HOME/lib/yoko-core-1.0-incubating-SNAPSHOT.jar \
-        -Dcxf.config.file=file:$YOKO_HOME/samples/ws/etc/corba_bus_config.xml \
-        -classpath $CLASSPATH:build/classes yoko.client.Client
+Other ORB's may have different requirements.
 
-   Windows:
 
-     java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-spec-corba-1.0-incubating-SNAPSHOT.jar;%YOKO_HOME%\lib\yoko-core-1.0-incubating-SNAPSHOT.jar
-        -Dcxf.config.file=file:/%YOKO_HOME%\samples\ws\etc\corba_bus_config.xml
-        -classpath %CLASSPATH%;build\classes yoko.client.Client
+Use Case - CXF/JAX-WS Server, CXF/JAX-WS Client
+-------------------------------------------------
+Start the CXF/JAX-WS server by running
+  ant cxf.server
 
-4. After running the client, use the kill command to terminate the server process (UNIX) or
-   type Ctrl-C in the server's command window (Windows).
+Run the CXF/JAX-WS client by running:
+  ant cxf.client
 
 
 Cleanup
@@ -92,4 +50,5 @@
 files, either delete the build directory and its contents or run:
 
   ant clean
+
 

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/build.xml?rev=636437&r1=636322&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/build.xml Wed Mar 12 11:00:32 2008
@@ -19,80 +19,19 @@
 -->
 <project name="Bank demo" default="build" basedir=".">
 
-    <property environment="env"/>
-    <property name="build.dir" location ="${basedir}/build"/>
-    <property name="build.src.dir" location ="${basedir}/build/src"/>
-    <property name="build.classes.dir" location ="${build.dir}/classes"/>
+    <property name="wsdl.dir" location="${basedir}/../resources"/>
+    <import file="../../common_build.xml"/>
 
-    <!-- Determine yoko.home, either from the environment variable YOKO_HOME
-       - or using ../..
-       -->
-    <condition property="yoko.home" value="${env.YOKO_HOME}">
-        <isset property="env.YOKO_HOME"/>
-    </condition>
-    <property name="yoko.home" location="../../.."/>
-
-    <path id="yoko.classpath">
-        <pathelement location="${build.classes.dir}"/>
-        <pathelement location="${yoko.home}/lib/yoko-1.0-incubating-SNAPSHOT.jar"/>
-    </path>
-
-    <target name="build" depends="generate.server.code, generate.client.code">
-        <javac destdir="${build.classes.dir}" debug="true">
-            <src path="${basedir}/src"/>
-            <src path="${build.src.dir}"/>
-            <classpath>
-                <path refid="yoko.classpath"/>
-                <pathelement path="${thirdparty.classpath}"/>
-            </classpath>
-        </javac>
+    <target name="generate.code">
+        <echo level="info" message="Generating common code using wsdl2java..."/>
+        <wsdl2java file="bank.wsdl" package="bank.common" />
     </target>
 
-    <target name="generate.server.code">
-        <echo level="info" message="Generating server code using wsdl2java..."/>
-        <wsdl2java file="../resources/bank.wsdl" package="bank.server" />
-    </target>
 
-    <target name="generate.client.code">
-        <echo level="info" message="Generating client code using wsdl2java..."/>
-        <wsdl2java file="../resources/bank.wsdl" package="bank.client" />
+    <target name="cxf.client" depends="build">
+        <cxfrun classname="yoko.client.Client"/>
     </target>
-
-    <target name="clean">
-        <delete dir="${build.classes.dir}"/>
-        <delete dir="${build.src.dir}"/>
+    <target name="cxf.server" depends="build">
+        <cxfrun classname="yoko.server.Server"/>
     </target>
-
-    <!-- move this to a common place, once we have more demos that use this -->
-    <macrodef name="wsdl2corba">
-        <attribute name="file"/>
-        <attribute name="extraArgs" default=""/>
-        <sequential>
-            <java failonerror="true" classname="org.apache.yoko.tools.WSDLToIDL" fork="yes">
-                <classpath>
-                    <path refid="yoko.classpath" />
-                </classpath>
-                <arg line="@{extraArgs} -d ${basedir} -corba @{file}"/>
-            </java>
-        </sequential>
-    </macrodef>
-
-    <macrodef name="wsdl2java">
-        <attribute name="srcdestdir" default="${build.src.dir}"/>
-        <attribute name="destdir" default="${build.classes.dir}"/>
-        <attribute name="file"/>
-        <attribute name="bindingfile" default=""/>
-        <attribute name="package" default="NOT_SPECIFIED"/>
-        <attribute name="extraArgs" default=""/>
-        <sequential>
-            <mkdir dir="@{srcdestdir}"/>
-            <mkdir dir="@{destdir}"/>
-            <java failonerror="true" classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="yes">
-                <classpath>
-                    <path refid="yoko.classpath" />
-                </classpath>
-                <arg line="-p @{package} @{extraArgs} -d @{srcdestdir} @{file}"/>
-            </java>
-        </sequential>
-    </macrodef>
 </project>

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/client/Client.java?rev=636437&r1=636322&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/client/Client.java (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/client/Client.java Wed Mar 12 11:00:32 2008
@@ -15,24 +15,22 @@
  * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
-*/
-
+ */
 package yoko.client;
 
-import java.io.File;
-import java.net.MalformedURLException;
 import java.net.URL;
 import javax.xml.namespace.QName;
 
-import bank.client.Account;
-import bank.client.AccountAlreadyExistsException;
-import bank.client.AccountNotFoundException;
-import bank.client.Bank;
-import bank.client.BankCORBAService;
+import bank.common.Account;
+import bank.common.AccountAlreadyExistsException;
+import bank.common.AccountNotFoundException;
+import bank.common.Bank;
+import bank.common.BankCORBAService;
 
 public final class Client {
 
-    private static final QName SERVICE_NAME = new QName("http://schemas.apache.org/yoko/idl/bank", "BankCORBAService");
+    private static final QName SERVICE_NAME 
+        = new QName("http://schemas.apache.org/yoko/idl/bank", "BankCORBAService");
 
     private Client() {
     }
@@ -58,7 +56,8 @@
 
         Account bankAccount = account.value;
         if (bankAccount != null) {
-            System.out.println("Created Account : " + bankAccount);
+            System.out.println("Created Account : " 
+                               + bankAccount.getName() + ": " + bankAccount.getBalance());
         }
 
         System.out.println("Getting Mr. John's account...");
@@ -66,6 +65,7 @@
             bankAccount = port.getAccount("John");
             if (bankAccount != null) {
                 System.out.println("success");
+                System.out.println(bankAccount.getName() + ": " + bankAccount.getBalance());
             } else {
                 System.out.println("failure");
             }
@@ -77,7 +77,8 @@
         try {
             bankAccount = port.getAccount("Helen");
         } catch (AccountNotFoundException ex) {
-            System.out.println("Caught the expected AccountNotFoundException(" + ex.getFaultInfo().getName() + ")");
+            System.out.println("Caught the expected AccountNotFoundException(" 
+                               + ex.getFaultInfo().getName() + ")");
         }
                 
         System.exit(0);

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/BankImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/BankImpl.java?rev=636437&r1=636322&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/BankImpl.java (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/BankImpl.java Wed Mar 12 11:00:32 2008
@@ -15,38 +15,32 @@
  * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
-*/
-
+ */
 package yoko.server;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.logging.Logger;
-import javax.jws.WebMethod;
-import javax.jws.WebResult;
-
-import bank.server.Account;
-import bank.server.AccountAlreadyExistsException;
-import bank.server.AccountAlreadyExistsExceptionType;
-import bank.server.AccountNotFoundException;
-import bank.server.AccountNotFoundExceptionType;
-import bank.server.Bank;
+
+import bank.common.Account;
+import bank.common.AccountAlreadyExistsException;
+import bank.common.AccountAlreadyExistsExceptionType;
+import bank.common.AccountNotFoundException;
+import bank.common.AccountNotFoundExceptionType;
+import bank.common.Bank;
 
 @javax.jws.WebService(portName = "BankCORBAPort", serviceName = "BankCORBAService", 
                       targetNamespace = "http://schemas.apache.org/yoko/idl/bank", 
                       wsdlLocation = "file:../resources/bank.wsdl",
-                      endpointInterface = "bank.server.Bank")
+                      endpointInterface = "bank.common.Bank")
 
 public class BankImpl implements Bank {
 
-    private static final Logger LOG = 
-        Logger.getLogger(BankImpl.class.getPackage().getName());
-
-    Map<String,Account> accounts = new HashMap<String,Account>();
+    Map<String, Account> accounts = new HashMap<String, Account>();
 
     public boolean createAccount(String name, javax.xml.ws.Holder<Account> account)
         throws AccountAlreadyExistsException { 
-        LOG.info("Executing operation createAccount");
+
+        System.out.println("Creating account: " + name);
         boolean result = false;
         if (accounts.get(name) == null) {
             account.value = new Account();
@@ -63,15 +57,13 @@
     }
 
     public Account getAccount(String name) throws AccountNotFoundException {
-        LOG.info("Executing operation getAccount");
+        System.out.println("Getting account: " + name);
         Account result = accounts.get(name);
         if (result == null) {
             AccountNotFoundExceptionType ex = new AccountNotFoundExceptionType();
             ex.setName(name);
             throw new AccountNotFoundException("Account Not Found", ex);
         }
-        LOG.info("getAccount return : " + result);
         return result;
     }
-
 }

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/Server.java?rev=636437&r1=636322&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/Server.java (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/bank/src/yoko/server/Server.java Wed Mar 12 11:00:32 2008
@@ -15,8 +15,7 @@
  * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
-*/
-
+ */
 package yoko.server;
 
 import javax.xml.ws.Endpoint;
@@ -27,7 +26,7 @@
         System.out.println("Starting Server");
 
         Object implementor = new BankImpl();
-        String address = "file:./bank.ref";
+        String address = "file:./build/bank.ref";
         Endpoint endpoint = Endpoint.create("http://schemas.apache.org/yoko/bindings/corba",
                                             implementor);
         endpoint.publish(address);

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt Wed Mar 12 11:00:32 2008
@@ -1,5 +1,5 @@
 Hello World CORBA Demo
-================
+======================
 
 This demo illustrates the use of the JAX-WS APIs to run a simple
 "hello world" application using CORBA/IIOP instead of SOAP/XML.  It

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml Wed Mar 12 11:00:32 2008
@@ -41,10 +41,10 @@
         </exec>
     </target>
 
-    <target name="cxf.client">
+    <target name="cxf.client" depends="build">
         <cxfrun classname="yoko.client.Client"/>
     </target>
-    <target name="corba.client">
+    <target name="corba.client" depends="build">
         <java classname="corba.client.Client" fork="yes">
             <classpath>
                 <pathelement path="build/classes"/>
@@ -53,11 +53,11 @@
         </java>
     </target>
 
-    <target name="cxf.server">
+    <target name="cxf.server" depends="build">
         <cxfrun classname="yoko.server.Server"/>
     </target>
 
-    <target name="corba.server">
+    <target name="corba.server" depends="build">
         <java classname="corba.server.Server" fork="yes">
             <classpath>
                 <pathelement path="build/classes"/>

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl Wed Mar 12 11:00:32 2008
@@ -192,7 +192,7 @@
     </wsdl:service>
     <wsdl:service name="BankCORBAService">
         <wsdl:port name="BankCORBAPort" binding="tns:BankCORBABinding">
-            <corba:address location="file:./bank.ref" />
+            <corba:address location="file:./build/bank.ref" />
         </wsdl:port>
     </wsdl:service>
 </wsdl:definitions>

Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java Wed Mar 12 11:00:32 2008
@@ -32,6 +32,7 @@
 import org.apache.cxf.binding.corba.types.CorbaHandlerUtils;
 import org.apache.cxf.binding.corba.types.CorbaObjectHandler;
 import org.apache.cxf.binding.corba.utils.ContextUtils;
+import org.apache.cxf.binding.corba.utils.CorbaAnyHelper;
 import org.apache.cxf.binding.corba.utils.CorbaBindingHelper;
 import org.apache.cxf.binding.corba.utils.CorbaUtils;
 import org.apache.cxf.binding.corba.utils.OrbConfig;
@@ -80,12 +81,21 @@
         endpointInfo = ei;
         target = getTargetReference(ref);
         orbConfig = config;
-        orb = CorbaBindingHelper.getDefaultORB(config);
         typeMap = TypeMapCache.get(ei.getService());
     }
 
+    public OrbConfig getOrbConfig() {
+        return orbConfig;
+    }
+    
+    protected synchronized void prepareOrb() {
+        if (orb == null) {
+            orb = CorbaBindingHelper.getDefaultORB(orbConfig);
+        }
+    }
     public void prepare(Message message) throws IOException {    
         try {
+            prepareOrb();
             AddressType address = endpointInfo.getExtensor(AddressType.class);
 
             if (address == null) {
@@ -212,6 +222,9 @@
     }
        
     protected NVList getArguments(CorbaMessage message) {
+        if (orb == null) {
+            prepareOrb();
+        }
         // Build the list of DII arguments, returns, and exceptions
         NVList list = null;
         if (message.getStreamableArguments() != null) {
@@ -219,7 +232,7 @@
             list = orb.create_list(arguments.length);
 
             for (CorbaStreamable argument : arguments) {
-                Any value = orb.create_any();
+                Any value = CorbaAnyHelper.createAny(orb);
                 argument.getObject().setIntoAny(value, argument, true);
                 list.add_value(argument.getName(), value, argument.getMode());
             }
@@ -231,10 +244,13 @@
     }
     
     protected NamedValue getReturn(CorbaMessage message) {
+        if (orb == null) {
+            prepareOrb();
+        }
         CorbaStreamable retVal = message.getStreamableReturn();
         NamedValue ret = null;
         if (retVal != null) {
-            Any returnAny = orb.create_any();
+            Any returnAny = CorbaAnyHelper.createAny(orb);
             retVal.getObject().setIntoAny(returnAny, retVal, false);
             ret = orb.create_named_value(retVal.getName(), returnAny, org.omg.CORBA.ARG_OUT.value);
         } else {
@@ -249,6 +265,10 @@
     protected ExceptionList getExceptionList(Map<TypeCode, RaisesType> exceptions,
                                              CorbaMessage message, 
                                              OperationType opType) {
+        if (orb == null) {
+            prepareOrb();
+        }
+
         // Get the typecodes for the exceptions this operation can throw.
         // These are defined in the operation definition from WSDL.
         ExceptionList exList = orb.create_exception_list();
@@ -272,6 +292,9 @@
                                  org.omg.CORBA.ExceptionList exList) 
         throws Exception {
         Request request = null;
+        if (orb == null) {
+            prepareOrb();
+        }
         ContextList ctxList = orb.create_context_list();
         Context ctx = null;
         try {
@@ -291,6 +314,9 @@
     protected Map<TypeCode, RaisesType> getOperationExceptions(
                                          OperationType operation, 
                                          CorbaTypeMap map) {
+        if (orb == null) {
+            prepareOrb();
+        }
         Map<TypeCode, RaisesType> exceptions = new HashMap<TypeCode, RaisesType>();
         List<RaisesType> exList = operation.getRaises(); 
         if (exList != null) {

Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java Wed Mar 12 11:00:32 2008
@@ -21,6 +21,7 @@
 
 import java.io.IOException;
 import java.lang.reflect.Method;
+import java.net.URI;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.logging.Level;
@@ -108,6 +109,10 @@
         }
     }
 
+    public OrbConfig getOrbConfig() {
+        return orbConfig;
+    }
+    
     public EndpointReferenceType getAddress() {
         return reference;
     }    
@@ -116,7 +121,8 @@
                                   Message partialResponse,
                                   EndpointReferenceType ref)
         throws IOException {
-        return  new CorbaServerConduit(endpointInfo, reference, obj, orbConfig, typeMap);
+        return new CorbaServerConduit(endpointInfo, reference, obj,
+                                      orb, orbConfig, typeMap);
     }
 
     public BindingInfo getBindingInfo() {
@@ -189,20 +195,17 @@
             } catch (org.omg.PortableServer.POAPackage.AdapterNonExistent ex) {
                 // An AdapterNonExistent exception will be thrown if the POA does not exist.  If
                 // this is the case, then we'll create one.
-                Policy[] policies = new Policy[2];
+                Policy[] policies = new Policy[ orbConfig.isPersistentPoa() ? 3 : 2];
                 policies[0] = rootPOA
                 .create_id_uniqueness_policy(
                     org.omg.PortableServer.IdUniquenessPolicyValue.UNIQUE_ID);
                 policies[1] = rootPOA
                         .create_implicit_activation_policy(
                             org.omg.PortableServer.ImplicitActivationPolicyValue.NO_IMPLICIT_ACTIVATION);
-                /*
-                REVISIT - PERSISTENT POA with Sun ORB?
-                policies[2] = rootPOA
-                    .create_lifespan_policy(org.omg.PortableServer.LifespanPolicyValue.PERSISTENT);
-                policies[3] = rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID);
-                */
-
+                if (orbConfig.isPersistentPoa()) {
+                    policies[2] = rootPOA
+                        .create_lifespan_policy(org.omg.PortableServer.LifespanPolicyValue.PERSISTENT);
+                }
                 bindingPOA = rootPOA.create_POA("BindingPOA", poaManager, policies);
             }
             
@@ -216,31 +219,11 @@
             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);
-                    }
-                }
-
+                URI iorFile = new URI(location.substring(3));
                 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);
+                URI uri = new URI(location);
+                CorbaUtils.exportObjectReferenceToFile(obj, orb, uri);
             } else if (location.startsWith("corbaloc")) {
                 // Try add the key to the boot manager.  This is required for a corbaloc
                 addKeyToBootManager(location, obj);
@@ -249,8 +232,8 @@
             } else {
                 String ior = orb.object_to_string(obj);
                 address.setLocation(ior);
-                String iorFile = "endpoint.ior";
-                CorbaUtils.exportObjectReferenceToFile(obj, orb, iorFile);
+                URI uri = new URI("endpoint.ior");
+                CorbaUtils.exportObjectReferenceToFile(obj, orb, uri);
             }
             populateEpr(orb.object_to_string(obj));
             LOG.info("Object Reference: " + orb.object_to_string(obj));

Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java Wed Mar 12 11:00:32 2008
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 
+import org.apache.cxf.binding.corba.utils.CorbaAnyHelper;
 import org.apache.cxf.binding.corba.utils.CorbaBindingHelper;
 import org.apache.cxf.binding.corba.utils.OrbConfig;
 import org.apache.cxf.binding.corba.wsdl.CorbaConstants;
@@ -49,12 +50,17 @@
 
     public CorbaServerConduit(EndpointInfo ei,
                               EndpointReferenceType ref,
-                              org.omg.CORBA.Object targetObj, 
+                              org.omg.CORBA.Object targetObj,
+                              ORB o,
                               OrbConfig config,
                               CorbaTypeMap map) {
         endpointInfo = ei;
         target = getTargetReference(ref);
-        orb = CorbaBindingHelper.getDefaultORB(config);
+        if (o == null) {
+            orb = CorbaBindingHelper.getDefaultORB(config);
+        } else {
+            orb = o;
+        }
         typeMap = map;
         targetObject = targetObj;
     }
@@ -112,7 +118,7 @@
                 NVList list = inMsg.getList();
 
                 if (msg.getStreamableException() != null) {                    
-                    Any exAny = orb.create_any();
+                    Any exAny = CorbaAnyHelper.createAny(orb);
                     CorbaStreamable exception = msg.getStreamableException();
                     exAny.insert_Streamable(exception);
                     request.set_exception(exAny);
@@ -132,7 +138,7 @@
 
                     CorbaStreamable resultValue = msg.getStreamableReturn();
                     if (resultValue != null) {
-                        Any resultAny = orb.create_any();
+                        Any resultAny = CorbaAnyHelper.createAny(orb);
                         resultValue.getObject().setIntoAny(resultAny, resultValue, true);
                         request.set_result(resultAny);
                     }

Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamFaultOutInterceptor.java Wed Mar 12 11:00:32 2008
@@ -226,7 +226,7 @@
         message.setSystemException(sysEx);
         ServerRequest request  = message.getExchange().get(ServerRequest.class);
         Any exAny = orb.create_any();
-        //SystemExceptionHelper.insert(exAny, sysEx);
+        SystemExceptionHelper.insert(exAny, sysEx);
         request.set_exception(exAny);
     }
 

Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java Wed Mar 12 11:00:32 2008
@@ -36,6 +36,7 @@
 import org.apache.cxf.binding.corba.types.ParameterEventProducer;
 import org.apache.cxf.binding.corba.types.WrappedParameterSequenceEventProducer;
 import org.apache.cxf.binding.corba.utils.ContextUtils;
+import org.apache.cxf.binding.corba.utils.CorbaAnyHelper;
 import org.apache.cxf.binding.corba.utils.CorbaUtils;
 import org.apache.cxf.binding.corba.wsdl.ModeType;
 import org.apache.cxf.binding.corba.wsdl.OperationType;
@@ -278,17 +279,19 @@
                 CorbaObjectHandler obj = 
                     CorbaHandlerUtils.initializeObjectHandler(orb, paramName, paramIdlType, map, service);
                 streamables[i] = corbaMsg.createStreamableObject(obj, paramName);
-                
+
+                Any value = CorbaAnyHelper.createAny(orb);
                 if (paramMode.value().equals("in")) {
                     streamables[i].setMode(org.omg.CORBA.ARG_IN.value);
+                    streamables[i].getObject().setIntoAny(value, streamables[i], false);
                 } else if (paramMode.value().equals("out")) {
                     streamables[i].setMode(org.omg.CORBA.ARG_OUT.value);
+                    streamables[i].getObject().setIntoAny(value, streamables[i], true);
                 } else {
                     streamables[i].setMode(org.omg.CORBA.ARG_INOUT.value);
+                    streamables[i].getObject().setIntoAny(value, streamables[i], false);
                 }
 
-                Any value = orb.create_any();
-                streamables[i].getObject().setIntoAny(value, streamables[i], false);
                 list.add_value(streamables[i].getName(), value, streamables[i].getMode());              
                 corbaMsg.addStreamableArgument(streamables[i]);
             }

Added: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/SystemExceptionHelper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/SystemExceptionHelper.java?rev=636437&view=auto
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/SystemExceptionHelper.java (added)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/SystemExceptionHelper.java Wed Mar 12 11:00:32 2008
@@ -0,0 +1,354 @@
+/**
+ * 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.cxf.binding.corba.interceptors;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.CompletionStatusHelper;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.StructMember;
+import org.omg.CORBA.SystemException;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.TypeCode;
+
+public final class SystemExceptionHelper {
+    private static final int BAD_CONTEXT = 0;
+    private static final int BAD_INV_ORDER = 1;
+    private static final int BAD_OPERATION = 2;
+    private static final int BAD_PARAM = 3;
+    private static final int BAD_QOS = 4;
+    private static final int BAD_TYPECODE = 5;
+    private static final int CODESET_INCOMPATIBLE = 6;
+    private static final int COMM_FAILURE = 7;
+    private static final int DATA_CONVERSION = 8;
+    private static final int FREE_MEM = 9;
+    private static final int IMP_LIMIT = 10;
+    private static final int INITIALIZE = 11;
+    private static final int INTERNAL = 12;
+    private static final int INTF_REPOS = 13;
+    private static final int INVALID_TRANSACTION = 14;
+    private static final int INV_FLAG = 15;
+    private static final int INV_IDENT = 16;
+    private static final int INV_OBJREF = 17;
+    private static final int INV_POLICY = 18;
+    private static final int MARSHAL = 19;
+    private static final int NO_IMPLEMENT = 20;
+    private static final int NO_MEMORY = 21;
+    private static final int NO_PERMISSION = 22;
+    private static final int NO_RESOURCES = 23;
+    private static final int NO_RESPONSE = 24;
+    private static final int OBJECT_NOT_EXIST = 25;
+    private static final int OBJ_ADAPTER = 26;
+    private static final int PERSIST_STORE = 27;
+    private static final int REBIND = 28;
+    private static final int TIMEOUT = 29;
+    private static final int TRANSACTION_MODE = 30;
+    private static final int TRANSACTION_REQUIRED = 31;
+    private static final int TRANSACTION_ROLLEDBACK = 32;
+    private static final int TRANSACTION_UNAVAILABLE = 33;
+    private static final int TRANSIENT = 34;
+    private static final int UNKNOWN = 35;
+    
+    
+
+    private static final String[] CLASSES = {
+        "org.omg.CORBA.BAD_CONTEXT", "org.omg.CORBA.BAD_INV_ORDER",
+        "org.omg.CORBA.BAD_OPERATION", "org.omg.CORBA.BAD_PARAM",
+        "org.omg.CORBA.BAD_QOS", "org.omg.CORBA.BAD_TYPECODE",
+        "org.omg.CORBA.CODESET_INCOMPATIBLE", "org.omg.CORBA.COMM_FAILURE",
+        "org.omg.CORBA.DATA_CONVERSION", "org.omg.CORBA.FREE_MEM",
+        "org.omg.CORBA.IMP_LIMIT", "org.omg.CORBA.INITIALIZE",
+        "org.omg.CORBA.INTERNAL", "org.omg.CORBA.INTF_REPOS",
+        "org.omg.CORBA.INVALID_TRANSACTION", "org.omg.CORBA.INV_FLAG",
+        "org.omg.CORBA.INV_IDENT", "org.omg.CORBA.INV_OBJREF",
+        "org.omg.CORBA.INV_POLICY", "org.omg.CORBA.MARSHAL",
+        "org.omg.CORBA.NO_IMPLEMENT", "org.omg.CORBA.NO_MEMORY",
+        "org.omg.CORBA.NO_PERMISSION", "org.omg.CORBA.NO_RESOURCES",
+        "org.omg.CORBA.NO_RESPONSE", "org.omg.CORBA.OBJECT_NOT_EXIST",
+        "org.omg.CORBA.OBJ_ADAPTER", "org.omg.CORBA.PERSIST_STORE",
+        "org.omg.CORBA.REBIND", "org.omg.CORBA.TIMEOUT",
+        "org.omg.CORBA.TRANSACTION_MODE",
+        "org.omg.CORBA.TRANSACTION_REQUIRED",
+        "org.omg.CORBA.TRANSACTION_ROLLEDBACK",
+        "org.omg.CORBA.TRANSACTION_UNAVAILABLE", "org.omg.CORBA.TRANSIENT",
+        "org.omg.CORBA.UNKNOWN"};
+
+    private static final String[] NAMES = {
+        "BAD_CONTEXT", "BAD_INV_ORDER", "BAD_OPERATION", "BAD_PARAM",
+        "BAD_QOS", "BAD_TYPECODE", "CODESET_INCOMPATIBLE", "COMM_FAILURE",
+        "DATA_CONVERSION", "FREE_MEM", "IMP_LIMIT", "INITIALIZE", "INTERNAL",
+        "INTF_REPOS", "INVALID_TRANSACTION", "INV_FLAG", "INV_IDENT",
+        "INV_OBJREF", "INV_POLICY", "MARSHAL", "NO_IMPLEMENT", "NO_MEMORY",
+        "NO_PERMISSION", "NO_RESOURCES", "NO_RESPONSE", "OBJECT_NOT_EXIST",
+        "OBJ_ADAPTER", "PERSIST_STORE", "REBIND", "TIMEOUT",
+        "TRANSACTION_MODE", "TRANSACTION_REQUIRED", "TRANSACTION_ROLLEDBACK",
+        "TRANSACTION_UNAVAILABLE", "TRANSIENT", "UNKNOWN"};
+
+    private static final String[] IDS = {
+        "IDL:omg.org/CORBA/BAD_CONTEXT:1.0",
+        "IDL:omg.org/CORBA/BAD_INV_ORDER:1.0",
+        "IDL:omg.org/CORBA/BAD_OPERATION:1.0", "IDL:omg.org/CORBA/BAD_PARAM:1.0",
+        "IDL:omg.org/CORBA/BAD_QOS:1.0", "IDL:omg.org/CORBA/BAD_TYPECODE:1.0",
+        "IDL:omg.org/CORBA/CODESET_INCOMPATIBLE:1.0",
+        "IDL:omg.org/CORBA/COMM_FAILURE:1.0",
+        "IDL:omg.org/CORBA/DATA_CONVERSION:1.0",
+        "IDL:omg.org/CORBA/FREE_MEM:1.0", "IDL:omg.org/CORBA/IMP_LIMIT:1.0",
+        "IDL:omg.org/CORBA/INITIALIZE:1.0", "IDL:omg.org/CORBA/INTERNAL:1.0",
+        "IDL:omg.org/CORBA/INTF_REPOS:1.0",
+        "IDL:omg.org/CORBA/INVALID_TRANSACTION:1.0",
+        "IDL:omg.org/CORBA/INV_FLAG:1.0", "IDL:omg.org/CORBA/INV_IDENT:1.0",
+        "IDL:omg.org/CORBA/INV_OBJREF:1.0", "IDL:omg.org/CORBA/INV_POLICY:1.0",
+        "IDL:omg.org/CORBA/MARSHAL:1.0", "IDL:omg.org/CORBA/NO_IMPLEMENT:1.0",
+        "IDL:omg.org/CORBA/NO_MEMORY:1.0", "IDL:omg.org/CORBA/NO_PERMISSION:1.0",
+        "IDL:omg.org/CORBA/NO_RESOURCES:1.0",
+        "IDL:omg.org/CORBA/NO_RESPONSE:1.0",
+        "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0",
+        "IDL:omg.org/CORBA/OBJ_ADAPTER:1.0",
+        "IDL:omg.org/CORBA/PERSIST_STORE:1.0", "IDL:omg.org/CORBA/REBIND:1.0",
+        "IDL:omg.org/CORBA/TIMEOUT:1.0",
+        "IDL:omg.org/CORBA/TRANSACTION_MODE:1.0",
+        "IDL:omg.org/CORBA/TRANSACTION_REQUIRED:1.0",
+        "IDL:omg.org/CORBA/TRANSACTION_ROLLEDBACK:1.0",
+        "IDL:omg.org/CORBA/TRANSACTION_UNAVAILABLE:1.0",
+        "IDL:omg.org/CORBA/TRANSIENT:1.0", "IDL:omg.org/CORBA/UNKNOWN:1.0"};
+
+    private static TypeCode typeCode;
+
+    private SystemExceptionHelper() {
+        //utility class
+    }
+
+    private static int binarySearch(String[] arr, String value) {
+        int left = 0;
+        int right = arr.length;
+        int index = -1;
+
+        while (left < right) {
+            int m = (left + right) / 2;
+            int res = arr[m].compareTo(value);
+            if (res == 0) {
+                index = m;
+                break;
+            } else if (res > 0) {
+                right = m;
+            } else {
+                left = m + 1;
+            }
+        }
+
+        return index;
+    }
+
+    private static TypeCode createTypeCode(String id, String name) {
+        ORB orb = ORB.init();
+        StructMember[] members = new StructMember[2];
+        members[0] = new StructMember();
+        members[0].name = "minor";
+        members[0].type = orb.get_primitive_tc(TCKind.tk_ulong);
+        members[1] = new StructMember();
+        members[1].name = "completed";
+        members[1].type = CompletionStatusHelper.type();
+        return orb.create_exception_tc(id, name, members);
+    }
+
+    private static void writeImpl(org.omg.CORBA.portable.OutputStream out, 
+                                  SystemException val, String id) {
+        out.write_string(id);
+        out.write_ulong(val.minor);
+        out.write_ulong(val.completed.value());
+    }
+
+    public static void insert(Any any, SystemException val) {
+        String className = val.getClass().getName();
+        int index = binarySearch(CLASSES, className);
+
+        String id;
+        if (index == -1) {
+            id = IDS[UNKNOWN];
+        } else {
+            id = IDS[index];
+        }
+
+        org.omg.CORBA.portable.OutputStream out = any.create_output_stream();
+        writeImpl(out, val, id);
+        any.read_value(out.create_input_stream(), createTypeCode(id, NAMES[index]));
+    }
+
+    public static SystemException extract(Any any) {
+        try {
+            TypeCode tc = any.type();
+            String id = tc.id();
+            if (tc.kind() == TCKind.tk_except && (id.length() == 0 || binarySearch(IDS, id) != -1)) {
+                return read(any.create_input_stream());
+            }
+        } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) {
+            //ignore
+        }
+
+        throw new org.omg.CORBA.BAD_OPERATION();
+    }
+
+    public static synchronized TypeCode type() {
+        if (typeCode == null) {
+            typeCode = createTypeCode(id(), "SystemException");
+        }
+
+        return typeCode;
+    }
+
+    public static String id() {
+        return "IDL:omg.org/CORBA/SystemException:1.0";
+    }
+    public static void write(org.omg.CORBA.portable.OutputStream out, SystemException val) {
+        String className = val.getClass().getName();
+        int index = binarySearch(CLASSES, className);
+
+        String id;
+        if (index == -1) {
+            id = IDS[UNKNOWN];
+        } else {
+            id = IDS[index];
+        }
+
+        writeImpl(out, val, id);
+    }
+
+    //CHECKSTYLE:OFF 
+    //NCSS is to high for this due to the massive switch statement
+    public static SystemException read(org.omg.CORBA.portable.InputStream in) {
+
+        String id = in.read_string();
+        int minor = in.read_ulong();
+        org.omg.CORBA.CompletionStatus status = org.omg.CORBA.CompletionStatus.from_int(in.read_ulong());
+
+        int n = binarySearch(IDS, id);
+        SystemException ex = null;
+        switch (n) {
+        case BAD_CONTEXT:
+            ex = new org.omg.CORBA.BAD_CONTEXT(minor, status);
+            break;
+        case BAD_INV_ORDER:
+            ex = new org.omg.CORBA.BAD_INV_ORDER(minor, status);
+            break;
+        case BAD_OPERATION:
+            ex = new org.omg.CORBA.BAD_OPERATION(minor, status);
+            break;
+        case BAD_PARAM:
+            ex = new org.omg.CORBA.BAD_PARAM(minor, status);
+            break;
+        case BAD_QOS:
+            ex = new org.omg.CORBA.BAD_QOS(minor, status);
+            break;
+        case BAD_TYPECODE:
+            ex = new org.omg.CORBA.BAD_TYPECODE(minor, status);
+            break;
+        case CODESET_INCOMPATIBLE:
+            ex = new org.omg.CORBA.CODESET_INCOMPATIBLE(minor, status);
+            break;
+        case COMM_FAILURE:
+            ex = new org.omg.CORBA.COMM_FAILURE(minor, status);
+            break;
+        case DATA_CONVERSION:
+            ex = new org.omg.CORBA.DATA_CONVERSION(minor, status);
+            break;
+        case FREE_MEM:
+            ex = new org.omg.CORBA.FREE_MEM(minor, status);
+            break;
+        case IMP_LIMIT:
+            ex = new org.omg.CORBA.IMP_LIMIT(minor, status);
+            break;
+        case INITIALIZE:
+            ex = new org.omg.CORBA.INITIALIZE(minor, status);
+            break;
+        case INTERNAL:
+            ex = new org.omg.CORBA.INTERNAL(minor, status);
+            break;
+        case INTF_REPOS:
+            ex = new org.omg.CORBA.INTF_REPOS(minor, status);
+            break;
+        case INVALID_TRANSACTION:
+            ex = new org.omg.CORBA.INVALID_TRANSACTION(minor, status);
+            break;
+        case INV_FLAG:
+            ex = new org.omg.CORBA.INV_FLAG(minor, status);
+            break;
+        case INV_IDENT:
+            ex = new org.omg.CORBA.INV_IDENT(minor, status);
+            break;
+        case INV_OBJREF:
+            ex = new org.omg.CORBA.INV_OBJREF(minor, status);
+            break;
+        case INV_POLICY:
+            ex = new org.omg.CORBA.INV_POLICY(minor, status);
+            break;
+        case MARSHAL:
+            ex = new org.omg.CORBA.MARSHAL(minor, status);
+            break;
+        case NO_IMPLEMENT:
+            ex = new org.omg.CORBA.NO_IMPLEMENT(minor, status);
+            break;
+        case NO_MEMORY:
+            ex = new org.omg.CORBA.NO_MEMORY(minor, status);
+            break;
+        case NO_PERMISSION:
+            ex = new org.omg.CORBA.NO_PERMISSION(minor, status);
+            break;
+        case NO_RESOURCES:
+            ex = new org.omg.CORBA.NO_RESOURCES(minor, status);
+            break;
+        case NO_RESPONSE:
+            ex = new org.omg.CORBA.NO_RESPONSE(minor, status);
+            break;
+        case OBJECT_NOT_EXIST:
+            ex = new org.omg.CORBA.OBJECT_NOT_EXIST(minor, status);
+            break;
+        case OBJ_ADAPTER:
+            ex = new org.omg.CORBA.OBJ_ADAPTER(minor, status);
+            break;
+        case PERSIST_STORE:
+            ex = new org.omg.CORBA.PERSIST_STORE(minor, status);
+            break;
+        case REBIND:
+            ex = new org.omg.CORBA.REBIND(minor, status);
+            break;
+        case TIMEOUT:
+            ex = new org.omg.CORBA.TIMEOUT(minor, status);
+            break;
+        case TRANSACTION_MODE:
+            ex = new org.omg.CORBA.TRANSACTION_MODE(minor, status);
+            break;
+        case TRANSACTION_REQUIRED:
+            ex = new org.omg.CORBA.TRANSACTION_REQUIRED(minor, status);
+            break;
+        case TRANSACTION_ROLLEDBACK:
+            ex = new org.omg.CORBA.TRANSACTION_ROLLEDBACK(minor, status);
+            break;
+        case TRANSACTION_UNAVAILABLE:
+            ex = new org.omg.CORBA.TRANSACTION_UNAVAILABLE(minor, status);
+            break;
+        case TRANSIENT:
+            ex = new org.omg.CORBA.TRANSIENT(minor, status);
+            break;
+        case UNKNOWN:
+        default:
+            ex = new org.omg.CORBA.UNKNOWN(minor, status);
+        }
+        return ex;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/SystemExceptionHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/SystemExceptionHelper.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/SystemExceptionHelper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java Wed Mar 12 11:00:32 2008
@@ -99,6 +99,9 @@
     public void setValue(Object obj) {
         objectSet = true;
         value = obj;
+        if (any != null && value != null) {
+            setIntoAny(any, null, true);
+        }
     }
 
     public String getDataFromValue() {
@@ -160,9 +163,10 @@
     }
     
     public void setValueFromData(String data) {
+        Object obj = null;
         switch (typeCode.kind().value()) {
         case TCKind._tk_boolean:
-            value = Boolean.valueOf(data);
+            obj = Boolean.valueOf(data);
             break;
         case TCKind._tk_char:
             // A char is mapped to a byte, we need it as a character
@@ -170,48 +174,49 @@
             // for values < 0 + 256 
             // This means that we can directly write out the chars in the normal
             // range 0-127 even when using UTF-8
-            value = new Character((char)(byteValue.byteValue() < 0 
+            obj = new Character((char)(byteValue.byteValue() < 0 
                                          ? byteValue.byteValue() + UNSIGNED_MAX
                                          : byteValue.byteValue()));
             break;
         case TCKind._tk_wchar:
             // A wide char is mapped to a string, we need it as a character
-            value = new Character(data.charAt(0));
+            obj = new Character(data.charAt(0));
             break;
         case TCKind._tk_octet:
-            value = new Byte(data);
+            obj = new Byte(data);
             break;
         case TCKind._tk_short:
-            value = new Short(data);
+            obj = new Short(data);
             break;
         case TCKind._tk_ushort:
-            value = new Integer(data);
+            obj = new Integer(data);
             break;
         case TCKind._tk_long:
-            value = new Integer(data);
+            obj = new Integer(data);
             break;
         case TCKind._tk_longlong:
-            value = new Long(data);
+            obj = new Long(data);
             break;
         case TCKind._tk_ulong:
         case TCKind._tk_ulonglong:
-            value = new java.math.BigInteger(data);
+            obj = new java.math.BigInteger(data);
             break;
         case TCKind._tk_float:
-            value = new Float(data);
+            obj = new Float(data);
             break;
         case TCKind._tk_double:
-            value = new Double(data);
+            obj = new Double(data);
             break;
         case TCKind._tk_string:
         case TCKind._tk_wstring:
-            value = data;
+            obj = data;
             break;
         default:
             // Default: just store the data we were given.  We'll expect that whatever stored the data
             // will also know how to convert it into what it needs.
-            value = data;
+            obj = data;
         }
+        setValue(obj);
     }
     public String getDataFromAny() {
         String data = "";

Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaAnyHelper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaAnyHelper.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaAnyHelper.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaAnyHelper.java Wed Mar 12 11:00:32 2008
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.binding.corba.utils;
 
+import java.lang.reflect.Constructor;
 import java.math.BigInteger;
 import java.util.HashMap;
 import java.util.Map;
@@ -29,7 +30,14 @@
 import org.apache.cxf.binding.corba.types.CorbaPrimitiveHandler;
 import org.apache.cxf.binding.corba.wsdl.CorbaConstants;
 import org.apache.cxf.binding.corba.wsdl.W3CConstants;
+import org.apache.cxf.common.util.ASMHelper;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
 import org.omg.CORBA.Any;
+import org.omg.CORBA.ORB;
 import org.omg.CORBA.TCKind;
 import org.omg.CORBA.TypeCode;
 
@@ -38,9 +46,20 @@
     private static final Map<QName, QName> SCHEMA_TO_IDL_TYPES = new HashMap<QName, QName>();
     private static final Map<QName, QName> IDL_TO_SCHEMA_TYPES = new HashMap<QName, QName>();
     
+    private static Constructor fixedAnyConstructor;
+    
     private CorbaAnyHelper() {
         //utility class
     }
+    
+    public static Any createAny(ORB orb) {
+        Any value = orb.create_any();
+        if ("com.sun.corba.se.impl.corba.AnyImpl".equals(value.getClass().getName())) {
+            value = createFixedAny(orb, value);
+        }
+        
+        return value;
+    }
 
     public static boolean isPrimitiveSchemaType(QName schemaType) {
         return SCHEMA_TO_IDL_TYPES.get(schemaType) != null;
@@ -252,5 +271,260 @@
         IDL_TO_SCHEMA_TYPES.put(CorbaConstants.NT_CORBA_STRING, W3CConstants.NT_SCHEMA_STRING);
         IDL_TO_SCHEMA_TYPES.put(CorbaConstants.NT_CORBA_WSTRING, W3CConstants.NT_SCHEMA_STRING);
         IDL_TO_SCHEMA_TYPES.put(CorbaConstants.NT_CORBA_ANY, W3CConstants.NT_SCHEMA_ANYTYPE);
+    }
+    
+    private static Any createFixedAny(ORB orb, Any any) {
+        createFixedAnyConstructor();
+        try {
+            return (Any)fixedAnyConstructor.newInstance(orb, any);
+        } catch (Exception e) {
+            return any;
+        }
+    }
+    private static synchronized void createFixedAnyConstructor() {
+        if (fixedAnyConstructor != null) {
+            return;
+        }
+        
+        ASMHelper helper = new ASMHelper();
+        ClassWriter cw = helper.createClassWriter();
+        FieldVisitor fv;
+
+        cw.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,
+                 "org/apache/cxf/binding/corba/utils/FixedAnyImpl", 
+                 null, "com/sun/corba/se/impl/corba/AnyImpl", null);
+
+        cw.visitSource("FixedAnyImpl.java", null);
+
+        fv = cw.visitField(0, "obj", "Lorg/omg/CORBA/portable/Streamable;", null, null);
+        fv.visitEnd();
+        addFixedAnyConstructor(cw);
+        addInsertOverride(cw);
+        addExtractOverride(cw);
+        addReadOverride(cw);
+        addWriteOverride(cw);
+        
+        cw.visitEnd();
+
+        byte[] b = cw.toByteArray();
+        Class<?> c = helper.loadClass("org.apache.cxf.binding.corba.utils.FixedAnyImpl", 
+                                      CorbaAnyHelper.class, b);
+        try {
+            fixedAnyConstructor = c.getConstructor(ORB.class, Any.class);
+        } catch (Exception e) {
+            //shouldn't happen since we generated that constructor
+        }
+    }
+
+    private static void addReadOverride(ClassWriter cw) {
+        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "read_value", 
+                            "(Lorg/omg/CORBA/portable/InputStream;Lorg/omg/CORBA/TypeCode;)V", 
+                            null, null);
+        mv.visitCode();
+        Label l0 = new Label();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(54, l0);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitFieldInsn(Opcodes.GETFIELD, "org/apache/cxf/binding/corba/utils/FixedAnyImpl",
+                          "obj", "Lorg/omg/CORBA/portable/Streamable;");
+        Label l1 = new Label();
+        mv.visitJumpInsn(Opcodes.IFNULL, l1);
+        Label l2 = new Label();
+        mv.visitLabel(l2);
+        mv.visitLineNumber(55, l2);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitFieldInsn(Opcodes.GETFIELD, "org/apache/cxf/binding/corba/utils/FixedAnyImpl", 
+                          "obj", "Lorg/omg/CORBA/portable/Streamable;");
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "org/omg/CORBA/portable/Streamable", 
+                           "_read", "(Lorg/omg/CORBA/portable/InputStream;)V");
+        Label l3 = new Label();
+        mv.visitJumpInsn(Opcodes.GOTO, l3);
+        mv.visitLabel(l1);
+        mv.visitLineNumber(57, l1);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitVarInsn(Opcodes.ALOAD, 2);
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "com/sun/corba/se/impl/corba/AnyImpl", 
+                           "read_value", 
+                           "(Lorg/omg/CORBA/portable/InputStream;Lorg/omg/CORBA/TypeCode;)V");
+        mv.visitLabel(l3);
+        mv.visitLineNumber(59, l3);
+        mv.visitInsn(Opcodes.RETURN);
+        Label l4 = new Label();
+        mv.visitLabel(l4);
+        mv.visitLocalVariable("this", "Lorg/apache/cxf/binding/corba/utils/FixedAnyImpl;",
+                              null, l0, l4, 0);
+        mv.visitLocalVariable("is", "Lorg/omg/CORBA/portable/InputStream;", null, l0, l4, 1);
+        mv.visitLocalVariable("t", "Lorg/omg/CORBA/TypeCode;", null, l0, l4, 2);
+        mv.visitMaxs(3, 3);
+        mv.visitEnd();
+    }
+        
+    private static void addWriteOverride(ClassWriter cw) {
+        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "write_value", 
+                            "(Lorg/omg/CORBA/portable/OutputStream;)V", null, null);
+        mv.visitCode();
+        Label l0 = new Label();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(61, l0);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitFieldInsn(Opcodes.GETFIELD, "org/apache/cxf/binding/corba/utils/FixedAnyImpl",
+                          "obj", "Lorg/omg/CORBA/portable/Streamable;");
+        Label l1 = new Label();
+        mv.visitJumpInsn(Opcodes.IFNULL, l1);
+        Label l2 = new Label();
+        mv.visitLabel(l2);
+        mv.visitLineNumber(62, l2);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitFieldInsn(Opcodes.GETFIELD, "org/apache/cxf/binding/corba/utils/FixedAnyImpl",
+                          "obj", "Lorg/omg/CORBA/portable/Streamable;");
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "org/omg/CORBA/portable/Streamable",
+                           "_write", "(Lorg/omg/CORBA/portable/OutputStream;)V");
+        Label l3 = new Label();
+        mv.visitJumpInsn(Opcodes.GOTO, l3);
+        mv.visitLabel(l1);
+        mv.visitLineNumber(64, l1);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "com/sun/corba/se/impl/corba/AnyImpl",
+                           "write_value", "(Lorg/omg/CORBA/portable/OutputStream;)V");
+        mv.visitLabel(l3);
+        mv.visitLineNumber(66, l3);
+        mv.visitInsn(Opcodes.RETURN);
+        Label l4 = new Label();
+        mv.visitLabel(l4);
+        mv.visitLocalVariable("this", "Lorg/apache/cxf/binding/corba/utils/FixedAnyImpl;",
+                              null, l0, l4, 0);
+        mv.visitLocalVariable("os", "Lorg/omg/CORBA/portable/OutputStream;", null, l0, l4, 1);
+        mv.visitMaxs(2, 2);
+        mv.visitEnd();
+        
+    }
+
+    private static void addExtractOverride(ClassWriter cw) {
+        // TODO Auto-generated method stub
+        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "extract_Streamable",
+                            "()Lorg/omg/CORBA/portable/Streamable;", null, null);
+        mv.visitCode();
+        Label l0 = new Label();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(47, l0);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitFieldInsn(Opcodes.GETFIELD, "org/apache/cxf/binding/corba/utils/FixedAnyImpl", 
+                          "obj", "Lorg/omg/CORBA/portable/Streamable;");
+        Label l1 = new Label();
+        mv.visitJumpInsn(Opcodes.IFNULL, l1);
+        Label l2 = new Label();
+        mv.visitLabel(l2);
+        mv.visitLineNumber(48, l2);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitFieldInsn(Opcodes.GETFIELD, "org/apache/cxf/binding/corba/utils/FixedAnyImpl",
+                          "obj", "Lorg/omg/CORBA/portable/Streamable;");
+        mv.visitInsn(Opcodes.ARETURN);
+        mv.visitLabel(l1);
+        mv.visitLineNumber(50, l1);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "com/sun/corba/se/impl/corba/AnyImpl",
+                           "extract_Streamable", "()Lorg/omg/CORBA/portable/Streamable;");
+        mv.visitInsn(Opcodes.ARETURN);
+        Label l3 = new Label();
+        mv.visitLabel(l3);
+        mv.visitLocalVariable("this", "Lorg/apache/cxf/binding/corba/utils/FixedAnyImpl;", null, l0, l3, 0);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+        
+    }
+
+    private static void addInsertOverride(ClassWriter cw) {
+        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC,
+                            "insert_Streamable", 
+                            "(Lorg/omg/CORBA/portable/Streamable;)V", null, null);
+        mv.visitCode();
+        Label l0 = new Label();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(43, l0);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, 
+                           "com/sun/corba/se/impl/corba/AnyImpl", 
+                           "insert_Streamable", 
+                           "(Lorg/omg/CORBA/portable/Streamable;)V");
+        Label l1 = new Label();
+        mv.visitLabel(l1);
+        mv.visitLineNumber(44, l1);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitFieldInsn(Opcodes.PUTFIELD, 
+                          "org/apache/cxf/binding/corba/utils/FixedAnyImpl", "obj", 
+                          "Lorg/omg/CORBA/portable/Streamable;");
+        Label l2 = new Label();
+        mv.visitLabel(l2);
+        mv.visitLineNumber(45, l2);
+        mv.visitInsn(Opcodes.RETURN);
+        Label l3 = new Label();
+        mv.visitLabel(l3);
+        mv.visitLocalVariable("this", "Lorg/apache/cxf/binding/corba/utils/FixedAnyImpl;",
+                              null, l0, l3, 0);
+        mv.visitLocalVariable("s", "Lorg/omg/CORBA/portable/Streamable;", null, l0, l3, 1);
+        mv.visitMaxs(2, 2);
+        mv.visitEnd();
+    }
+
+    private static void addFixedAnyConstructor(ClassWriter cw) {
+        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "(Lorg/omg/CORBA/ORB;)V", null, null);
+        mv.visitCode();
+        Label l0 = new Label();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(36, l0);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitTypeInsn(Opcodes.CHECKCAST, "com/sun/corba/se/spi/orb/ORB");
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
+                           "com/sun/corba/se/impl/corba/AnyImpl",
+                           "<init>", "(Lcom/sun/corba/se/spi/orb/ORB;)V");
+        Label l1 = new Label();
+        mv.visitLabel(l1);
+        mv.visitLineNumber(37, l1);
+        mv.visitInsn(Opcodes.RETURN);
+        Label l2 = new Label();
+        mv.visitLabel(l2);
+        mv.visitLocalVariable("this",
+                              "Lorg/apache/cxf/binding/corba/utils/FixedAnyImpl;", 
+                              null, l0, l2, 0);
+        mv.visitLocalVariable("orb", "Lorg/omg/CORBA/ORB;", null, l0, l2, 1);
+        mv.visitMaxs(2, 2);
+        mv.visitEnd();
+
+        
+        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>",
+                            "(Lorg/omg/CORBA/ORB;Lorg/omg/CORBA/Any;)V",
+                            null, null);
+        mv.visitCode();
+        l0 = new Label();
+        mv.visitLabel(l0);
+        mv.visitLineNumber(39, l0);
+        mv.visitVarInsn(Opcodes.ALOAD, 0);
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitTypeInsn(Opcodes.CHECKCAST, "com/sun/corba/se/spi/orb/ORB");
+        mv.visitVarInsn(Opcodes.ALOAD, 2);
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
+                           "com/sun/corba/se/impl/corba/AnyImpl",
+                           "<init>",
+                           "(Lcom/sun/corba/se/spi/orb/ORB;Lorg/omg/CORBA/Any;)V");
+        l1 = new Label();
+        mv.visitLabel(l1);
+        mv.visitLineNumber(40, l1);
+        mv.visitInsn(Opcodes.RETURN);
+        l2 = new Label();
+        mv.visitLabel(l2);
+        mv.visitLocalVariable("this", "Lorg/apache/cxf/binding/corba/utils/FixedAnyImpl;",
+                              null, l0, l2, 0);
+        mv.visitLocalVariable("orb", "Lorg/omg/CORBA/ORB;", null, l0, l2, 1);
+        mv.visitLocalVariable("any", "Lorg/omg/CORBA/Any;", null, l0, l2, 2);
+        mv.visitMaxs(3, 3);
+        mv.visitEnd();
+        
     }
 }

Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaUtils.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaUtils.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaUtils.java Wed Mar 12 11:00:32 2008
@@ -18,9 +18,11 @@
  */
 package org.apache.cxf.binding.corba.utils;
 
+import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.net.URI;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -456,10 +458,17 @@
         return map;
     }
     
-    public static void exportObjectReferenceToFile(org.omg.CORBA.Object obj, ORB orb, String iorFile) 
+    public static void exportObjectReferenceToFile(org.omg.CORBA.Object obj, ORB orb,
+                                                  URI iorFile) 
         throws IOException {
         String ref = orb.object_to_string(obj);
-        FileOutputStream file = new FileOutputStream(iorFile);
+        File f = null;
+        if (iorFile.isOpaque()) {
+            f = new File(iorFile.getSchemeSpecificPart());
+        } else {
+            f = new File(iorFile);
+        }
+        FileOutputStream file = new FileOutputStream(f);
         PrintWriter out = new PrintWriter(file);
         out.println(ref);
         out.flush();

Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/OrbConfig.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/OrbConfig.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/OrbConfig.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/OrbConfig.java Wed Mar 12 11:00:32 2008
@@ -27,6 +27,12 @@
     String orbClass;
     String orbSingletonClass;
     List<String> orbArgs = new ArrayList<String>();
+    
+    boolean persistentPoa;
+    
+    public OrbConfig() {
+        //nothing
+    }
 
     public void setOrbClass(String cls) {
         orbClass = cls;
@@ -52,5 +58,11 @@
         return orbArgs;
     }
     
+    public void setPersistentPoa(boolean b) {
+        persistentPoa = b;
+    }
+    public boolean isPersistentPoa() {
+        return persistentPoa;
+    }
 
 }

Modified: incubator/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java Wed Mar 12 11:00:32 2008
@@ -109,6 +109,7 @@
         CorbaServerConduit conduit = new CorbaServerConduit(endpointInfo,
                                                             destination.getAddress(),
                                                             targetObject,
+                                                            null,
                                                             orbConfig,
                                                             corbaTypeMap);
         CorbaMessage message = new CorbaMessage(new MessageImpl());
@@ -141,6 +142,7 @@
         CorbaServerConduit conduit = new CorbaServerConduit(endpointInfo,
                                                             destination.getAddress(),
                                                             targetObject,
+                                                            null,
                                                             orbConfig,
                                                             corbaTypeMap);
         
@@ -161,6 +163,7 @@
         CorbaServerConduit conduit = new CorbaServerConduit(endpointInfo,
                                                             destination.getAddress(),
                                                             targetObject,
+                                                            null,
                                                             orbConfig,
                                                             corbaTypeMap);
         String address = conduit.getAddress();
@@ -296,7 +299,8 @@
         target = EasyMock.createMock(EndpointReferenceType.class);                   
         endpointInfo = EasyMock.createMock(EndpointInfo.class);
         CorbaServerConduit corbaServerConduit = 
-            new CorbaServerConduit(endpointInfo, target, targetObject, orbConfig, corbaTypeMap);
+            new CorbaServerConduit(endpointInfo, target, targetObject, 
+                                   null, orbConfig, corbaTypeMap);
         
         if (send) {
             // setMessageObserver

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java Wed Mar 12 11:00:32 2008
@@ -40,9 +40,9 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.ASMHelper;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.JavaUtils;
-import org.apache.cxf.jaxws.util.ASMHelper;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.service.model.MessageInfo;

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java?rev=636437&r1=636436&r2=636437&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java Wed Mar 12 11:00:32 2008
@@ -24,7 +24,7 @@
 
 import javax.xml.bind.JAXBElement;
 
-import org.apache.cxf.jaxws.util.ASMHelper;
+import org.apache.cxf.common.util.ASMHelper;
 import org.objectweb.asm.ClassWriter;
 import org.objectweb.asm.FieldVisitor;
 import org.objectweb.asm.Label;



Mime
View raw message