COMP 310/510
Fall 2013

HW07: Remote task execution

Home  Info  Owlspace (310)   Owlspace (510)   Java Resources  Eclipse Resources  Piazza

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.

References:

Obtaining and Runnning the demo

The code is available by setting the svn:externals property (under Team/Set Property) of your src folder to "provided https://svn.rice.edu/r/comp310/course/ComputeEngine/provided"

Be sure to set the working directory of both the client and server launch configurations to your the "bin" directory in your project.  
Also, set both the client and engine (server) launch configurations to be "shared" so that they will always be set correctlyu.
See the Eclipse Resources page for directions  

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

 

Compute Engine

Features

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.

Requirements:

SVN requirements   FOLLOW THESE DIRECTION EXACTLY

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: "https://svn.rice.edu/r/comp310/turnin/FXX/netID1/team/HW07".  ( "XX" = your year and "netID1" is the NetID of the first partner.   Replace "comp310" with "comp510" if you are in that class.)
      • Add a new repository with the above name and then do a checkout of the entire repository.
    2. Check that you can successfully add a file to the project and commit it.
  3. Special note for teams where the members are running a mix of 32-bit and 64-bit Java computers:  You will need to use a special "svn:ignore" property to enable the different computers to separately and properly compile your code.   Please see the following directions on how to set the svn:ignore parameter to ignore the .classpath file.

You will need to create your OWN client package, including its controller, view and model.   You can start by simply copying the existing 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

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

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


© 2013 by Stephen Wong