XDA 4.1 Tutorial: Running ACE+TAO

XDA 4.1 Tutorial: Running ACE+TAO

Purpose: To start the ACE+TAO Implementation Repository (ImR), the ImR Activator, and the Naming Service when running persistent or just the Naming Service when running in transient. XDA-encapsulated CORBA servers will need to be installed with the TAO ImR to make the server a persistent object with automatic activation.

Tutorial requirements: Click here to get descriptions of the software and environment variables.

Software
Required

Forte
No

.NET
No

Java
Yes

ACE+TAO
Yes

JAC
No

ANT
Yes

Environment Variable
Required

XDA_ROOT
Yes

ACE_ROOT
Yes

TAO_ROOT
Yes

JAVA_HOME
Yes

ANT_HOME
Yes

JACORB_HOME
No

Libraries

None

Include Paths

None

Procedure:

  1. Provided that you have ANT and Java installed, the easiest way to start the TAO ImR, ImR Activator, and Naming Service is to use the built-in ANT scripts. Copy $(XDA_ROOT)/share/classes/xdatasks.jar to the $(ANT_HOME)/lib folder. In $(XDA_ROOT)/share/bin, copy the template.xdaorb.properties to xdaorb.properties and edit the xdaorb.properties file. You should adjust the properties as appopriate for your installation of XDA. When using ANT, remember to copy $(XDA_ROOT)/share/classes/xdatasks.jar to the $(ANT_HOME)/lib directory. To get more verbose output from ANT, you can add the -verbose argument to your ANT command. The default setting in the xdaorb.properties file is to run transient objects. To change to persistent objects, refer to Transient Persistent Tutorial. If the settings are for persistent, in the $(XDA_ROOT)/share/bin directory, type
    ant tao.start
    to start the TAO ImR, Activator, and Naming Service. Two Interoperable Object Reference (IOR) files will be created in accordance with the tao.imr.ior and tao.ns.ior properties in the xdaorb.properties file. Both the tao_imr.ior (Implementation Repository IOR) and tao_ns.ior (Naming Service IOR) will be created in the $XDA_ROOT directory. Depending on your OS, either 3 xterms (Unix) or 3 command prompts (WinXP) will be created; each will be running either the ImR, ImR Activator, or the Naming Service.
  2. If the settings are for transient, typing:
    ant tao.start
    will bring up a single xterm (Unix) or command prompt (WinXP) in which the Naming Service is running. The Naming Service IOR will also be in the location specified by the configuration GTO.
  3. To install an XDA encapsulated component using the built-in ANT script, type the following:

    ant tao.install -Dimpl=<impl_name> -Dexe=<path_to_exe>

    where <impl_name> is the unique name of your server and <path_to_exe> is the path to the server's executable file. For a more specific example of using this script, please refer to the XDAsimple example.

    • For persistent settings, this will actually install the XDA Component into the TAO ImR and Naming Service and will allow the ImR Activator to automatically activate this component.
    • For the transient setting, the component is only installed in the Naming Service and will run in a new xterm (Unix) or command prompt (WinXP).
  4. To stop the TAO ImR, ImR Activator, and Naming Service using the built-in ANT scripts, type the following:
    ant tao.stop

(Behind ANT):In cases where the user can not use ANT, typing ant -verbose <ant-argument> prints out the actual commands issued by ANT. Below are the commands for the persistent setting only.

  1. For Windows, this is the command that starts the TAO Implementation Repository:

    start C:\vc70tao/XDA/bin/XDACmd.exe ImplRepo D:\ACE_wrappers\TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.exe -o C:\vc70tao\tao_imr.ior -ORBDottedDecimalAddresses 1

    where %XDA_ROOT% is C:\vc70tao. The -o C:\vc70tao\tao_imr.ior argument specifies the location of the ImR IOR file. Similary, the following WinXP command starts the Naming Service:

    start C:\vc70tao/XDA/bin/XDACmd.exe Naming_Service D:\ACE_wrappers\TAO/orbsvcs/Naming_Service/Naming_Service.exe -o C:\vc70tao\tao_ns.ior -ORBDottedDecimalAddresses 1

    where the -o C:\vc70tao\tao_ns.ior argument specifies the location of the Naming Service IOR file. To start the ImR Activator, use:

    start C:\vc70tao/XDA/bin/XDACmd.exe ImR_Act D:\ACE_wrappers\TAO/orbsvcs/ImplRepo_Service/ImR_Activator.exe -ORBInitRef NameService=file://C:\vc70tao\tao_ns.ior -ORBInitRef ImplRepoService=file://C:\vc70tao\tao_imr.ior

    .

  2. For Unix, start the TAO ImR by typing:

    /bin/sh -c "xterm -fn 6x13 -sb -sl 3000 -geometry 80x12+0+0 -fg black -bg '#ccccff' -title ImplRepo -e /proj/xda/ACE+TAO/x.3.1/sun54/ACE_wrappers/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service -o /local/xda4.1/sun54tao/tao_imr.ior -ORBDottedDecimalAddresses 1 </DEV null>/dev/null 2>&1 &"

    where $XDA_ROOT is /local/xda4.1/sun54tao and the -o /local/xda4.1/sun54tao/tao_imr.ior argument specifies the location of the ImR IOR file. Type:

    /bin/sh -c "xterm -fn 6x13 -sb -sl 3000 -geometry 80x12+0+180 -fg black -bg '#ccccff' -title Naming_Service -e /proj/xda/ACE+TAO/x.3.1/sun54/ACE_wrappers/TAO/orbsvcs/Naming_Service/Naming_Service -o /local/xda4.1/sun54tao/tao_ns.ior -ORBDottedDecimalAddresses 1 </DEV null>/dev/null 2>&1 &"

    to start the Naming Service. Note that the -o /local/xda4.1/sun54tao/tao_ns.ior argument specifies the location and name of the Naming Service IOR file. To start the ImR Activator, type:

    /bin/sh -c "xterm -fn 6x13 -sb -sl 3000 -geometry 80x36+0+360 -fg black -bg '#ccccff' -title ImR_Act -e /proj/xda/ACE+TAO/x.3.1/sun54/ACE_wrappers/TAO/orbsvcs/ImplRepo_Service/ImR_Activator -ORBInitRef NameService=file:///local/xda4.1/sun54tao/tao_ns.ior -ORBInitRef ImplRepoService=file:///local/xda4.1/sun54tao/tao_imr.ior </DEV null>/dev/null 2>&1 &"

    . To stop the ImR, ImR Activator, and Naming Service, find the processes and kill them or type Ctrl-c in the terminals.

  3. To administer the TAO ImR, you can use the $TAO_ROOT/orbsvcs/ImplRepo_Service/tao_imr executable (.exe on WinXP). To view a list of registered servers, type

    tao_imr -ORBInitRef ImplRepoService=file://C:\vc70tao\tao_imr.ior list

    where the -ORBInitRef is an ORB argument followied by the TAO Imr IOR file. Other arguments to tao_imr can include remove and update with each requiring additional arguments.

Discussion:The built-in ANT scripts for starting the TAO ImR, ImR Activator, and Naming Service can be run on either the Windows or Unix platforms as long as Java and ANT are installed. Note that the TAO ImR and ImR Activator are not started when the xdaorb.properties settings are for transient. In all cases, the user must make sure that ACE_ROOT and TAO_ROOT are set appropriately.

你可能感兴趣的:(C++,c,ant,unix,C#)