The steps of this exercise are:
What to turn in: The code for your assignment
should be in your account on talon, in a subdirectory entitled
"JavaRMI" or something equally obvious. I will grade your
assignment by executing your code from cohn. Turn in the
answers to the questions on paper or by e-mail.
RPC is a technique for building distributed, client-server
based applications. It extends the notion of conventional, or
local procedure calling. With RPC the called procedure does not need
to be in the same address space as the calling procedure.
The two processes can be executing on the same computer or on different computers.
Programmers using RPC do not need to understand the
details of the interface with the network.
Because RPC is a layer over the transport layer of the network, it separates the
application from the physical and logical elements of the data communcations
mechanisms.
RPC is the predecessor to RMI.
RMI makes object function calls between Java Virtual Machines (JVMs)
possible, even when the JVMs are located on separate computers.
Put another way, one JVM can call methods that belong to an
object that is stored in another JVM.
While many RPC and similar systems only allow simple parameters,
RMI allows any Java object type to be passed as a parameter.
RMI even allows both client and server to dynamically load new object types and
pass them as parameters!
RMI abstracts the problem
so that the program/client machine does not know or care whether the
requested object is executed locally or on another JVM.
RMI also provides security and cross-platform portability that requires a
large amount of overhead using RPC, but is limited since it can only call
methods written in Java.
Read the article by Waldo
Waldo, J., "Remote Procedure Calls and Java Remote Method Invocation," IEEE Concurrency, vol. 6, no. 3, pp. 5-7, July 1998.
Available at
http://www.cs.kent.edu/~farrell/grid06/reference/waldo98.pdf, for
a detailed comparison of RPC and RMI.
Note! These commands will be different on cohn than specified in the tutorial:
Assignment 1 : Java RMI
OBJECTIVE
The objective of this exercise is to gain experience programming in the Java
programming environment and to understand the steps in using Java
Remote Method Invocation (RMI)
for building a distributed application. By the end of this exercise
you should understand the tradeoffs in using RMI as compared to local
procedure calls, and you should understand differences and similarities
between Remote Procedure Call (RPC)and RMI. You will also modify a
simple client/server application using Java RMI.
STEP 0: Preparation
STEP 1: Read the introduction and background reading material
To start, read the following:
STEP 2: Following the instructions in the Java RMI tutorial
Read the steps of the Java Tutorial on RMI, available at
Intro to RMI and
Java RMI Tutotial at Sun
to create a client/server program using RMI.
The corresponding commands for use on cohn and its nodes are in the do.node1.server and do.node2.client files
in
http://www.cs.kent.edu/~farrell/RMI/CO
OR
you can set and unset the CLASSPATH on cohn by using the env
command as follows:
env CLASSPATH /home/username/directory
env --unset CLASSPATH
/opt/IBMJava2-142/bin/
or modify your default path in order to ensure that you use
the IBM version of Java consistently.
myCalculator exception: Connection refused to host:
STEP 3: Extend the Java RMI application
Using the above information, your own programming skills, and the web as a
reference, complete the following. Use cohn.cs.kent.edu
for the assignment.
Documentation on the biginteger class and constructors is at http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigInteger.html. It may help to look through the available constructors!!
NOTE: javac may return errors if you use it to compile the files separately because it cannot resolve their dependencies. You can also use the classpath command line option to specify where to look for dependencies.
Rate each of the following on a scale of 1-10 where 1 is "almost none" and 10 is "a whole lot"
Enjoy!