com.beasys.rmi.iiop
Class IIOPSupport

java.lang.Object
  |
  +--com.beasys.rmi.iiop.IIOPSupport
Direct Known Subclasses:
IIOPSupportM3, IIOPSupportM3Client, IIOPSupportSun

public abstract class IIOPSupport
extends java.lang.Object

Collects supporting functions for RMI over IIOP. Certain functions must be implemented specific to each ORB.


Constructor Summary
IIOPSupport()
           
 
Method Summary
static java.lang.Object corba2Java(org.omg.CORBA.Object o)
          Creates an RMI stub that delegates to the given CORBA Object.
abstract  org.omg.CORBA.DynamicImplementation export(java.lang.Object servant)
           
static java.lang.Object extractJavaObject(org.omg.CORBA.Any any)
          Extracts a Java object from the given Any.
static java.lang.Object extractSerializedJavaObject(org.omg.CORBA.portable.InputStream is)
           
static IIOPSupport getIt()
          Retrieves the IIOPSupport implementation for the configured ORB class.
static org.omg.CORBA.Any insertJavaObject(org.omg.CORBA.Any any, java.lang.Class c, java.lang.Object obj)
          Inserts into the given Any the given Java object of the given class and returns the Any.
static void insertJavaObjectRef(org.omg.CORBA.portable.OutputStream os, java.lang.Object obj)
           
static void insertSerializedJavaObject(org.omg.CORBA.portable.OutputStream os, java.lang.Object obj)
           
static org.omg.CORBA.Any insertThrowable(org.omg.CORBA.Any any, java.lang.Throwable t)
           
static org.omg.CORBA.Object java2Corba(java.lang.Object o)
          Returns the CORBA object reference corresponding to this Java object.
static org.omg.CORBA.TypeCode javaClass2Corba(java.lang.Class c)
          Returns the primitive type code corresponding to the given Java class.
static java.lang.String mangleMethodName(java.lang.reflect.Method m)
          Implementation specified in orbos 98-07-19 5.2.
static void setClassLoader(java.lang.ClassLoader cl)
           
static java.lang.String toString(org.omg.CORBA.Object o)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IIOPSupport

public IIOPSupport()
Method Detail

getIt

public static IIOPSupport getIt()
Retrieves the IIOPSupport implementation for the configured ORB class.

mangleMethodName

public static java.lang.String mangleMethodName(java.lang.reflect.Method m)
Implementation specified in orbos 98-07-19 5.2. Also note orbos 98-07-19 3.5.3:
We only generate mangled method names when we detect collisions between two method names. This means we can't support cases where two Java interfaces independently define methods with the same name and the two interfaces are then both inherited by a third Java interface. The generated IDL for the two interfaces will use non-mangled method names and therefore there will be a method name collision when the two IDL interfaces are inherited to make the third IDL interface.

We therefore impose a restriction on the use of overloaded methods. We forbid the inheritance of an overloaded method name through different base interfaces. So this outlaws the case where an interface A defines a method foo, an interface B defines a different foo, and an interface C tries to inherit from both A and B. Note that we still allow the case where an interface A defines a method foo and then an interface B inherits A and adds a different foo. In practice we expect that this will only rarely be a problem for RMI/IDL programmers.


corba2Java

public static java.lang.Object corba2Java(org.omg.CORBA.Object o)
                                   throws weblogic.rmi.RemoteException
Creates an RMI stub that delegates to the given CORBA Object.

java2Corba

public static org.omg.CORBA.Object java2Corba(java.lang.Object o)
Returns the CORBA object reference corresponding to this Java object. This method does not create CORBA objects, but merely unravels and casts.

javaClass2Corba

public static org.omg.CORBA.TypeCode javaClass2Corba(java.lang.Class c)
Returns the primitive type code corresponding to the given Java class.

insertJavaObject

public static org.omg.CORBA.Any insertJavaObject(org.omg.CORBA.Any any,
                                                 java.lang.Class c,
                                                 java.lang.Object obj)
                                          throws java.io.IOException
Inserts into the given Any the given Java object of the given class and returns the Any. The object may be null because the given class provides enough information to distinguish between, say, a null String and an null remote object.

Note that marshaling as well as unmarshalling is driven by the formal type or a parameter or result. For examplem, a parameter that is declared to be Object will always be marshalled as a value.


insertJavaObjectRef

public static void insertJavaObjectRef(org.omg.CORBA.portable.OutputStream os,
                                       java.lang.Object obj)

insertSerializedJavaObject

public static void insertSerializedJavaObject(org.omg.CORBA.portable.OutputStream os,
                                              java.lang.Object obj)
                                       throws java.io.IOException

insertThrowable

public static org.omg.CORBA.Any insertThrowable(org.omg.CORBA.Any any,
                                                java.lang.Throwable t)
                                         throws java.io.IOException

extractJavaObject

public static java.lang.Object extractJavaObject(org.omg.CORBA.Any any)
                                          throws java.io.IOException
Extracts a Java object from the given Any. Primitive types are wrapped.

setClassLoader

public static void setClassLoader(java.lang.ClassLoader cl)

extractSerializedJavaObject

public static java.lang.Object extractSerializedJavaObject(org.omg.CORBA.portable.InputStream is)
                                                    throws java.io.IOException

toString

public static java.lang.String toString(org.omg.CORBA.Object o)

export

public abstract org.omg.CORBA.DynamicImplementation export(java.lang.Object servant)