Java RMI Assignment for CECS 327: Setting up and Modifying a Remote Object, Assignments of Computer Science

The steps for completing assignment 7 in cecs 327, which involves setting up and modifying a java remote method invocation (rmi) program. Students are required to create subdirectories, compile and run server and client-side programs, and handle errors. Part iii of the assignment requires modifying the program to take a name argument and include it in the returned message.

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-wqr-2
koofers-user-wqr-2 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CECS 327
Assignment 7 (10 points) – Due Monday, 11/3/08
This assignment is to be done on Linux. It consists of three parts:
Part I. Learn about the basic components of Java RMI programs by following the steps below:
1. Create a subdirectory named “rmi-part1” in your “327” directory.
2. Copy all files from ~lam/327/rmi-sample into the above subdirectory
3. Compile the server-side programs as follows:
javac HelloInterface.java
javac Hello,java
javac HelloServer.java
4. Process the implementation class “Hello.class” and generate the sub file for the remote object:
rmic Hello
5. Start the Object Registry by using the following command:
rmiregistry &
6. Activate the object server as a background job:
java HelloServer &
7. Compile the client-side program as follows:
javac HelloClient.java
8. Run the client program (xyz is IP address or domain name of the host where the remote object is):
java HelloClient xyz
Part II. Separate the server-side programs and the client-side into two separate subdirectories:
1. Kill the remote object registry and the server processes.
2. Create two subdirectories named “hello-part2-server” and “hello-part2-client” in
your “327” directory.
3. Copy the following files from “hello-part1” into the above subdirectories:
HelloClient.class” into your “hello-part2-client” subdirectory
HelloInterface.class”, “Hello.class”, “Hello_Stub.class”and
HelloServer.class” into your “hello-part2-server” subdirectory
4. Start the Object Registry by using the following command:
rmiregistry &
5. Activate the object server as a background job:
java HelloServer &
6. Activate the client in the “Hello-part2-client” subdirectory:
java HelloClient xyz
What happens when this command is executed? If errors are encountered, explain what went wrong,
and do the following:
7. Obtain a copy of the remote interface class file and the stub file for the implementation of the
interface by copying them from the “hello-part2-server” subdirectory into “hello-
part2-client” subdirectory, and activate the client program.
pf2

Partial preview of the text

Download Java RMI Assignment for CECS 327: Setting up and Modifying a Remote Object and more Assignments Computer Science in PDF only on Docsity!

CECS 327

Assignment 7 (10 points) – Due Monday, 11/3/

This assignment is to be done on Linux. It consists of three parts: Part I. Learn about the basic components of Java RMI programs by following the steps below:

  1. Create a subdirectory named “rmi-part1” in your “ 327 ” directory.
  2. Copy all files from ~lam/327/rmi-sample into the above subdirectory
  3. Compile the server-side programs as follows: javac HelloInterface.java javac Hello,java javac HelloServer.java
  4. Process the implementation class “Hello.class” and generate the sub file for the remote object: rmic Hello
  5. Start the Object Registry by using the following command: rmiregistry &
  6. Activate the object server as a background job: java HelloServer &
  7. Compile the client-side program as follows: javac HelloClient.java
  8. Run the client program (xyz is IP address or domain name of the host where the remote object is): java HelloClient xyz Part II. Separate the server-side programs and the client-side into two separate subdirectories:
  9. Kill the remote object registry and the server processes.
  10. Create two subdirectories named “hello-part2-server” and “hello-part2-client” in your “ 327 ” directory.
  11. Copy the following files from “hello-part1” into the above subdirectories: “HelloClient.class” into your “hello-part2-client” subdirectory “HelloInterface.class”, “Hello.class”, “Hello_Stub.class”and “HelloServer.class” into your “hello-part2-server” subdirectory
  12. Start the Object Registry by using the following command: rmiregistry &
  13. Activate the object server as a background job: java HelloServer &
  14. Activate the client in the “Hello-part2-client” subdirectory: java HelloClient xyz What happens when this command is executed? If errors are encountered, explain what went wrong, and do the following:
  15. Obtain a copy of the remote interface class file and the stub file for the implementation of the interface by copying them from the “hello-part2-server” subdirectory into “hello- part2-client” subdirectory, and activate the client program.

Part III. Modify the program(s) and use the same setup as in Part II with the following changes:

  1. The say() method takes an argument of a name string and returns a string “Hello” concatenated with the name string.
  2. When the client program is run with an additional argument “name” the returned message will name that name in the hello message as follows: java HelloClient xyz John The return message will be Hello John!

Requirements:

 Demo program execution for all parts in lab on 11/3/08.

 Hand in program listings for Part III with output. Programs must be adequately

documented with comments.