Java-RMI

 

 

 

Foreword

Resources

Code Listings

Foil Sets

Assignments

Solutions

External Resources

SiteMap

Search

Home

 

Java-Basics ] Java-Beans ] [ Java-RMI ] Java-CORBA ] Java-IDL ] Databases ] JDCE ] WebFlow ] Object WebFlow ] TVR ]

 

Java Remote Method Invocation (RMI) is a set of APIs designed to support remote method invocations on objects across Java virtual machines. RMI directly integrates a distributed object model into the Java language such that it allows developers to build distributed applications in Java. More technically speaking, with RMI, a Java program can make calls on a remote object once it obtains a reference to the remote object. This can be done either by looking up the remote object in the bootstrap naming service provided by RMI or by receiving the reference as an argument or a return value.

Currently, Java RMI uses a combination of Java Object Serialization and the Java Remote Method Protocol (JRMP) to convert normal-looking method calls into remote method calls. Java RMI supports its own transport protocol today (JRMP) and plans to support other industry standard protocols in the near future, including IIOP. In order to support IIOP as it is today, JavaSoft will define a restricted subset of features of Java RMI that will work with IIOP. Developers writing their applications to this restricted subset will be able to use IIOP as their transport protocol.

The following code listing is from the Imaging application detailed in Section 2.4.1.4 of the Java Chapter.


Click here to see this example running.



Source Code:

rmiFilter/RMIFilter.java : The Remote Interface
rmiFilter/RMIFilterImpl.java : The Remote Object Server
test/imaging/ImagingClient.java : A Client applet accessing the remotre objects capabilities.
test/imaging/ImageCanvas.java : Helper class to the Client application.

Resource files:

blckrino.jpg

Commands:

D:\Scrapbook\rmi>rmic -d . rmiFilter.RMIFilterImpl

For generation of skeletons and stubs.

D:\>start rmiregistry 8000
D:\Scrapbook\rmi>java -Djava.rmi.server.codebase=file:/d:/Scrapbook/rmi/ rmiFilter.RMIFilterImpl

    Starting the Remote Object Server