Remarks
Again the program does two things:
- It looks up a reference to a remote object with external name “MessageWriter”, and stores the returned reference with local name server.
- Finally (!), it invokes the remote method, writeMessage(), on server.
The call to Naming.lookup() searches in a remote RMI registry. Its argument is a URL, with protocol tag “rmi”.
This example assumes the remote object lives on the host “sirah”, and has been registered in the default RMI registry (which happens to listen on port 1099) on that machine.