Logo Anim eXtensible Distributed Architecture XDA Logo

Alphatech, Inc.

About XDA

Releases

Additional Software

XDA 4.1 Tutorial

Contact Us

XDA Releases

XDA 4.1 Tutorial: No CORBA example

Purpose: To demonstrate an XDA testbed that does not rely on CORBA. The adapter Simple.h/.cpp can be used to encapsulate a component under CORBA by using a different main file and linking in the appropriate libraries. This example isolates the XDA encapsulation procedure from the CORBA encapsulation procedure.

Tutorial requirements: Click here to get descriptions of the software and environment variables.
SoftwareRequired
Forte Optional
.NET Optional
Java No
ACE+TAO No
JAC No
ANT No
Environment VariableRequired
XDA_ROOT Yes
ACE_ROOT No
TAO_ROOT No
ANT_HOME No
JAVA_HOME No
JACORB_HOME No

Libraries
xda, cfg, encaspbase, dynquery, systask
Include Paths
../ont; $XDA_ROOT/include/xda; $XDA_ROOT/include

Procedure:

  1. Follow the instructions in Compiling Ontologies to compile $(XDA_ROOT)/share/onts/XDAexamples/geom_ont.gtoif you have not done so already.
  2. This example is found in $(XDA_ROOT)/XDA/examples/nocorba. You will need to build the executable. In that directory, type
    ant
    In Windows, the resulting executable is called nocorba.exe while on Unix the executable is called nocorba.
  3. To execute the file nocorba on Windows in the %XDA_ROOT%\XDA\examples\nocorba directory, use the following command line:

    nocorba -f %XDA_ROOT%\share\data\usr\xdausr_config.gto -n root.xda.xdausr_win -j %XDA_ROOT%\share\data\XDAexamples\xtrsimple_job3.gto

    All component output messages are located in the debug file (*.dbg), as specified in detail below. This file will contain one or more of the following lines:

    Persisted 1 value trees to <file.gto>

    Where <file.gto> contains all data transferred.

  4. Using Unix in the $XDA_ROOT/XDA/examples/nocorba directory, use the following command:

    nocorba -f $XDA_ROOT/share/data/usr/xdausr_config.gto -n root.xda.xdausr_unix -j $XDA_ROOT/share/data/XDAexamples/xtrsimple_job3.gto

    All component output messages are located in the debug file (*.dbg), as specified in detail below. This file will contain one or more of the following lines:

    Persisted 1 value trees to <file.gto>

    Where <file.gto> contains all data transferred.

  5. XDA debug files are created during the execution of the example. The location of these files is dependent on the xda.user_home parameter in the properties. For Windows, the default xda.user_home parameter is set to

    C:\vc70tao\share\data\usr

    The output files created in this no CORBA example are:

    simple_no_corba.dbg
    simple_no_corba.dbgs
    simple_no_corba.dbgd

Discussion: In this example, the executable nocorba reads in the xtrsimple_job3.gto that contains information about the input and output files for the execution step. The module Simple.h/.cpp represents a CORBA-free adapter that demonstrates the use of XDA APIs for getting input and producing output without specific knowledge of where the input is coming from or where the output is going. This additional information is contained in the xtrsimple_job3.gto file. Please view the file

$XDA_ROOT/share/data/XDAexamples/xtrsimple_job3.gto

with the GTO Editor. In that job file, note that the attribute

job[0]/inputs/gto_channel[0]/resource/absolute_name

is set to the input file

$(XDA_ROOT)/share/data/XDAexamples/geom_poly.gto

. Also note the attribute

job[0]/outputs/gto_channel[0]/resource/absolute_name

is set to the output file

$(XDA_ROOT)/XDA/examples/data/xtrsimple_out.gto

. You can change the input and output files by changing the appropriate filenames for the respective attribute in the xtrsimple_job3.gto. At runtime, the adapter receives the input specified by the job as instances of the ontology class "poly", which it processes by computing the "centroid". Then the adapter submits the resulting "poly" as output. The output is persisted to the output file specified in the job.
Note that the configuration gto and the component configuration node are passed into the nocorba executable as command-line arguments.


Previous Index Next

AIT Home | About XDA | Releases | Additional Software | Contact Us