Search:
Assignment #3: Tuplespaces

Introduction

The third assignment is about implementing your own chatroom client using TSpaces from IBM.

TSpaces is a set of network communication buffers called tuple spaces and a set of APIs (and classes that implement the API..) for accessing those buffers. TSpaces allows heterogeneous, Java-enabled devices to exchange data with little programming effort. The package includes server software that implements the buffers and client software for accessing the buffers.


Due date: 27.11.2007

 

Preparation

  1. Install Java, if you haven't yet.
  2. Download IBM TSpaces V2. There is TSpaces version 3 available now. We haven't tested our implementation with V3 - but feel free to have a try.  You possibly need to register if this is the first time you download software from IBM AlphaWorks.
  3. After installation, make yourself familiar with TSpaces. Read the User's and the Programmer's Guide and have a look at some examples in the Examples section of the documentation. You should at least understand the basic functionality of TSpaces.

Chatroom Implementation

Your task is to implement a chatroom client using TSpaces. Therefore we provide you with the following five Java classes, whereof one is unfinished.

  • ChatLoginGUI.java - Class providing main method to start up the chatroom client.
  • ChatClientGUI.java - The chatroom client. (UNFINISHED - complete it!)
  • MessageEvent.java - A message to be written/ taken to/from the tuplespace.
  • JoinEvent.java - An event indicating that somebody has entered a chatroom.
  • LeaveEvent.java - An event indication that somebody has left the chatroom.

Download chat.zip which provides all of these classes and unzip it.

The next step is to have a look at  the five classes and to understand what they are used for. Extend the relevant (marked) parts of the classes to get the chatroom client up and running properly.

Read the Programmer's Guide to learn how to set up a TSpaces server on your local machine (the server manages the tuplespaces). Test the server  with one of the simple examples you'll find on the TSpaces website.

  • If you ever run into this:

    "TupleSpaceServerException: ClassNotFoundException: SomeClassName"

    please note: If a client writes an object of "SomeClassName" to the server, then the SomeClassName.class definition must be available to the server via the CLASSPATH. Make sure that, when you start the TSpaces server, the directory containing the application classes is available to the server.
    Refer to the Programmer's Guide for more information about this problem and how to avoid it.

After setting up the server and having completed the client code, test your chat system locally (use several chat clients on the same machine).

Optional: test your implementation with a remote server/ other remote clients.

 

What to Hand in

  • The completed ChatClientGUI.java (Make sure that your code is comprehensive, e.g. inline comments).