geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r639773 - in /geronimo/yoko/trunk: core/src/main/java/org/apache/yoko/orb/OCI/ rmi-impl/src/main/java/org/apache/yoko/rmi/impl/
Date Fri, 21 Mar 2008 19:39:22 GMT
Author: rickmcguire
Date: Fri Mar 21 12:39:20 2008
New Revision: 639773

URL: http://svn.apache.org/viewvc?rev=639773&view=rev
Log:
YOKO-423 The RMI stubs are not implementing all methods that need to be implemented for Remote
interfaces.


Modified:
    geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/iiop.java
    geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/MethodDescriptor.java
    geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/PortableRemoteObjectImpl.java
    geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/RemoteDescriptor.java

Modified: geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/iiop.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/iiop.java?rev=639773&r1=639772&r2=639773&view=diff
==============================================================================
--- geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/iiop.java (original)
+++ geronimo/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/iiop.java Fri Mar 21 12:39:20
2008
@@ -226,8 +226,9 @@
                 str += port;
             }
 
-            if (value == null)
+            if (value == null) {
                 props.put(propName, str);
+            }
             else {
                 //
                 // Append to existing property value

Modified: geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/MethodDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/MethodDescriptor.java?rev=639773&r1=639772&r2=639773&view=diff
==============================================================================
--- geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/MethodDescriptor.java
(original)
+++ geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/MethodDescriptor.java
Fri Mar 21 12:39:20 2008
@@ -30,8 +30,7 @@
 import org.omg.CORBA.ORB;
 
 public final class MethodDescriptor extends ModelElement {
-    static final Logger logger = Logger.getLogger(MethodDescriptor.class
-            .getName());
+    static final Logger logger = Logger.getLogger(MethodDescriptor.class.getName());
 
     /** The refleced method object for this method */
     java.lang.reflect.Method reflected_method;

Modified: geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/PortableRemoteObjectImpl.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/PortableRemoteObjectImpl.java?rev=639773&r1=639772&r2=639773&view=diff
==============================================================================
--- geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/PortableRemoteObjectImpl.java
(original)
+++ geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/PortableRemoteObjectImpl.java
Fri Mar 21 12:39:20 2008
@@ -276,8 +276,7 @@
         Constructor cons = getRMIStubClassConstructor(state, type);
 
         try {
-            javax.rmi.CORBA.Stub result = (javax.rmi.CORBA.Stub) cons
-                    .newInstance(NO_ARG);
+            javax.rmi.CORBA.Stub result = (javax.rmi.CORBA.Stub) cons.newInstance(NO_ARG);
             return result;
         } catch (InstantiationException ex) {
             throw new RuntimeException(
@@ -311,33 +310,36 @@
 
     static Constructor getRMIStubClassConstructor(RMIState state, Class type)
             throws ClassNotFoundException {
+        logger.fine("Requesting stub constructor of class " + type.getName()); 
         Constructor cons = (Constructor) state.stub_map.get(type);
 
         if (cons != null) {
+            logger.fine("Returning cached constructor of class " + cons.getDeclaringClass().getName());

             return cons;
         }
 
         TypeRepository repository = state.getTypeRepository();
-        RemoteDescriptor desc = (RemoteDescriptor) repository
-                .getRemoteDescriptor(type);
+        RemoteDescriptor desc = (RemoteDescriptor) repository.getRemoteDescriptor(type);
 
         MethodDescriptor[] mdesc = desc.getMethods();
         MethodDescriptor[] descriptors = new MethodDescriptor[mdesc.length + 1];
         for (int i = 0; i < mdesc.length; i++) {
             descriptors[i] = mdesc[i];
         }
+        
+        logger.finer("TYPE ----> " + type);
+        logger.finer("LOADER --> " + UtilImpl.getClassLoader(type));
+        logger.finer("CONTEXT -> " + getClassLoader());
 
         MethodRef[] methods = new MethodRef[descriptors.length];
 
         for (int i = 0; i < mdesc.length; i++) {
             Method m = descriptors[i].getReflectedMethod();
+            logger.finer("Method ----> " + m);
             methods[i] = new MethodRef(m);
         }
         methods[mdesc.length] = new MethodRef(stub_write_replace);
 
-        logger.finer("TYPE ----> " + type);
-        logger.finer("LOADER --> " + UtilImpl.getClassLoader(type));
-        logger.finer("CONTEXT -> " + getClassLoader());
 
         Class clazz = null;
 

Modified: geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/RemoteDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/RemoteDescriptor.java?rev=639773&r1=639772&r2=639773&view=diff
==============================================================================
--- geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/RemoteDescriptor.java
(original)
+++ geronimo/yoko/trunk/rmi-impl/src/main/java/org/apache/yoko/rmi/impl/RemoteDescriptor.java
Fri Mar 21 12:39:20 2008
@@ -47,8 +47,9 @@
 
     public RemoteInterfaceDescriptor getRemoteInterface() {
         RemoteInterfaceDescriptor result = super.getRemoteInterface();
-        if (result != null)
+        if (result != null) { 
             return result;
+        }
 
         if (this instanceof RemoteInterfaceDescriptor) {
             result = (RemoteInterfaceDescriptor) this;
@@ -100,8 +101,9 @@
 
         if (method_map == null) {
             method_map = new java.util.HashMap();
-            for (int i = 0; i < operations.length; i++)
+            for (int i = 0; i < operations.length; i++) {
                 method_map.put(operations[i].getIDLName(), operations[i]);
+            }
         }
 
         return (MethodDescriptor) method_map.get(idl_name);
@@ -114,12 +116,8 @@
             Iterator it = method_map.keySet().iterator();
             while (it.hasNext()) {
                 String idl_name = (String) it.next();
-                MethodDescriptor desc = (MethodDescriptor) method_map
-                        .get(idl_name);
-
-                logger
-                        .finer("IDL " + idl_name + " -> "
-                                + desc.reflected_method);
+                MethodDescriptor desc = (MethodDescriptor) method_map.get(idl_name);
+                logger.finer("IDL " + idl_name + " -> "+ desc.reflected_method);
             }
         }
     }
@@ -131,9 +129,9 @@
 
         if (refl_method_map == null) {
             refl_method_map = new java.util.HashMap();
-            for (int i = 0; i < operations.length; i++)
-                refl_method_map.put(operations[i].getReflectedMethod(),
-                        operations[i]);
+            for (int i = 0; i < operations.length; i++) {
+                refl_method_map.put(operations[i].getReflectedMethod(), operations[i]);
+            }
         }
 
         return (MethodDescriptor) refl_method_map.get(refl_method);
@@ -147,15 +145,16 @@
     }
 
     public MethodDescriptor[] getMethods() {
-        if (operations == null)
+        if (operations == null) {
             init_methods();
-
+        }
         return operations;
     }
 
     public synchronized void init_methods() {
-        if (operations != null)
+        if (operations != null) {
             return;
+        }
 
         AccessController.doPrivileged(new PrivilegedAction() {
             public Object run() {
@@ -192,8 +191,7 @@
 
                     method_list.add(op);
                     addMethodOverloading(all_methods, op.getReflectedMethod());
-                    addMethodCaseSensitive(lower_case_names, op
-                            .getReflectedMethod());
+                    addMethodCaseSensitive(lower_case_names, op.getReflectedMethod());
                 }
             }
         }
@@ -224,8 +222,7 @@
             String mname = op.getJavaName();
 
             // is there another method that differs only in case?
-            Set same_case_names = (Set) lower_case_names.get(mname
-                    .toLowerCase());
+            Set same_case_names = (Set) lower_case_names.get(mname.toLowerCase());
             if (same_case_names.size() > 1) {
                 op.setCaseSensitive(true);
             }
@@ -245,6 +242,7 @@
         method_map = new java.util.HashMap();
         for (int i = 0; i < method_list.size(); i++) {
             MethodDescriptor desc = (MethodDescriptor) method_list.get(i);
+            logger.finer("Adding method " + desc.getJavaName() + " to method map under "
+ desc.getIDLName()); 
             method_map.put(desc.getIDLName(), desc);
         }
 
@@ -292,8 +290,8 @@
             throw e;
         }
         for (int j = 0; j < methods.length; j++) {
-            if (isRemoteMethod(methods[j]))
-                result.add(methods[j]);
+            // since this is a remote interface, we need to add everything
+            result.add(methods[j]);
         }
 
         Class[] ifaces = clz.getInterfaces();



Mime
View raw message