incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmidd...@apache.org
Subject svn commit: r554914 - in /incubator/yoko/trunk/bindings/src: main/java/org/apache/yoko/bindings/corba/runtime/ main/java/org/apache/yoko/bindings/corba/types/ test/java/org/apache/yoko/bindings/corba/types/
Date Tue, 10 Jul 2007 11:57:09 GMT
Author: dmiddlem
Date: Tue Jul 10 04:57:07 2007
New Revision: 554914

URL: http://svn.apache.org/viewvc?view=rev&rev=554914
Log:
Commit for YOKO-398:
- Fixing the use of Anys as element types for sequences.

Modified:
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaObjectReader.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyEventProducer.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandler.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandlerTest.java

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaObjectReader.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaObjectReader.java?view=diff&rev=554914&r1=554913&r2=554914
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaObjectReader.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/runtime/CorbaObjectReader.java
Tue Jul 10 04:57:07 2007
@@ -461,6 +461,11 @@
         CorbaObjectHandler handler = null;
         try {
             handler = (CorbaObjectHandler) templateConstructor.newInstance(params);
+            // To construct an any, we also need to set a typemap.  This should be available
through
+            // the template object.
+            if (template instanceof CorbaAnyHandler) {
+                ((CorbaAnyHandler)handler).setTypeMap(((CorbaAnyHandler)template).getTypeMap());
+            }
         } catch (java.lang.Exception ex) {
             throw new CorbaBindingException("Unable to instantiate sequence element", ex);
         }

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyEventProducer.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyEventProducer.java?view=diff&rev=554914&r1=554913&r2=554914
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyEventProducer.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyEventProducer.java
Tue Jul 10 04:57:07 2007
@@ -116,7 +116,8 @@
             result = new CorbaPrimitiveHandler(containedName, idlType, tc, null);
         } else if (tc.kind().value() == TCKind._tk_any) {
             idlType = CorbaConstants.NT_CORBA_ANY;
-            result = new CorbaAnyHandler(containedName, idlType, tc, null, handler.getTypeMap());
+            result = new CorbaAnyHandler(containedName, idlType, tc, null);
+            ((CorbaAnyHandler)result).setTypeMap(handler.getTypeMap());
         } else {
             idlType = handler.getTypeMap().getIdlType(tc);
             result = CorbaHandlerUtils.initializeObjectHandler(orb, containedName, idlType,

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandler.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandler.java?view=diff&rev=554914&r1=554913&r2=554914
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandler.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandler.java
Tue Jul 10 04:57:07 2007
@@ -36,12 +36,10 @@
     public CorbaAnyHandler(QName anyName, 
                            QName anyIdlType, 
                            TypeCode anyTC, 
-                           Object anyType,
-                           CorbaTypeMap tm) {
+                           Object anyType) {
         super(anyName, anyIdlType, anyTC, anyType);
         
         value = null;
-        typeMap = tm;
     }
     
     public Any getValue() {
@@ -58,6 +56,10 @@
 
     public void clear() {
         value = null;
+    }
+
+    public void setTypeMap(CorbaTypeMap tm) {
+        typeMap = tm;
     }
 
     public CorbaTypeMap getTypeMap() {

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java?view=diff&rev=554914&r1=554913&r2=554914
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java
(original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java
Tue Jul 10 04:57:07 2007
@@ -81,7 +81,8 @@
             handler = new CorbaPrimitiveHandler(name, idlType, tc, null);
         } else if (tc.kind().value() == TCKind._tk_any) {
             // Any is a special kind of primitive so it gets its own handler
-            handler = new CorbaAnyHandler(name, idlType, tc, null, typeMap);
+            handler = new CorbaAnyHandler(name, idlType, tc, null);
+            ((CorbaAnyHandler)handler).setTypeMap(typeMap);
         } else {
             CorbaTypeImpl type = CorbaUtils.getCorbaType(idlType, typeMap);
             switch (tc.kind().value()) {
@@ -411,7 +412,8 @@
             CorbaTypeImpl type = CorbaUtils.getCorbaType(idlType, typeMap);
             switch (tc.kind().value()) {
             case TCKind._tk_any:
-                handler = new CorbaAnyHandler(name, idlType, tc, type, typeMap);
+                handler = new CorbaAnyHandler(name, idlType, tc, type);
+                ((CorbaAnyHandler)handler).setTypeMap(typeMap);
                 result = new CorbaAnyListener(handler, typeMap, orb, serviceInfo);
                 break;
             case TCKind._tk_array:

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandlerTest.java?view=diff&rev=554914&r1=554913&r2=554914
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandlerTest.java
(original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaAnyHandlerTest.java
Tue Jul 10 04:57:07 2007
@@ -73,7 +73,8 @@
         TypeCode anyTC = orb.get_primitive_tc(TCKind.from_int(TCKind._tk_any));
         CorbaTypeMap tm = new CorbaTypeMap(CorbaConstants.NU_WSDL_CORBA);
         
-        CorbaAnyHandler anyHandler = new CorbaAnyHandler(anyName, anyIdlType, anyTC, null,
tm);
+        CorbaAnyHandler anyHandler = new CorbaAnyHandler(anyName, anyIdlType, anyTC, null);
+        anyHandler.setTypeMap(tm);
 
         // Test the get/set value methods
         anyHandler.setValue(a);



Mime
View raw message