Building RMI Applications
An RMI application has several major components:
- client
- server
- registry
- stubs
- skeletons
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:
- Build an executable and/or DLLs that contain all of the
server classes, all of the stub classes, and all of the
skeleton classes.
To build the client:
- Build an executable and/or DLLs that contain all of the
client classes and all of the stub classes.
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:
- Issue the following command to set the CLASSPATH
environment variable:
set CLASSPATH=.
- 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.)
- 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