COMP 310
Fall 2011

HW07: Remote task execution

Home  Info  Owlspace  Java Resources  Eclipse Resources

Today's example has a "compute engine" (ICompute) on the server  which is served out as a remote object.   The client then sends a "compute task" (ITask) to the server for it to execute, returning the result to the client.   The key issue here is that the server does not know a priori what the client will have it do

Before starting this assignment, be sure that you can run the demo from Lab08, which includes configuring your computer for use with RMI.

This assignment, and all future assignments will use TCP ports in the ranges: 2001-2002 and 2099-2102.

Obtaining and Runnning the demo

The code is available by setting your Eclipse project's svn:externals to the "provided"

Be sure to set the working directory of both the client and server launch configurations to your the "bin" directory in your project.   (see the Eclipse Resources page for directions)

Ports that need to be opened (see the code for the values):


Compute Engine


Read the documentation!


Important concepts:

Stubs retrieved from remote Registries -- The ICompute stub that the client retrieves via the Registry delegates its calls back to its ComputeEngine implementation on the server.

Stubs sent and returned by stubs  (stubs as factories) -- IRemoteTaskViewAdapter stubs are both sent to the server via a method in the ICompute stub in the client as well as returned by the ICompute stub as a return value.  Thus a single stub can serve as a factory for all the other stubs that are needed, eliminating the need for multitudes of objects bound in the Registry--only a single factory needs to be bound.

Entire objects being serialized and sent via stubs -- the ITask objects are being completely serialized and sent over the network from the client to the server.  They are not sent as stubs.  

Automatic remote dynamic class loading of serialized objects -- If the server does not have the code for the concrete ITask sent to it, the RMI system settings that the client and server set up automatically cause the code for the task to be dynamically loaded from across the network, from the client's class server to the server.  Likewise, this is done for the stubs that are sent back and forth.



The programming pair of students will be identified as "(netID1,netID2)" -- the order of the names is important!

  1. netID1 person:
    1. Make a remote folder (in SVN Repository Exploring) called "team". 
    2. Create your HW07 project in that directory -- that means overriding the default location for the project when you initially share your project.  
  2. netID2 person
    1. Check out the entire project from the following repository: "".
    2. Check that you can successfully add a file to the project and commit it.

You will need to create your OWN client package, including its controller, view and model.   You can start by simply copying the exiting client package code to your own packages (be sure to rename the package internally!) and modifying from there.

You may NOT change any of the provided code -- you will receive a commit error if you do so!

Note that the provided.compute package contains all the interfaces that BOTH the client and the server need to talk to each other.


Testing RMI programs can be tricky.   You can easily be fooled into thinking that your code runs properly if you test insufficiently.   In particular, if both ends of your test contain all the code, the remote dynamic class loading will not be tested.  Here's a more complete test:

Most Common Errors


Grading Guidelines

  1. The tasks must return a value whose type is NOT BigDecimal.   The tasks should return at least 2 different types of results.   - 30 pts
  2. The tasks' results should be displayed on the client.  - 15 pts
  3. The task must display some sort of status message on the server when it is run.  - 15 pts
  4. The task should run properly when both the client and server are on the same machine.  - 15 pts
  5. The task should run properly when the client and server are on different machines.   Test this between your and your partner's machines! - 25 pts

NNote that the above requirements mean that you cannot change anything in provided.compute package!

© 2011 by Stephen Wong and Scott Rixner