This exercise makes use of the Hello example.

a) Open a directory for this exercise. Place the source files for the Hello example in the directory.
b) Compile HelloInterface.java and HelloImpl.java.
c) Use rmic to compile HelloImpl. Check the folder to see that the proxy classes are generated. What are their names?
d) Compile HelloServer.java . Check the contents of your folder
e) Run the server, specifying a random port number for the RMI Registry. Check the messages displayed, including the list of names currently in the registry. Do you see the name that the server registered under (as specified in the program)?
f) Compile and run HelloClient.java. When prompted, specify “localhost”for the host name, and the RMI registry port number you previously specified.
What happened? Explain.
g) Run the client program on a separate machine. Were you successful?


c. HelloImpl_Skel.class
HelloImpl_Stub.class
d. The HelloServer.class has been created.
e. C:\mliu\tmp\hello>java HelloServer
Enter the RMIregistry port number:
12345
RMI registry cannot be located at port 12345
RMI registry created at port 12345
Server registered. Registry currently contains:
Registry rmi://localhost:12345/hello contains:
rmi://localhost:12345/hello
Hello Server ready.
Yes, the name of the server is in the registry: rmi://localhost:12345/hello
f. ```
C:\mliu\tmp\hello>java HelloClient
Enter the RMIRegistry host namer:
localhost
Enter the RMIregistry port number:
12345
Lookup completed
HelloClient: Hello, World!
```
The client looks up the RMI registry to locate the remote object exported by the server. The remote method sayHello executed successfully, and the return value (“Hello, world!) is displayed.
g. Yes, RMI works fine when the client and server run on a separate machine,

Computer Science & Information Technology

You might also like to view...

A lookup table

A) looks up a value and returns a related result. B) is a reference to a cell containing a value to look up. C) contains data for the basis of the lookup and the data to be retrieved. D) is the lowest value for a specific category or series.

Computer Science & Information Technology

A user wants to expand his normal Windows 7 desktop work area across two monitors. What would be the best solution for this user?

A) Use an integrated VGA port and a DVI port on an adapter. B) Install a video card with two ports if two ports are not available on the motherboard. C) Use a KVM switch. D) Use a video splitter.

Computer Science & Information Technology

Containers are essentially used ____.

A. to manipulate data B. to step through a set of given elements C. to manage objects of a given type D. to update objects that are part of a given set of elements

Computer Science & Information Technology

The@mediaand@importrules employ similar syntax.?

Answer the following statement true (T) or false (F)

Computer Science & Information Technology