Name Registry
The rmi registry is another server running on the remote machine - all RMI servers can register names with an object by calling the rebind or bind methods. Clients can then use a lookup method to find a service.
An object can be bound into a naming registry if it is a remote object
- it must either extend UnicastRemoteObject or made into a remote object by calling UnicastRemoteObject.exportObject().
- Remote Objects include the stub which will be passed to the client. For this reason, when you start the rmi registry server, you must give the directory where it can find stubs of the remote object.
For large distributed applications using RMI, a design goal is to minimize the number of names in the registry. The client can obtain the name of one remote object from the registry, and other remote objects from that rmi server can be returned as values to the client. This is called “bootstrapping”.