Building RMI Applications

An RMI application has several major components:

You can compile both the client and server to native code using HPCJ. You'll need to use the registry from the JDK for your application. The stubs and skeletons are automatically generated classes. You should use the rmic stub and skeleton generator from the JDK to create these classes.

To build the server:

To build the client:

Example:

Consider an example with a remote interface Hello, a server class HelloImpl and a client class HelloApp. The RMI stub generator run on the HelloImpl class generates the stub class HelloImpl_Stub and the skeleton class HelloImpl_Skel.

To build the application:

  1. Issue the following command to set the CLASSPATH environment variable:

    set CLASSPATH=.

  2. Issue the following command to build the server as a single executable:

    hpj -exe -o Server HelloImpl HelloImpl_Skel HelloImpl_Stub

    This creates an executable named Server that contains the classes HelloImpl_Skel, HelloImpl_Stub, HelloImpl, and any classes recursively referenced by these classes. (In this example, assume that the only referenced class is the interface Hello.)

  3. Issue the following command to build the client as a single executable:

    hpj -exe -o Client HelloApp HelloImpl_Stub

    This creates a single executable named Client that consists of the classes HelloImpl_Stub, HelloApp, and any classes recursively referenced by these classes. (In this example, assume that the only referenced class is the interface Hello.)

 


Building Executables and DLLs