Project 1

Designed by Kohei Honda

Department of Computer Science, Queen Mary and Westfield College, University of London
March 2000


Design and Implementation of Basic RMI Mechanisms: my pet RMI for Java

This document together with the following offer the guide for this project.

The following Java program code is also provided:

1. Objective

To deepen the understanding of basic RMI mechanisms through:

  1. The design of a general framework of (your own) RMI for Java on top of TCP; and
  2. an implementation of (1) which functions for a  restricted set of classes  and primitive data types;

focussing on: (i) marshalling and unmarshalling mechanisms, and (ii) communication mechanisms.

Once (1) is done, part (2) cannot be difficult. I hope you will enjoy this project, and that it will be intellectually rewarding.

2. Your Task

In short, you produce:

  1. one short document, and
  2. a few classes, including hand-compiled proxy and skeletons for two given programs.

You are not expected to implement an RMI compiler.

The work will be carried out by teams with about four members. Each team will work together to produce the following:

  1. A document describing a basic design for "your pet RMI". A "pet RMI" means an RMI mechanism which realises the same RMI functionality as Java RMI but which does not use Java RMI itself. (That is, you can denote an invocation of a remote method in a program in the same way as when you use Java RMI.)

    Since RMI with full functionality is a too big a task, I have restricted the classes you need to handle to simple ones: see (3) below and the "further details" for this.

    There are a few basic conditions for your RMI:

    Meeting these conditions, the document should be short (10 pages to 20 pages (exceptionally ~30 pages), and should include:

    The internal structure of (your) RMI registry and (your) rmi compiler need not be discussed: a description of what they input and what they output are enough.

    The document as a whole should make it clear how an invocation of the form:

    x=r.method(v,...);

    can be compiled and can act as a RMI, where r is a your remote object residing in a different VM (well in fact r is a proxy, but conceptually speaking it is remote).

  2. A Java program (classes) which implements (1) above *except* the registry and the rmi compiler: you should however have a hand-compiled stub and a hand-compiled skeleton of supplied test classes. I hope you remember how RMI works - further technical details offers some more hints, but basically:

    You also need hand-compiled stubs and skeletons.

    NOTE: The implementation does not have to be strictly faithful to (1) but should follow its general design. The default registry service with source codes is provided. The test programs should be able to run combined with your corresponding proxy and skeleton. Your implementation should work for general RMI programs of restricted class as specified, with the supplied registry and if you had implemented an rmi compiler (the latter you do not have to provide, as noted above).

  3. For simplicity, your RMI need only deal with a restricted subset of classes: those classses which directly subclass Object. That is, your marshalling and unmarshalling procedures need deal only with those classes. [Of course, your implementation may use any class excepting those that provide Java's RMI functionality itself].

Further detailed technical specifications which you should consult before starting to work can be found here. That document in addition offers suggestions for both design and implementation, and points out those Java classes which may be useful for this project, such as those related to TCP and reflection.

As noted above, I offer a default simple registry server with a specific format for remote object references. If you refine/enhance the format for remote object references, then you will need to revise/change the way they are use in the registry. After and the test programs.

3. Assessment

The key aspects I wish to check are:

  1. design: whether it is functioning as a whole, with emphasis on marshaling/unmarshalling and communication mechanisms; interesting design ideas.
  2. implementation: whether a test program does run or not; it soundly implements the basic framework in (1) or not (*); good implementation ideas.

The basic requirement is that your design is sound, that your implementation is basically faithful to the design, and that the test program runs. If so you will get a major portion of the marks. On this basis, you can further develop your ideas. (*)  Some discrepancy between (1) and (2) would be allowed, though it is better that the difference is well-documented in some way.

                                                                                                                                  [K. H. , March, 2000]