rmiiiop

Can RMI(JRMP) server be called by RMI IIOP?


Can RMI (JRMP) server be called by RMI IIOP?

I know that RMI IIOP is used for cross language communication using corba, But can RMI server implemented using JRMP be called by RMI IIOP client?

I'm guessing this is possible by using the IP address of RMI (JRMP) registry host.


Solution

  • No. The question doesn't even make sense. An RMI server is called via its stub, and the protocol is implemented by the stub, not the client.

    However you can export the same object as both an RMI/JRMP remote object and an RMI/IIOP remote object, by extending neither UnicastRemoteObject nor PortableRemoteObject and calling the exportObject() methods of both those classes, and registering it in both an RMI Registry and a COSNaming service, and running both rmic (if necessary, see the preamble to UnicastRemoteObject) and rmic -iiop.

    Then if you look it up via a Registry you get an RMI/JRMP stub, and if you look it up via a COSNaming service you get an RMI/IIOP stub.