Lab 8: Java RMI (15.4.)
Distributed Systems Lab: Java Remote Method Invocation
In this lab, we will try out Java RMI.
1. Hello World
Here are the files that make up the RMI client side of the RMI adder from the lecture:
Remember to adapt the project name to your own's project name in the VM arguments (in Eclipse, go to run configurations > Arguments > VM Arguments)
-Djava.security.policy=file:${workspace_loc}/RMIClientSide/security.policy (modify using your project name)
Task 1: Connect to the addition server (see the whiteboard for the IP address, the resource name is: ourAdder) and perform an addition.
Next, set up your own server. Here are the files for the server side:
Task 2: Connect to your own server.
3. Print Server
Write a client and a server so that the client can send a string to the server
and the server prints the string to standard output. Use the following interface:
An instance providing this service is running under the name "printer" on the machine shown on the whiteboard. You can use it for testing.
4. Echo Server
Write a client and a server so that the client can send a string to the server,
the server modifies the string (e.g., attaches a prefix to it) and returns it to the client,
and the client prints the string to standard output.
5. Broadcast Server
Write a server that accepts registrations from clients.
When a client sends a string to the server,
the server calls all registered clients and lets them print the string it received.
Hint: For this to work, you need to use remote object references.