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

jGuru: Help: RMI Parameters

 


[Exercise | API Docs | Short Course| Exercises]

Help is available for each task.

Task 1

Add the getMessageObject method to the Hello interface.

In the file Hello.java add the following method to the interface definition: MessageObject getMessageObject() throws RemoteException;

Task 2

Create an implementation for the getMessageObject method in the HelloImpl class.

Add the getMessageObject remote method and return a new instance of the MessageObject class.

You can use the following code:

public MessageObject getMessageObject() 
              throws RemoteException
{
  return new MessageObject();
}

Task 3

Compile all of the class files for the server and its remote objects.

Use the javac program:

javac *.java

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

Start the RMI Server in its own DOS console.

Start a new DOS console program. Change the current directory to the location of your .java files for the server. Run RMIServer with the java utility:

java RMIServer

Task 6

Start the RMI Client in its own DOS console.

Start a new DOS console program. Change the current directory to the location of your .java files for the client. Run RMIClient with the java utility:

java RMIClient

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