by MageLang Institute
[Help |
API Docs |
Short Course|
Magercises]
In this Magercise, you will run a CORBA server and client that have been provided.
Basically it tests the installation of your ORB.
This Magercise can be completed with either Sun's Java IDL ORB or Inprise's VisiBroker 3.x for Java.
Prerequisites
None.
Skeleton Code
Tasks
1. Download the Jar files for the client and the
for the server. (See "Skeleton Code" above.)
To run the server you need to download the
stockServer.jar
file.
To run the client you need to download
the stockServer.jar
file.
2. Run the programs in the order given below:
| run the server |
java StockServer.theServer gii.ior |
| run the client |
java StockClient.theClient gii.ior |
Notes
Your classpath needs to include the jar file containing the
StockServer or StockClient.
For VisiBroker you
also need to include the files vbjorb.jar and vbjapp.jar
on the classpath. Alternatively, you can use the vbj program to
run your programs instead of
using java directly. The vbj command adds the
vbjorb.jar and vbjapp.jar files to the classpath
appropriately and then invokes Java.
If you are using VisiBroker and Java 2, then you need to define
the following system properties as well:
org.omg.CORBA.ORBClass=
com.visigenic.vbroker.orb.ORB
org.omg.CORBA.ORBSingletonClass
=com.visigenic.vbroker.orb.ORB
Where help exists, the task numbers above are linked to the
step-by-step help page.
This Magercise has walked you through the steps of running a CORBA server
and a CORBA client.
In future excercises you will build your own CORBA programs and run them
analogously.
Solution Source
To run the server you need to download the
stockServer.jar
file.
To run the client you need to download
the stockServer.jar
file.
Demonstration
When you start the server it should output:
Created GII:
IOR:000000000000001b49444c3a53746f636b4f626a6563
74732f53746f636b3a312e30000000000001000000000000
0034000100000000000d36393039636b6e39613234380000
049c00000018afabcafe00000002ee387de1000000080000
000000000000
|
The value of the IOR string will of course be different.
When you run the client it should output:
Global Industries Incorporated is currently selling at 28.0
Volume is 0
Copyright © 1998-1999
MageLang Institute.
All Rights Reserved.
|