Project 3 ---------- [Note: It would be easier to get going with this assignment if you get the Hello example running. ] The purpose of the assignment is to gain familiarity with JAVA RMI. The specific goal is to extend Project 2 such that "Save" and "Load" work for applets. "Save" should save the current image in the host(where the applet came from) which will now be a server. "Load" should load the image. Since now you have a client-server model, there could be multiple clients wanting to save and load ( overlapped in time or even concurrently). It is easy to get the client's hostname, but since multiple clients could be running on the same host there should be some handshake to identify the client so that different clients' images get stored in different places, say different files. To make things simpler work out the assignment in two parts: Part I ------ (1) Ensure that the abstract class Shape is Serializable so that it can be copied across the network. (You must have done this for Project 2) (2) Create a remote interface for the server with two methods : saveImage and loadImage. (3) Define a server class which implements these two methods (4) Write server-site code to create a server object and bind it to the name server. (5) Your client is the Draw applet. Change its init method to lookup for the server. (6) When "Save" (or "Load") is pressed then saveImage (or loadImage) should be invoked on the server. The above model will work as long as there is only one client. When you have multiple clients then you need to map each client uniquely to a file name( or a directory name if you want to save multiple images separately). Part II ------- (1) Extend the remote interface to have a registerClient method which a client(applet) calls when it starts up. (2) The registerClient method is to be implemented by the server such that every time it is invoked a new "id" is returned to the client which invokes it. This "id" should be used as an index by the server to map a client to a unique file name. The loadImage and saveImage methods should now take an extra argument which is the "id" of the client. (3) Java guarantees every client's method invocation is run in a different thread. So if two clients concurrently invoke the registerClient method on the server there could be a conflict of "id"s. To avoid this the registerClient method must be a synchronized method. Although, concurrency in Java has not been covered in class, this must be fairly easy to do. Depending on the way you implement the mapping between client "id" s and file names, loadImage and saveImage may also have to be synchronized methods.