SOFE 4790 Distributed Systems (Fall XXXXXXXXXXDr. Q. Mahmoud) Lab#2 – Developing Distributed Applications with Java RMI Objective In this lab you will experiment with developing distributed...

Lab


SOFE 4790 Distributed Systems (Fall 2020 - Dr. Q. Mahmoud) Lab#2 – Developing Distributed Applications with Java RMI Objective In this lab you will experiment with developing distributed applications using Java RMI and get a flavor of the effort involved in comparison with low-level sockets in Lab#1. You will modify and extend sample code, and document your experiments and results of running programs in your lab report. You also need to submit the source code for each task, so you may want to create separate folders as you go along for the source code for each task. Lab time: Tuesday, Oct 6 between 11:10am – 2:00pm Google meet link: https://meet.google.com/zuk-nmbe-grk During the above lab time on Google Meet, two TAs will be available to explain the lab and answer any questions your may have. Tasks Task #1: (20 Marks) Download the ‘Java RMI Hands-on Tutorial’ PDF file and go through – a file service for allowing clients to download files from remote servers is presented. In this simple task, your job is to through the article and run the client/server application. Once you have read the article: a) Create a directory “FileApp” with two sub-folders: FileApp Server Client b) Download the code for the article from https://www.oracle.com/technical- resources/articles/javase/rmi-corba.html (The files you need to download, or copy-and- paste are: FileInterface.java, FileImpl.java, FileServer.java, FileClient.java, and policy.txt) c) Save the files in the right directories Server: FileInterface.java, FileImpl.java, FileServer.java, policy.txt Client: FileInterface.java, FileClient.java, policy.txt d) Copy a couple of text and binary files into the Server sub-folder (sample files of your choice that the client will download from the server) https://meet.google.com/zuk-nmbe-grk https://www.oracle.com/technical-resources/articles/javase/rmi-corba.html https://www.oracle.com/technical-resources/articles/javase/rmi-corba.html e) Compile the code. As explained in class, some APIs may have changed, so fix any compiler errors as we have done in class. f) Run the rmiregistry, server and client as discussed in class for any Java RMI application, or as described in the article. g) Once everything is running successfully, capture screenshots of the running application to include in your report. Task #2: (20 Marks) In this task, your job is to update the code in Task#1 to align with more recent RMI APIs and best practices as discussed in class. For example: a) Interface implementation should use UnicastRemoteObject.exportObject() instead of extending the UnicastRemoteObject class. b) The server and client should locate the registry and rebind() / lookup(), instead of assuming the registry is on the localhost. Compile the code, run the application, and capture screenshots of the running application to include in your report. Task #3: (20 Marks) In this task, your job is to modify the code in Task#2 so that meaningful messages are printed on the server when: (a) the server starts, (b) the IP address of the connecting client, and (c) the name of the file requested and served; and when a file is downloaded successfully, the client prints a message. Hint: you need to revise the source files: FileServer and FileClient. Compile the code, run the application, and capture screenshots of the running application (file upload in this task) to include in your report. Note: if you have multiple machines, you may want to experiment with running this application on multiple machines (e.g. run the rmiregistry on one machine, the server on another machine, and the client on a third machine). If you do have multiple machines, you can do this later – not required for the lab or lab report. Task#4: (40 Marks) In this task, your job is to add a new remote method that allows the client to upload a file to the server – you must work with the code from Task#3, and print new meaningful messages about file uploads on the client and server consoles. To do that, you need to revise the FileInterface and add a method such as: public void uploadFile(byte[] content) throws RemoteException And then implement this method in FileImpl, and then revise the FileServer and FileClient. Compile the code, run the application, and capture screenshots of the running application (file upload in this task) to include in your report. Submission Guidelines Your submission is due by 11:59AM (just before Noon time NOT midnight) on Wednesday, October 7. No late submissions will be accepted. Submissions must be through the link provided on Canvas. No email submissions will be accepted even if they are emailed before the deadline. Your submission must consist of a single zipped file (only *.zip is accepted) containing: 1) Your source code for each task. Create a folder with a separate subfolder for each task. Source Code Task1 Task2 Task3 …etc 2) Your lab report in Word or PDF format: no more than 10 pages. In your lab report (please use the template provided), for each task: a) Explain how you accomplished the task. b) Show results of sample run -screenshots- to demonstrate your work to the TA. c) Describe any challenges you faced and how you solved them.
Oct 06, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here