Java RMI over IIOP
Overview
Java Remote Method Invocation over Internet Inter-ORB Protocol technology ("RMI-IIOP") is part of the Java 2 Platform, Standard Edition (J2SE). The RMI Programming Model enables the programming of CORBA servers and applications via the rmi API. You can choose to work completely within the Java programming language using the Java Remote Method Protocol (JRMP) as the transport, or work with other CORBA-compliant programming languages using the Internet InterORB Protocol (IIOP).
RMI-IIOP utilizes the Java CORBA Object Request Broker (ORB) and IIOP, so you can write all of your code in the Java programming language, and use the rmic compiler to generate the code necessary for connecting your applications via the Internet InterORB Protocol (IIOP) to others written in any CORBA-compliant language. To work with CORBA applications in other languages, IDL can be generated from Java programming language interfaces using the rmic compiler with the -idl option. To generate IIOP stubs and tie classes, use the rmic compiler with the -iiop option.
When should I use RMI-IIOP?
RMI-IIOP is for developers who program in the Java programming language and want to program to the RMI interfaces, but use IIOP as the underlying transport. RMI-IIOP provides interoperability with other CORBA objects implemented in various languages - but only if all the remote interfaces are originally defined as Java RMI interfaces. It is of particular interest to programmers using Enterprise JavaBeansTM (EJBTM), since the remote object model for EJB components is based on the RMI API.
RMI-IIOP combines the best features of Java Remote Method Invocation (RMI) with the best features of CORBA. RMI-IIOP speeds distributed application development by allowing developers to work completely in the Java programming language, writing remote interfaces in the Java programming language and implementing them simply using Java technology and the Java RMI APIs.
When using RMI-IIOP to produce technology-based distributed applications written in the Java programming language, there is no separate Interface Definition Language (IDL) or mapping to learn: the remote interfaces can be implemented in any other language that is supported by an OMG mapping and a vendor supplied ORB for that language. Similarly, clients can be written in other languages using IDL derived from the remote Java technology-based interfaces.
RMI-IIOP provides flexibility by allowing developers to pass any Java object between application components either by reference or by value.
Like CORBA, RMI-IIOP is based on open standards defined with the participation of hundreds of vendors and users in the Object Management Group. Like CORBA, RMI-IIOP uses Internet Inter-ORB Protocol (IIOP) as its communication protocol. IIOP eases legacy application and platform integration by allowing application components written in C++, Smalltalk, and other CORBA supported languages to communicate with components running on the Java platform.
What other options do I have for distributed application development?
Developers who program using the Java programming language can choose several solutions for creating distributed applications programs.
- Java RMI technology - If all of your applications are written in the Java programming language, you will probably want to use Java RMI technology to enable communication between Java objects on different virtual machines and different physical machines. Using Java RMI technology without its IIOP option leverages its strengths of code portability, security, and garbage collection.
- Java IDL technology - Java IDL technology are for CORBA programmers who want to program in the Java programming language based on interfaces defined in CORBA Interface Definition Language (IDL). This is "business as usual" CORBA programming, supporting the Java platform in exactly the same way as other languages like C++ or COBOL.
- Enterprise JavaBeansTM technology - Enterprise JavaBeansTM (EJBTM) technology is part of the Java 2 Platform, Enterprise Edition. EJB components use the Java RMI/Java IDL technology for their distributed object model, and use the Java Transaction Service (JTS) for their distributed transaction model. When Enterprise JavaBeans components are implemented using the RMI-IIOP protocol for EJB component interoperability in heterogeneous server environments, the standard mapping of the EJB architecture to CORBA enables interoperability with multivendor ORBs, other EJB servers, and CORBA clients written in programming languages other than the Java programming language. For an example application that uses an EJB server with a CORBA client, look at Enterprise JavaBeans Components and CORBA Clients.
New Java RMI-IIOP Features in J2SE 1.4
- New command line argument for rmic tool allows programmers to construct object implementations using the Portable Object Adapter (POA) that are portable between different ORB products.
When the command rmic -iiop -poa is run on a Java program that defines a remote object implementation of a remote interface, the inheritance changes from org.omg.CORBA_2_3.portable.ObjectImpl (if command is run without the -poa option) to org.omg.PortableServer.Servant.
In the Java programming language, Portable Object Adaptor (POA)-based Dynamic Skeleton Interface (DSI) servants inherit from the standard DynamicImplementation class, which inherits from the Servant class. The native Servant type is defined by the module for the POA. In the Java programming language, the Servant type is mapped to the org.omg.PortableServer.Servant class. It serves as the base class for all POA servant implementations and provides a number of methods that may be invoked by the application programmer, as well as methods which are invoked by the POA itself and may be overridden by the user to control aspects of servant behavior.
- New Object Request Broker Daemon, orbd. The orbd tool is a daemon process containing a Bootstrap Service, a Transient Name Service, a Persistent Name Service, and a Server Manager. For more information on the orbd tool, see the orbd manpage and Naming Service.
- Other new CORBA features include support for Portable Interceptors, an Interoperable Naming Service, the General Inter-ORB Protocol (GIOP) 1.2, Dynamic Anys, and the new Server Tool. For more information about these features, which are shared with the Java IDL technology, see Changes in CORBA Features Between J2SE 1.3 and 1.4.
Java RMI over IIOP Tutorials
Java RMI-IIOP Developer Documentation
- Java RMI-IIOP Programmer's Guide
- Enterprise JavaBeans Components and CORBA Clients (click here for pdf version)
- Using Portable Interceptors - updated 4/2002
Java RMI-IIOP Tools Documentation
For more information
The Java IDL technology pages include a lot of information that is useful to developers using Java RMI-IIOP technology.
The OMG is the official source of information for all CORBA and IIOP related information. The CORBA 2.3.1 Specification is available electronically from formal/99-10-07. The URLs for the CORBA specifications may change. If this link is broken, link to http://www.omg.org and search the specifications.
For more information on which specifications are implemented in this release of the Java platform, see the compliance document.
For questions, please try the user supported forum for Java IDL technology, which is available at http://forum.java.sun.com. For comments please send us email at rmi-iiop@sun.com.