Lab 10 - More exercises on multithreading and Distributed Programming

Distributed Programming

IT Acronym Server using Sockets

1. You are to write an IT Acronym Server. Clients connect to this server and send an acronym such as ("RMI" or "CAS") and the server responds with the full form of the acronym. For example if the clients sends "CAS" as request the server will respond with "CAS : compare and swap".

Make sure this server is multi-threaded so that it can handle multiple concurrent requests. Hold all the acronyms and their full forms in a Map.

Write the client to test the server and any other classes that you may need.

See the solution

IT acronym server using RMI

2. Write the IT acronym server using RMI. For this first the define the interface for the server as below:

import java.rmi.*;
import java.rmi.server.*;
 
interface ITAcronymServer extends Remote {
       public String getFullForm(String acronym) throws RemoteException;
 
}

Write the client and the server.

See the solution