Sun Java Solaris Communities My SDN Account Join SDN
 
Tutorials & Code Camps

jGuru: Help: Bootstrap Example

 


[Exercise | API Docs | Short Course| Exercises]

Help is available for each task.

Task 1

Save the two program files and the runhttp.bat command file into some directory and compile the HTTP Server files

Use the javac program to compile all the Java files:

javac ClassServer.java
javac ClassFileServer.java

Task 2

Start the HTTP Server

Start a new console window and go to the directory where the compiled classes are located. When you run the HTTP Server, you will pass it two parameters. The first is the port on which the server listens. The second is the directory path to the RMI class files to be delivered across the network.

Use the following command to start the HTTP Server:

java ClassFileServer 2002 <path to class file directory>

The included batch file, runhttp.bat, requires updating to set the appropriate path before running.

Task 3

Compile all of the class files for the client and server

In a separate console window, save the client and server files to a separate subdirectory, and compile all of the .java source files:

javac MessageObject.java
javac Hello.java
javac RMIServer.java
javac HelloImpl.java
javac RMIClient.java

This will compile the server and all of the client classes that will be bootstrap loaded across the network.

Task 4

Create the stub and skeleton files for the remote object implementation

Use the rmic utility on the implementation class, HelloImpl.

rmic HelloImpl

Task 5

Run the RMI server program

To help you run the RMI Server, a command (batch) file, runserver.bat, has been created. Edit that file and put in the correct information for your computer and then run the server in its own console window.

Task 6

Compile the class files for the client bootstrap loader program

In a separate console window, save the client bootstrap loader program files and the runclient.bat command file in a separate subdirectory, and compile the .java source files:

javac RMIClientBootstrapSecurityManager.java
javac RMIClientLoader.java

The sole purpose of the bootstrap loader program is to start and then request the 'real' client software from the network.

Task 7

Edit the runclient.bat command file to include the name of your computer

Change the name "ROSA" to the name of your computer. The command file will now be ready to run.

Task 8

Run the runclient.bat command file.

Copyright 1996-2000 jGuru.com. All Rights Reserved.