CORBA 2.6.1 Getting Started Guide for Java

StackPackage/STACK_OVERFLOWHelper.java
StackPackage/STACK_OVERFLOWHolder.java
StackPackage/STACK_UNDERFLOW.java
StackPackage/STACK_UNDERFLOWHelper.java
StackPackage/STACK_UNDERFLOWHolder.java
These files contain the CORBA-specified Java language-mapping translation of the interface definition provided in the stack.idl file. The
compilation steps use the NonStop Server for Java tools to compile the programs. During the compilation, the Java compiler uses the NonStop
CORBA implementation files in the $NSD_ROOT/lib/jorb.jar file.
Configuring NonStop CORBA for the Stack Example
Before you can run the Stack example, you must update the configuration database by adding an entity and several key-value pairs, but only
after you have installed and configured NonStop CORBA.
To update the configuration database for the Stack example, add the
tcp_server entity to the NonStop CORBA configuration database by
entering:
entityaddkeyvalue tcp_server@ORB tcp_server true
entityaddkeyvalue tcp_server@ORB port_number 0
entityaddkeyvalue tcp_server@ORB host_name nnn.nnn.nnn.nnn
Note that in setting the host name you can enter either a host name or an IP address.
Running the Stack Example on OSS
The Stack example is now ready to run. If your NonStop CORBA system is not already running, you must start it by using the Console or the
nsdstart script.
To run the Stack example, open two OSS windows. In each window, navigate to the directory where the Stack example was built,
javasamples/stack. Also, make sure that each window has the correct environment setup, which is obtained by sourcing in the env.sh script.
In one window, start the server program by using the following command:
java Server -ORBprofile tcp_server
In the other window, start the client program by using the following command:
java Client -ORBprofile tcp_client
When you run the client, you will see the following output in its window:
Top: 100
Top: 200
Top: 300
Top: 400
Top: 500
Top: 600
Top: 700
Top: 800
Top: 900
Top: 1000
Got STACK_OVERFLOW exception as expected.
Pop: 1000
Pop: 900
Pop: 800
Pop: 700
Pop: 600
Pop: 500
Pop: 400
Pop: 300
Pop: 200
Pop: 100
Got STACK_UNDERFLOW exception as expected.
If you see the output as described above, you have successfully built and run the Stack example on your NonStop CORBA system.
Once you are satisfied with the output, you can stop the server program (in the server OSS window) by pressing Ctrl-C.
You can now begin developing your own CORBA clients and servers using NonStop CORBA system.
If you do not obtain the output as described above, either you have not correctly installed and configured NonStop CORBA, or you did not build
and run the example program correctly. You can start the debugging process by using PATHCOM to view the status of your NonStop CORBA
server-pool processes to see if the ORB processes are running.
Chapter 3. Considerations for Migrating from
Previous
Releases
Chapter 5. Installing JORB Lite