Programming CORBA with Orbacus on Linux
A simple CORBA client/server pair
This examples demonstrates some techniques using a very simple example of a client/server pair.
We have to supply the following files:
The example can be build using this Makefile.
After succesfull build of all executables, the following steps are required for running the example.
First, you have to setup all PATH and LD_LIBRARY_PATH variables as explained
here.
First, you have to start the server, then, in another window, the client. The client tries to
locate the server via a reference stored in a file, and calls some remote methods.
It is possible to run both programs on different hosts, if the machines have access to a common
file system, e.g. a Samba or NFS filesystem. Both programs must be able to write or find the
file with the stringified IOR.
A simple CORBA client/server pair
This example contains also Java versions of all programs:
The Java files must be placed in a subdirectory 'Hallo', because I placed the classes in a package
named 'Hallo'.
The example can be build and executed using the following procedure:
adrasteia\\s:\ set CLASSPATH=.;%JOB%\lib\OB.jar
adrasteia\\s:\ jidl --package Hallo Hallo.idl
adrasteia\\s:\ javac Hallo\*.java
adrasteia\\s:\ java Hallo.server
nike\\s:\ set CLASSPATH=.;%JOB%\lib\OB.jar
nike\\s:\ java Hallo.client
The JOB variable contains the directory into which I extracted the Orbacus Java archives. The jidl
command creates the Java stub and skeleton classes, explicitly specified that a package 'Hallo'
should be created for them. All client and server classes are also in this package and therefore in
the subdirectory 'Hallo'.
back to CORBA page
|