The java.rmi.Naming ClassThe key class that makes RMI work is java.rmi.Naming . The Naming class provides methods for storing and obtaining references to remote objects. It does so by communicating with the remote object registry. You need the following methods for the assignment:
There are many tutorials on RMI, but books on this topic aren't plentiful. I found RMI to be powerful yet troublesome . For one thing, I was able to get RMI to work great in my solution on Windows, but when I tested it on Solaris (version 5.8), it failed until I adjusted the code so that it worked on both platforms. So be careful with RMI; older versions of RMI and Solaris can cause trouble. Overall RMI is an awesome feature of J2SE. What you get in J2SE 1.4 is much improved since earlier versions. If you get stuck, don't panic; many other developers have, too. The most likely trouble spot will be the registry and paths. If you start RMI programmatically (as described previously), however, you'll have fewer problems. |