In this assignment you will implement a basic RMI-based system inspired by Linda, the topic of one of the research paper assignments (paper is here). You will implement a server and client. The server will make available three of the basic Linda operations:
Clarification: in should be blocking, inp should not. I received this question in office hours.
You are not responsible for the rd/rdp operations discussed in the paper. The three operations should be the only publicly callable methods on the Server object: the internal server state must be completely hidden from the outside world. The client makes outgoing calls only. The server does not call the client ever.
You must write the code to deal with potential contention due to more than one client interacting with the server at the same time.
You should represent the tuples as pairs: a "type" identifier string and an associated data element. For example, a type identifier may be "person", and the associated data element would be a HashMap containing key/value pairs for their name, age, and address. For example:
class TupleData { String Type; HashMap < String,Object > Data; public TupleData(String t) { this.Type = t; this.Data = new HashMap < String,Object > (); } public void setDataElement(String key, Object value) { // code } public Object getDataElement(String key) { // code } }
You are to use Java for this unless you have a desire to use a C++ RMI system such as CORBA or Babel. You will need to get permission from me if you wish to use something other than Java RMI. You are not allowed to use any Linda-like service that already exists, such as JavaSpaces or it's derivatives and relatives. All code is to be written from scratch.
The server should simply act as the maintainer of the tuple space. For this problem, you should write three clients.
To support this, your code should include:
The clients and server must be able to all run on separate machines. It is fair for testing to simply assume that the server runs on one machine, and all of the clients run on another machine. The clients should not be dependent on this colocation in any way though.
Please turn in your code and a brief readme that indicates how to build and run it. Please turn the code in as a tar or zip archive. Individual files attached to an e-mail are a bit of a pain to keep track of.
For your reference, here are a few links that will be useful.