The objective of this scenario is to demonstrate how to work with Java Remote Method Invocation (RMI). Java RMI is a Java API that allows a client to call a method in an object that runs on a remote process or even on a separate machine on the network. The machine running the remote code is called the RMI server.
In this scenario you'll be provided with instructions to download the code from GitHub and then build both the RMI server and client. Also, you'll be shown how to invoke the RMI remote object registry. The remote object registry is the mechanism that make remote methods avaiable to the network or to other process on your local machine.
This scenario is completely interactive. The instructions you'll be given will be executed directly in terminal windows in the Katacoda interactive learning environment.
This scenarios is divided into the following steps.
- Step 1 - Get the Code From GitHub
- Step 2 - Compile the RMI Interface
- Step 3 - Compile the RMI Server
- Step 4 - Compile the RMI Client
- Step 5 - Register the Server
- Step 6 - Run the Server and the Client
Congratulations! You've completed the scenario, Understanding Java RMI.
In this scenario you learned basics of Java's Remote Method Invocation framework.
The interactive scenario demonstrated how to:
- Compile the RMI Interface that will be implemented by the RMI Server
- Compile the RMI Server
- Compile the RMI Client
- Register the Server using
- Run the Server and the Client to send a message to a remote method
Understanding Java RMI
Get the Source Code From GitHub
The objective of this lesson is to execute the command that will copy down from GitHub the code we to build the RMI server and client.
Step 1: Get the code
Click the following command to clone this scenario's code down from GitHub in the terminal window in the Katacoda interactive learning environment.
git clone https://github.com/reselbob/simplermi.git
Step 2: Go to the working directory
Click the following command to navigate to the working directory that contains the code you'll use to create the RMI server and client.