INSTRUCTIONS FOR RUNNING THE DEMO
---------------------------------

I. OBJECTIVE OF THE DEMONSTRATION

The demonstration shows how a RMI framework (client) can be connected to an EJB framework (server). 
The behavior of the two frameworks is simulated. What the demonstration shows is the message
transformations that are required to make the integration possible.

The client is an RMI program localhost_Greeting_Client.java (in the rmi/client directory). A "proxy" 
RMI server is implemented in the program localhost_Greeting_Interface.java and localhost_Greeting.java
(in the rmi/server directory). The method supported by this server is:

String greeting (String name)

It takes a name, say "Sunny", and returns a greeting: "Hi Sunny"

The proxy RMI server does not implement the "greeting" method. Instead it passes it on to the adapter
via the rpcExecuteCall() method. The server class is auto-generated from the interface class.

The demonstration does not show the IDL transformation. It can be seen that the RMI interface class
(rmi/localhost_Greeting_Interface.java) can be generated from the EJB remote interface class 
(ejb/GreetingSession.java)

II. RUNNING THE DEMO

It is assumed that the demo is running on a Windows workstation with jdk1.3
installed. The JVM ("java") should be in the path.

1. Open two "command prompt" windows 
2. Change directory to "framework1" in both the windows
3. In one of the windows type "java fmwk1" and wait for the "Trying to connect to adapter" message.
4. In the other window type "java Adapter"
5. Open two "command prompt" windows
6. Change directory to "framework2" in both the windows
7. In one of the windows type "java fmwk2" and wait for the "Trying to connect to adapter" message
8. In the other window type "java Adapter2"

For the rpcCreateObject call type the following in the window where framework1 is running:

rpcCreateObject
localhost
localhost_Greeting
<EndOfMessage>

It will return a DOR, something like:
localhost 4672d0

For rpcExecuteCall call type the following in the window where framework1 is running
(the second line of input is the DOR obtained from the first call):

rpcExecuteCall
localhost 4672d0
greeting
1
Sunny
<EndOfMessage>

The response will be:
Return typeid: 1 Return value: Hi Sunny

You can see the intermediate message processing in the "Adapter" and "Adapter2" windows.

As of now, the EJB functionality is directly implemented in the "Adapter2" program instead
of in the "fmwk2" program. The "fmwk1" program represents the RMI framework. 

III. RMI and EJB code

The RMI server code is in the directory rmi/server, the RMI client code is in the directory
rmi/client

The EJB server code is in the directory ejb.