RMI over IIOP · 2001. 10. 2. · RMI Heritage • Java™ Distributed Object Pro gramming –...

Preview:

Citation preview

RMI over IIOPDavid Heisser

Manager, Java Enterprise TechnologiesSimon Nash

Senior Technical Staff Member, IBM

Agenda

• History of RMI over IIOP

• RMI over IIOP Overview

• CORBA - RMI Comparisons

• Current Status

• RMI over IIOP Desi gn

• Performance

RMI Herita ge

• Java™ Distributed Object Pro grammin g– Pervasive

• JDK™ 1.1 software• Extended features in JDK 1.2 software• Enterprise JavaBeans™ technology

– Easy to use

• Open Survey on Distributed Strate gy– RMI ideal for Java Java technology

• Byte code implementation always available– CORBA standard for Enterprise

• Multi-vendor; Cross language

Goals for RMI-IIOP

• Allow interfaces to be defined in RMI– IDL can be generated from RMI interfaces– Make changes only in CORBA world

• Allow interoperability:– Both C++ and Java technology-based

applications can• Implement interfaces

• Call interfaces– C++ developers use IDL interfaces– Developers using Java technology see

RMI interfaces

Object-b y-Value Goals

• Allow objects to freely move aroundthe network

• No implementation lan guage constraints

Java™ Technolo gy to IDLMappin g Goals

• Generate clean IDL– As if written by well-intentioned human

• Maximize the RMI subset

• Support Java pro grammin g language features– Overloaded methods– Names differing only in case– Exception hierarchies, etc.

• Result is a trade-off– Support common cases well– Less concerned about obscure cases

Java™ Technolo gy to IDLMappin g Non-Goals

• Not all of IDL supported– No support for struct, union, inout

• The mappin g is not reversible– Not the inverse of OMG IDL to Java

language mapping

What Is RMI-IIOP?

• Large subset of JDK™ 1.2 RMI API overCORBA IIOP– True subset of RMI over JRMP– RMI ease of use

• Implements the OMG/CORBA specs– CORBA objects-by-value extension– CORBA Java language to IDL Mapping– Genuine interoperability with CORBA languages

• New base class PortableRemoteObject– Like UnicastRemoteObject– Supports both IIOP and JRMP– Tie-style skeletons

• Need explicit "unexport" call– Can’t rely on distributed garbage collection

• RMI registry JNDI™/CosNaming

• Casts of remote interfaces narrows

RMI-IIOP Programming

New rmic Features

• New options for rmic– Generate IIOP stubs/skeletons– Generate IDL from Java Interfaces (RMI)

• Remote interface as input– Can be implemented in any language

• Strictly compatible JRMP stubs generated

Java IDL and RMI-IIOP

• Java IDL = IDL to Java lan guage mappin g– Write IDL interface definitions– Use tools to map IDL to Java– Write Java implementation code

• RMI-IIOP = Java lan guage to IDL mappin g– Write Java RMI interfaces– Write Java implementation code– Use tools to generate IDL if desired– Write other language implementation

Distributed S ystems Strate gy

• Continue Java IDL development– Allows Java apps to access CORBA services

• IDL interfaces

• Standard IIOP protocol

• Continue RMI development– Uncompromised Java distributed programming

using Java language semantics

• Proprietary protocol (JRMP)

• Continue RMI over IIOP development– RMI style + cross language interoperability

• Full CORBA compliance

• Maintain RMI syntax

Development Status

• Sun and IBM codeveloped implementation– Standard Extension on both 1.1.6 and 1.2– Early Access release Sept. ’98– Beta Dec. ’98– FCS June 10, 1999

• Bundled into the next JDK™ platform– All RMI-IIOP functionality– Compiler written entirely in the Java language

Standardization Status

• IDL Objects By Value Spec– Approved by OMG in Feb. ’98– Final RTF Mar. ’99– Incorporated into CORBA 2.3

• Java lan guage to IDL mappin g Spec– Initial draft in Sept. ’97– Formal approval by OMG in Apr. ’98– Final RTF Mar. ’99– Chap. 28 in CORBA 2.3

• OMG ‘Proposes’, Sun ‘Disposes’

RMI-IIOP Components

• Runtime (includin g ORB)

• Stub Generator

• IDL Generator

• IDL to Java Lan guage Compiler(separate download)

• Samples

• Documentation

Java RMIClient

IIOPStub

Java RMIInterfaceDefinition

IIOPTie

ORB RuntimeIIOP

ORB Runtime

Java RMIImplementation

RMI over IIOP (“Java to Java”)

Java RMIClient

IIOPStub

Java RMIInterfaceDefinition

C++ CORBASkeleton

ORB RuntimeIIOP

C++ ORB Runtime

C++ CORBAImplementation

IDL

RMI over IIOP (“Java to C++”)

Java RMIClient

IIOPStub

Java RMIInterfaceDefinition

IIOPTie

ORB RuntimeIIOP

ORB Runtime

Java RMIImplementation

ORB Runtime

ORB Runtime

• User APIs– javax.rmi.PortableRemoteObject– Server base class, narrow method

• Enhanced Java IDL ORB– Objects By Value support– Java to IDL Mapping extensions

• Portability APIs– Utility functions for portable stubs and ties– Runtime functionality common across ORBs– Java language serialization over IIOP

Java RMIClient

IIOPStub

Java RMIInterfaceDefinition

IIOPTie

ORB RuntimeIIOP

ORB Runtime

Java RMIImplementation

Stub Generator

Stub Generator

• Enhanced version of rmic compiler– New option -iiop generates tie and stubs– Can specify an interface to get a stub only

• Can generate both IIOP and JRMP stubs– Can do “dual export” to IIOP and JRMP

• RMI semantics supported over IIOP– References to shared objects– Exception handling

• Optimization for local calls– Preserving remote/local transparency

Java RMIClient

IIOPStub

Java RMIInterfaceDefinition

C++ CORBASkeleton

ORB RuntimeIIOP

C++ ORB Runtime

C++ CORBAImplementation

IDL

IDL Generator

IDL Generator

• Generates OMG IDL from Java RMIinterface definitions– New option -idl on rmic compiler– See OMG Java to IDL Mapping spec for details

• Use generated IDL to produce bindin gsfor other lan guages– Need IDL compiler that supports CORBA 2.3

• Java lan guage types passed by value needto be reimplemented for other lan guages

IDL to Java™ Lan guage Compiler

• Early access of next IDL to Java lan guagecompiler– Written in the Java programming language– Supports CORBA 2.3 IDL (nearly!)

• Available as separate download

• Not intended for production use– Objects By Value Java bindings will change

• Can be used with RMI-IIOP to experimentwith generated IDL

0

0.5

1

1.5

2

2.5

JRMP beta 7b 8c fcs2 fcs4

scalararray[1]

Primitive data types (geometric mean)

Performance

0

1

2

3

4

5

6

JRMP beta 7b 8c fcs2 fcs4

scalararray[1]

Remote object reference

Performance

0

50

100

150

200

250

JRMP beta 7b 8c fcs2 fcs4

structureobj ref

Array of 64 elements

Performance

Resources

• RMI-IIOP home pa ge– http://java.sun.com/products/rmi-iiop/index.html– “Additional Resources” link to SpaceConquest

• OMG Java lan guage to IDL Mappin gspecification– ftp://ftp.omg.org/pub/docs/ptc/99-03-09.pdf

• OMG Objects By Value specification– ftp://ftp.omg.org/pub/docs/orbos/98-01-18.pdf

• RMI over IIOP BOF, Friday, 12:15pm,Room C3

Recommended