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 dm...@apache.org on 2007/05/04 13:26:06 UTC

svn commit: r535231 - in /incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba: interceptors/CorbaInInterceptor.java runtime/CorbaStaxObject.java utils/CorbaObjectReferenceHelper.java

Author: dmiddlem
Date: Fri May  4 06:26:06 2007
New Revision: 535231

URL: http://svn.apache.org/viewvc?view=rev&rev=535231
Log:
Improvements to the object reference support:
* Small fix to ensure that the ORB is always available to the StaxObject
* Remove the need to create a temporary ORB for the ObjectReferenceHelper and simply pass in the
  current ORB.

Modified:
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/utils/CorbaObjectReferenceHelper.java

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java?view=diff&rev=535231&r1=535230&r2=535231
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java Fri May  4 06:26:06 2007
@@ -66,7 +66,6 @@
 import org.apache.yoko.bindings.corba.types.CorbaObjectHandler;
 import org.apache.yoko.bindings.corba.utils.ContextUtils;
 import org.apache.yoko.bindings.corba.utils.CorbaUtils;
-import org.apache.yoko.wsdl.CorbaConstants;
 import org.omg.CORBA.Any;
 import org.omg.CORBA.NVList;
 import org.omg.CORBA.ORB;
@@ -177,7 +176,7 @@
         throws Exception {
         OperationType opType = null;
         
-        orb = (org.omg.CORBA.ORB) message.get(CorbaConstants.ORB);  
+        orb = (org.omg.CORBA.ORB) message.getExchange().get(org.omg.CORBA.ORB.class);  
         if (corbaStaxObject != null) {
             corbaStaxObject.setOrb(orb);
         } else {

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java?view=diff&rev=535231&r1=535230&r2=535231
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaStaxObject.java Fri May  4 06:26:06 2007
@@ -89,10 +89,8 @@
 import org.apache.yoko.bindings.corba.types.CorbaSequenceHandler;
 import org.apache.yoko.bindings.corba.types.CorbaStructHandler;
 import org.apache.yoko.bindings.corba.types.CorbaUnionHandler;
-import org.apache.yoko.bindings.corba.utils.CorbaBindingHelper;
 import org.apache.yoko.bindings.corba.utils.CorbaObjectReferenceHelper;
 import org.apache.yoko.bindings.corba.utils.CorbaUtils;
-import org.apache.yoko.bindings.corba.utils.OrbConfig;
 import org.apache.yoko.wsdl.CorbaConstants;
 import org.apache.yoko.wsdl.CorbaTypeImpl;
 import org.apache.yoko.wsdl.W3CConstants;
@@ -1435,7 +1433,7 @@
                 }
                 
                 org.omg.CORBA.Object ref = CorbaUtils.importObjectReference(orb, address);
-                ref = CorbaObjectReferenceHelper.addYokoProfileToReference(ref, address, endpointName,
+                ref = CorbaObjectReferenceHelper.addYokoProfileToReference(orb, ref, address, endpointName,
                                                                            interfaceName, serviceName);
                 obj.setReference(ref);
             }
@@ -1463,19 +1461,14 @@
             return;
         }
         
-        // There is a situation where the ORB may not yet be initialized.  If this is the case,
-        // a default ORB will do
-        if (orb == null) {
-            orb = CorbaBindingHelper.getDefaultORB(new OrbConfig());
-        }
-        
         // Define buffers to use when getting information from the Yoko profile 
         StringBuffer addr = new StringBuffer();
         StringBuffer epName = new StringBuffer();
         StringBuffer intfName = new StringBuffer();
         StringBuffer svcName = new StringBuffer();
         
-        CorbaObjectReferenceHelper.getYokoProfileInformation(corbaObject, addr, epName, intfName, svcName);
+        CorbaObjectReferenceHelper.getYokoProfileInformation(orb, corbaObject, addr, 
+                                                             epName, intfName, svcName);
         
         // Use the IOR as the address if one does not exist in the Yoko profile
         if (addr.length() == 0) {

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/utils/CorbaObjectReferenceHelper.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/utils/CorbaObjectReferenceHelper.java?view=diff&rev=535231&r1=535230&r2=535231
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/utils/CorbaObjectReferenceHelper.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/utils/CorbaObjectReferenceHelper.java Fri May  4 06:26:06 2007
@@ -121,11 +121,11 @@
         return null;
     }
     
-    public static Object addYokoProfileToReference(Object obj, String endpointAddress, String endpointName,
-                                                   QName interfaceName, QName serviceName) 
+    public static Object addYokoProfileToReference(ORB orb, Object obj, String endpointAddress, 
+                                                   String endpointName, QName interfaceName, 
+                                                   QName serviceName)
         throws IOException {
         LOG.log(Level.INFO, "Adding a Yoko profile to the object references IOR");
-        ORB orb = CorbaBindingHelper.getDefaultORB(new OrbConfig());
         
         // Read the IOR data from the object which currently does not have the yoko profile.
         byte[] originalRef = HexConverter.asciiToOctets(orb.object_to_string(obj), 4);
@@ -212,12 +212,11 @@
         return orb.string_to_object(stringRef);
     }
 
-    public static void getYokoProfileInformation(Object obj, StringBuffer address, StringBuffer endpointName,
-                                                 StringBuffer interfaceName, StringBuffer serviceName) 
+    public static void getYokoProfileInformation(ORB orb, Object obj, StringBuffer address, 
+                                                 StringBuffer endpointName, StringBuffer interfaceName, 
+                                                 StringBuffer serviceName) 
         throws CorbaBindingException {
         LOG.log(Level.INFO, "Retrieving the Yoko profile from the object references IOR");
-        
-        ORB orb = CorbaBindingHelper.getDefaultORB(new OrbConfig());
         
         byte[] ref = HexConverter.asciiToOctets(orb.object_to_string(obj), 4);
         Buffer buf = new Buffer(ref, ref.length);