This example includes a server process that, on initialisation, registers a service type in the Trading Service's Service Type Repository. This service type describes properties designed to advertise video feeds provided by the TradingVideoCompany objects. A ServiceProvider (singleton) object is created by the server process that manages TradingVideoCompany objects - which when created, export their offers to the Trader advertising videos for offer by type, title, and cost. The example also includes a client process that queries the Trader for TradingVideoCompany objects that meet with the required property criteria (type/title/cost) selected at random. Once retrieved, each TradingVideoCompany object can be invoked to supply the feed.
These instructions are based on the Solaris gcc3.2 compiler makefiles.
ACE_ROOT=<TAO install dir>; export ACE_ROOT
TAO_ROOT=<TAO install dir>; export TAO_ROOT
SHLIB_PATH=$TAO_ROOT/lib; export SHLIB_PATH
LD_LIBRARY_PATH=$TAO_ROOT/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
PATH=$PATH:$TAO_ROOT/bin; export PATH
INSLIB=$TAO_ROOT/lib; export INSLIB
PATH=/usr/local/gcc-3.2/bin:/usr/ccs/bin:$PATH; export PATH
LD_LIBRARY_PATH=/usr/local/gcc-3.2/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
<TAO install dir>/examples/cc
directory.
make
command to run the makefile. This will compile all of the OpenFusion examples.
TAO_ROOT=<TAO install dir>
where
<TAO install dir>
is the location into which you have installed
TAO.
<TAO install dir>\examples\cc\cc.dsw
. Double-click on the project file to load
it into
Microsoft Visual C++. When loaded, change the Common project from debug
mode to release mode using the Build | Set Active Configuration menu option.
UNIX:
Ensure that the environment variable LD_LIBRARY_PATH
includes the path
to where the common files and the video files were compiled:
LD_LIBRARY_PATH=<TAO install dir>/examples/cc/Common:<TAO install dir>/examples/cc/Trading/video:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
Change to the <TAO install dir>/examples/cc/Trading/video/server
directory.
Windows NT: Start a DOS window. Ensure that your path contains:
<TAO
install dir>\bin;<TAO install dir>\examples\cc\bin
Ensure that the OpenFusion Trading Service is running. In order to run the OpenFusion Trading Service you must first install the OpenFusion TCS - JacORB with OpenFusion CORBA Services distribution. This can be obtained from the downloads page by following the OpenFusion CORBA Products software link.
tradingvideoserver -ORBInitRef TradingService=file://<OF_INSTALL_DIR>/domains/OpenFusion/localhost/TradingService/TradingSingleton/TradingSingleton.ior
Where <OF_INSTALL_DIR>
is the OpenFusion TCS - JacORB with
OpenFusion CORBA
Services installation directory.
The server will
respond with the prompt "Ready...
"
when it is ready to receive remote function calls.
On UNIX, change to the <TAO install dir>/examples/cc/Trading/video/client
directory.
tradingvideoclient -ORBInitRef TradingService=file://<OF_INSTALL_DIR>/domains/OpenFusion/localhost/TradingService/TradingSingleton/TradingSingleton.ior
This will resolve the Trading Service and query the service for video-supplier companies with arbitrary properties.