In this assignment, you are to modify and augment your solution to the previous assignment to create a distributed messaging application using Java Remote Method Invocation (RMI). The two overall objective for this assignment are: (1) working with client-server communication in RMI, and deploying your RMI server to Raspberry Pi.
The Message client is able to send and receive messages from other instances of the Message client (remote or local) through the RMI server.
The Message server is a java RMI UnicastRemoteObject, which implements a Remote Interface which you should create based on the MessageLibrary methods defined in the previous assignment. When the server's administration Java program is started, it makes a registration in the RMI Registry for this application with the program author's assurite id as the key, For example, the instructor's would register the RMI URL:
rmi://localhost/lindquis
As in the prior assignment, the client should be used on instructor's view, as shown below: see image.
Your message Client should take command line arguments, as shown in the Ant build commands below. The hostname and port specify the machine and port that are running the Rmi Registry. Your server will be running on the same machine (RPi). The user name specifies client's user for purposes of sending an receiving messages. This user name will be used in composing (from) and getting (to) messages. In grading your program, the server will be started, and then two clients will be executed with different user names, to test whether the client connects to the server correctly, and whether messages can be sent from one client to the other through the server.
The fields on the right side of the client view are used to both display received messages, and to compose new messages. The Message menu items or buttons may be used to send a message. The Message menu has the following items:
All client source code should be packaged as: ser321.assign3.myasuriteid.client. All server source should be packaged as: ser321.assign3.myasuriteid.server.
Your java files/classes should contain comments as described in the previous assignment.
The Ant directive file build.xml. The build should contain targets for targets, clean, prepare, compile, server, and client. Use the Employee example's build.xml file as the basis for constructing your solution's build support. Your build.xml should support starting the client and server as follows:
ant server -DhostId=localhost -DregPort=1099
ant client -DhostId=localhost -DregPort=1099 -Duser Id=Tim.Lindquist
ant client -DhostId=localhost -DregPort=1099 -DuserId=Jimmy.Buffett
For running on your raspberry pi, the hostId's in each of the above would be replaced with the RPi's hostname/IP. The clients would be run on Linux Debian Virtual Box, and the server would be run on the RPi.