| Advantages | Stubs and Skeletons |
| Disadvantages | Books |
| How It Works | Learning More |
| The RMI Registry | Links |
![]() |
recommend book⇒Distributed Programming with Java | |
| paperback | ||
|---|---|---|
| ISBN13: | 978-1-884777-65-3 | |
| ISBN10: | 1-884777-65-1 | |
| publisher: | Manning Publications | |
| published: | 1999-09-01 | |
| by: | Qusay Mahmoud | |
| Discusses how to digitally sign messages going over socket. Manning books. | ||
For a remote procedure call, there are two objects, one local proxy stub object and one remote real object. RMI can communicate in both directions between client and server. Let’s assume the client wants to execute a method on a remote server object, the usual case. The stub proxy object lives in the client’s address space. The real object runs in the server’s address space. The client invokes the method on the stub proxy, just as if it were working on the server’s object directly. RMI magic happens, and the equivalent method call gets done on the server’s object, and the results get passed back to the proxy stub object. To the client, it is just like a local method call. The only difference is it takes longer.
You don’t explicitly serialise. Your calls send primitives and references over the link as parameters. The objects and the code to manipulate the objects do not travel over the link.
The code on the server does all the application work. The stub code on the client just collects parameters and bundles them into objects to send to the server.
The method invoked on the server could do anything an ordinary method could do e.g. call other methods, read or write the disk, talk to a database engine, call methods remotely back to objects on the client…
You can’t call static methods remotely. If you needed to do so, you would have to call some remote instance method that did the static call for you. The only methods you can call remotely are methods in an interface that extends Remote.
Ordinary objects go by value. The object may travel in either direction, client to server or server to client, and may be passed as a parameter or returned as a result. The object’s datafields are pickled by serialisation into an ObjectStream and reconstituted on the other end. You end up with two independent objects, one local and one remote. Changes made to one won’t be reflected in the other.
When you pass an object that implements Remote as a parameter, it goes by reference. but if and only if it is exported at the time. Otherwise, it is serialised and exported on arrival (so it acts like a mobile remote agent). This is the intention but there have been several bugs in this area. Exported just means the object is made visible to the outside world. Normal objects, even if they implement Remote, are private to that JVM. Exporting a remote object makes it available to accept incoming remote method requests. When you extend java.rmi.server. UnicastRemoteObject or java.rmi.activation. Activatable, your class will be exported automatically upon creation.
Microsoft Internet Explorer and Microsoft Java do not support RMI directly. You have to explicitly place the library files in an ARCHIVE statement and download the mother every time you run your Applet! ouch! You are better off using the Java Plug-in, or pre-installing the RMI class library, or running as an application rather than an Applet.
![]() |
recommend book⇒Mastering RMI: Developing Enterprise Applications in Java and EJB | |
| paperback | ||
|---|---|---|
| ISBN13: | 978-0-471-38940-8 | |
| ISBN10: | 0-471-38940-4 | |
| publisher: | John Wiley & Sons | |
| published: | 2001-02-21 | |
| by: | Rickard Oberg | |
| Covers RMI and how it interfaces with JINI and EJB. | ||
![]() |
recommend book⇒Java RMI | |
| paperback | ||
|---|---|---|
| ISBN13: | 978-1-56592-452-9 | |
| ISBN10: | 1-56592-452-5 | |
| publisher: | O’Reilly | |
| published: | 2001-10-15 | |
| by: | William Grosso | |
| Covers serialization, threading, the RMI registry, sockets and socket factories, activation, dynamic class downloading, HTTP tunneling, JNDI, and CORBA. | ||
![]() |
recommend book⇒Java.rmi: The Remote Method Invocation Guide | |
| paperback | ||
|---|---|---|
| ISBN13: | 978-0-201-70043-5 | |
| ISBN10: | 0-201-70043-3 | |
| publisher: | Addison-Wesley | |
| published: | 2001-07-18 | |
| by: | Esmond Pitt, Kathleen McNiff | |
| Esmond Pitt is a frequent contributor to the newsgroups and has sent me a number of emails on how to improve various entries in the Java glossary, including the RMI entry. He is the sort of person who goes out of his way to be helpful and to explain things. Esmond is more intelligent than nearly everyone, so you will have to stretch to keep up with him. This is not a book for rank beginners. It is the definitive book on RMI. Unfortunately, the book contains precious few examples, my favourite way of learning. The author commanded me to change the wording of this mini review. I told him to get stuffed. He also made complex requests for corrections to this page on RMI, but in such an imperious and insistent way and because I did not have the physical and emotional energy to deal with his difficult wording, I eventually decided to plonk him. He is now harrassing my ISP. | ||
![]() |
recommend book⇒Distributed Programming with Java | |
| paperback | ||
|---|---|---|
| ISBN13: | 978-1-884777-65-3 | |
| ISBN10: | 1-884777-65-1 | |
| publisher: | Manning Publications | |
| published: | 1999-09-01 | |
| by: | Qusay Mahmoud | |
| discusses how to digitally sign messages going over socket. Chapter 12 is available online at Manning books. | ||
![]() |
recommend book⇒Core Web Programming, Second Edition | |
| paperback | ||
|---|---|---|
| ISBN13: | 978-0-13-089793-0 | |
| ISBN10: | 0-13-089793-0 | |
| publisher: | Prentice Hall | |
| published: | 2001-06-03 | |
| by: | Marty Hall and Gary Cornell | |
| 1250 pages. Also has some simple RMI examples. This is a great doorstop of a book. It has a few chapters on client-server programming in Java, and a section of that is on CGI. I have looked at hundreds of Java books and found nothing that deals in depth with client side Java talking to CGI, except Marty’s book. It is really very simple and he does an excellent job of explaining it. Marty has posted all the source code examples from the book for anyone to use. These contain updates and errata fixes you don’t get on the CD-ROM that comes with the book. | ||
![]() |
recommend book⇒Core Servlets and Java Server Pages | |
| paperback | ||
|---|---|---|
| ISBN13: | 978-0-13-089340-6 | |
| ISBN10: | 0-13-089340-4 | |
| publisher: | Prentice Hall | |
| published: | 2000-05-26 | |
| by: | Marty Hall | |
| Complete text of the book available on line in pdf format. | ||
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.58] | |||
| You are visitor number 25,419. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) | ||
| http://mindprod.com/jgloss/rmi.html | J:\mindprod\jgloss\rmi.html | ||