Chapter2 Part3
Chapter2 Part3
• In the distributed Hello World example, a client makes a remote method call
to the server, to retrieve the message "Hello world!".
• We have followed all the 6 steps to create and run this RMI application.
• The application consists of:
• The remote interface
• The server application
• The client application
• Both client and server interact with the remote interface. 12/23/2020 3
The Remote Interface
• The remote interface declares each of the methods that you want to call
remotely.
• Remote interface has the following characteristics:
• It extends the java.rmi.Remote interface.
• It declares the RemoteException.
12/23/2020 4
The Remote Interface
12/23/2020 5
The Server Application
12/23/2020 7
The Client Application
• To “find” the server, the client uses an Interface object that “looks” for a
reference for the remote object associated with the name we pass as
parameter.
• It gets a reference to the remote object implementation from the server
host's rmiregistry.
• It invokes the remote method on the server's remote object.
12/23/2020 8
The Client Application
12/23/2020 9
Running the RMI Application
12/23/2020 10
Running the RMI Application
12/23/2020 11