Assignment 3

Creating a RMI Chat Application

Due Date: Tuesday, November 1, 2005, at 11:59 pm

For this assignment, you are to use Java RMI to create a distributed chat application that uses a central server to control connections among the chat clients. Once the connection is make between two clients, they are to communicate directly (not through the central server).

If you wish to create an application that is more complicated than chat, please discuss this with Prof. Troy. This can result in up to 10 extra credit points being added to your project score.

The chat application is to have a GUI for the client. This GUI should have a list of connected person with whom to chat, a history of incoming and outgoing chat messages, an field to enter an outgoing message. The GUI should have some buttons (which could be in a menu) to quit the program and to display a help box and an "About Author" box. Your GUI will also need some manner to select a person to send the outgoing message. Here is an example program that shows how you could use the JList GUI element. Note the program gets a bit complicated with its enabling/disabling of buttons, but the JList usage is fairly obvious.

The following is one possible GUI that could be used. Note that this GUI was created using HTML elements. So getting a GUI to appears exactly as shown is not required or even expected (it may not even be possible using Java GUI elements).

Chat Clients

Message History
Outgoing Message:

The RMI client callback object to be used to send a message from one client to another client is to be retrieved from the central server when the first message is sent from the client to this other client. Thus the client call object objects are retrieved in a "Just IN Time" manner. This will reduce overheld of sending the client callback object to a client that never plans to use it.

The list of connected persons for every client must be automatically updated by the central server whenever a new client connects to the server or disconnects from the server (i.e. quits the program). When connecting, each client is to present a screen name to the server that will be used to identify this client to other clients. The uniqueness of the screen name is an issue that is left to best judgement of the programmers of the project. Be prepared to defend your reasons for your best judgement.

If a client exits its program without disconnection from the server, your code can earn 10 extra credit points for detecting this by the server or some other client and sending disconnection information for the erroniously exited client.

Normal operation of the program will allow for connected clients to continue to comminicate when the server crashes. However, you can earn 10 more extra credit points for having the clients automatically reconnect to the server after it is brought back on-line when the server crashes.

You may work on this project individually or in a group of two people. If you are working in a group, only submit one copy of the project but make sure you clearly identify all members of the group. A group size of three people may be allowed only if Prof. Troy agrees (proceeded by a large amount of pleading by all members of the group in which justification is given as to why you should be allowed to have three members in the group).

Your program is to be submitted electronically via the turnin command on the LINUX machines. The project name for this is mp3. All programs are expected to be written in good programming style using the java programming language.

How to turn in your work

Turnin your program electronically using the "turnin" command from your CS account as follows:

turnin -c cs441 -p mp3  [your project directory]
where the [your project directory] is the directory name under which you have all your files related to this programming problem. The turnin command will automatically compress the data under your directory, so there is no need to do the compression by yourself.

Notice you can only invoke turnin command on the Linux machines in the lab or after logging into the server machine oscar.cs.uic.edu.


If you want to verify that your project was turned in, look in the turnin directory for a file with your userid. For instance for this project, from your CS account you would type:
  

    turnin -c cs441 -p mp3 -v

Note that you can execute turnin as many times as you would like, up until the program deadline when turnin will be disabled for this project. Each time you execute turnin for a project, you overwrite all of what you had turned in previously for that project.It does not work in an incremental way.