Consortium    Solutions    Middleware    Forge    MyObjectWeb 
ObjectWeb Consortium
Print

Advanced - Powered by Google






OpenCCM

Project Links
· Home
· Download
· Documentation
· Mailing Lists
· Wiki
· Partners
· License
· History
· Related projects

Developers' Corner
· How to Contribute
· Workplan
· Resources
· CVS Repository
· Bug Tracking
· ObjectWeb Forge Site
· User Mailing List
· Team Mailing List

About
· Team
· Contacts

CORBA Module User's Guide

  1. Setting up your environment
  2. Compiling OMG IDL 2.x files to Java
  3. Usage instructions for the CORBA services
  4. Writing Trading Service Type Descriptions in XML

Setting Up Your Environment

Loading the OpenCCM Environment

To have access to all the OpenCCM commands, it is required to source the OpenCCM environment file according to the shell used.

  • For Unix shells like sh or bash, do:
    $ . /A_PATH/bin/envi.OpenCCM.sh
  • For Unix C-shells like csh or tcsh, do:
    $ source /A_PATH/bin/envi.OpenCCM.csh
  • For Windows shells, do:
    $ call \A_PATH\bin\envi_OpenCCM.bat

Where A_PATH refers to the path where OpenCCM is compiled or installed.

These environment files add the path of the OpenCCM commands in the PATH shell variable and define the following shell variables required by OpenCCM:

  • ORB_HOMEDIR: The directory where the used ORB is installed.
  • OpenCCM_HOMEDIR: The directory where OpenCCM is compiled or installed.
  • OpenCCM_CONFIG_DIR: The directory where the OpenCCM Configuration Repository will be stored.

The following scripts allow you to unset the shell variables defined by OpenCCM.

  • For Unix shells like sh or bash, do:
    $ . /A_PATH/bin/un.envi.OpenCCM.sh
  • For Unix C-shells like csh or tcsh, do:
    $ source /A_PATH/bin/un.envi.OpenCCM.csh
  • For Windows shells, do:
    $ call \A_PATH\bin\un_envi_OpenCCM.bat

The OpenCCM Configuration Repository

During OpenCCM uses, the OpenCCM Configuration Repository will contain IORs (Interoperable Object Reference), PIDs (Process IDentifier), and output of the started OpenCCM processes.

By default, the OpenCCM Configuration Repository is stored in the $HOME/OpenCCM_CONFIG_DIR directory. Then each user has its own OpenCCM Configuration Repository as long as he/she does not change the default value of the OpenCCM_CONFIG_DIR variable. Thus, several users can run their own OpenCCM platform on a same host.

Moreover, if the $HOME directory can be accessed by a set of networked hosts (e.g. sharing done through NFS), then a user has one OpenCCM Configuration Repository shared across all these hosts.

If several users set their OpenCCM_CONFIG_DIR variable to the same directory, then they share the same OpenCCM Configuration Repository.

Finally, if a user starts several shells and sets in each shell the OpenCCM_CONFIG_DIR variable to different directories, then he/she can run several distinct OpenCCM platforms.

Compiling OMG IDL 2.x files to Java

The idl2java script wraps the OMG IDL 2.x to Java compiler of the underlying used CORBA product, e.g.:

$ cat test/sample1.idl
...
module a
{
    module b
    {
        interface I1 {};
    };
};
$
$ idl2java test/sample1.idl
$
$ ls -R a
a:
b/

a/b:
I1Helper.java  I1Holder.java  I1.java  I1Operations.java  I1POA.java  I1POATie.java  _I1Stub.java
$

The idl2java script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
-d destdirSet the destination directory name, default is .
-IDIRPut DIR in the include file search path.
-i2jpackage idl.module:java.pkgDefine the target Java package for an OMG IDL module.

To obtain usage and help information, do:

$ idl2java --help
Usage: idl2java [-h|--help] [--version] [--silent]
                [-d destdir] [-IDIR] [-i2jpackage idl.module:java.pkg]
                omg_idl_file

Options:
  -h, --help                      Display this information and exit
  --version                       Output version information and exit
  --silent                        Silent output messages
  -d destdir                      Set the destination directory name, default is .
  -IDIR                           Put DIR in the include file search path
  -i2jpackage idl.module:java.pkg Define the target Java package for an OMG IDL module

Description:
  Generate Java Mapping from an OMG IDL 2.0 file.

$

To obtain version information, do:

$ idl2java --version
OpenCCM idl2java 0.9.0

Copyright (C) 2000-2005 INRIA - USTL - LIFL - GOAL
...
$

By default, the idl2java script could display messages. To silent these output messages, do:

$ idl2java --silent test/sample1.idl
$

By default, the idl2java script generates the OMG IDL to Java mapping into the current directory.
However, the -d destdir option allows you to specify another directory, e.g.:

$ mkdir mapping
$ idl2java -d mapping test/sample1.idl
. . .
$ ls -R mapping
mapping:
a/

mapping/a:
b/

mapping/a/b:
I1Helper.java  I1Holder.java  I1.java  I1Operations.java  I1POA.java  I1POATie.java  _I1Stub.java
$

The -IDIR option allows you to add the directory DIR in the include file search path of the OMG IDL compiler provided by the underlying used CORBA product.

The -i2jpackage option allows you to define the target Java package for an OMG IDL module.

Usage instructions for the CORBA services

The OpenCCM Execution Tool Chain provides a set of tools to start and stop the CORBA services used in the OpenCCM platform.

The CORBA module provides the following commands :

commandDescription
ccm_install Installs the OpenCCM Configuration Repository.
ccm_installed Checks if the OpenCCM Configuration Repository is installed.
corba_uninstall Stops all services and uninstall the OpenCCM Configuration Repository.
ns_gui Starts a client GUI on the running CosNaming Service.
ns_ior Obtains the IOR of the running CosNaming Service.
ns_set Sets the CosNaming Service to use.
ns_start Starts the CosNaming Service.
ns_started Checks if the CosNaming Service is started.
ns_stop Stops the CosNaming Service.
openccm_launcher Wraps the Launcher tool by enriching Java classpath and properties.
ots_ior Obtains the IOR of the running CosTransactions Service.
ots_set Sets the CosTransactions Service to use.
ots_start Starts the CosTransactions Service.
ots_started Checks if the CosTransactions Service is started.
ots_stop Stops the CosTransactions Service.
trader_feed Feeds the CosTrading Service Type Repository.
trader_gui Starts a client GUI on the running CosTrading Service.
trader_ior Obtains the IOR of the running CosTrading Service.
trader_set Sets the CosTrading Service to use.
trader_start Starts the CosTrading Service.
trader_started Checks if the CosTrading Service is started.
trader_stop Stops the CosTrading Service.

In the following sections, all OpenCCM Execution Tool Chain scripts are illustrated on top of the ORBacus 4.1.0 product running on a Linux system.
However all these following scripts could be used in the same way on any ORB products and operating systems supported by OpenCCM.

Installing the OpenCCM Configuration Repository

The OpenCCM Execution Tool Chain is mainly based on the use of the OpenCCM Configuration Repository.

Let's note that before using any OpenCCM Execution Tool Chain tool, it is required to install the OpenCCM Configuration Repository.

The ccm_install script installs the OpenCCM Configuration Repository which consists in the $OpenCCM_CONFIG_DIR directory:

$ ccm_install
The OpenCCM Platform will be installed.
Creating the /Users/cc/OpenCCM_CONFIG_DIR directory.
The OpenCCM Platform is installed.
$
  

Warning: This script can be started only once, e.g.:

$ ccm_install
Error: The OpenCCM Platform is already installed!
$
  

See the corba_uninstall script to deinstall the OpenCCM Configuration Repository.

Checking if the OpenCCM Configuration Repository is installed

The ccm_installed script checks if the OpenCCM Configuration Repository is installed, e.g.:

$ corba_uninstall
. . .
$ ccm_installed
Error: The OpenCCM Platform is not installed!
$
  

Let's note that this OpenCCM script is mainly used by other OpenCCM scripts to check if the OpenCCM Configuration Repository is installed or not.

Deinstalling the OpenCCM Configuration Repository

The corba_uninstall script uninstalls the previously installed OpenCCM Configuration Repository, e.g.:

$ ccm_install
. . .
$ corba_uninstall
The OpenCCM Platform will be deinstalled.
Removing the $OpenCCM_CONFIG_DIR directory.
The OpenCCM Platform is deinstalled.
$
  

Let's note that this script stops all currently started OpenCCM processes and removes the $OpenCCM_CONFIG_DIR directory.

Starting the CosNaming Service

The ns_start script starts the CosNaming Service used by the OpenCCM Execution Tool Chain, e.g.:

$ ns_start
The CosNaming Service will be started.
Launching the ORBacus-4.1 CosNaming Service.
The CosNaming Service is started.
$
  

Let's note that this script automatically launches a CosNaming Service process and stores its IOR and PID into the OpenCCM Configuration Repository, e.g.:

$ ls $OpenCCM_CONFIG_DIR
. . . NameService.IOR NameService.PID
$
  

Warning: Only one CosNaming Service can be started for an OpenCCM Configuration Repository, e.g.:

$ ns_start
Error: The CosNaming Service is already started!
$
  

See the ns_stop script to stop the started CosNaming Service.

Setting the CosNaming Service to use

In a distributed configuration, you could want to use a CosNaming Service already started on another remote node instead of starting the CosNaming Service on the local node. Then the ns_set script allows you to set locally the IOR or the URL to the remote CosNaming Service to use, e.g.:

$ ns_set
usage: ns_set [IOR | URL]
$
$ ns_set IOR:...
The CosNaming Service is set.
$
$ ns_set http://host.domain:port/file
The CosNaming Service is set.
$
$ ns_set mcast://address_group/file
The CosNaming Service is set.
$
  

If the CosNaming Service to use is started on a node where the OpenCCM Comanche Server is also started, then you could set the CosNaming Service to use as following:

$ ns_set http://host.domain:8080/NameService.IOR
The CosNaming Service is set.
$
  

Where host.domain refers to the node where the OpenCCM Comanche server is started.

Warning: The ns_set script does not control the correctness of the IOR or URL given as parameter, it just copies it into the local $OpenCCM_CONFIG_DIR/NameService.IOR file.

Checking if the CosNaming Service is started

The ns_started script checks if the CosNaming Service is started or not, e.g.:

$ ns_stop
. . .
$ ns_started
Error: The CosNaming Service is not started!
$
  

Let's note that this OpenCCM script is mainly used by other OpenCCM scripts when they need to check if the CosNaming Service is started or not.

Obtaining the IOR of the running CosNaming Service

The ns_ior displays the IOR of the running CosNaming Service, e.g.:

$ ns_ior
IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F
6E746578744578743A312E300000000000010000000000000054000102000000000F3133342E3230
362E31302E3232330000C72100000000001F5374616E646172644E532F4E616D655365727665722D
504F412F5F726F6F7400000000010000000000000008000000004A414300
$
  

Starting a client GUI on the running CosNaming Service

The ns_gui starts a client GUI on the running CosNaming Service, e.g.:

$ ns_gui
An ORBacus 4.1 CosNaming Service GUI will be started.
  

Warning: Currently this script is only provided for the ORBacus and JacORB products!

See the ccm_explorer script to start the OpenCCM Explorer which provides a generic plug-in for browsing the CosNaming Service.

Stopping the CosNaming Service

The ns_stop script stops the previously started CosNaming Service, e.g.:

$ ns_stop
The CosNaming Service will be stopped.
The CosNaming Service is stopped.
$
$ ns_stop
Error: The CosNaming Service is not started!
$
  

Let's note that this script shutdowns the CosNaming Service process and removes its associated IOR and PID files from the OpenCCM Configuration Repository.

Starting the CosTrading Service

The trader_start script starts the CosTrading Service used by the OpenCCM Execution Tool Chain, e.g.:

$ trader_start
The CosTrading Service will be started.
Launching the ORBacus 4.1 CosTrading Service.
Feeding the CosTrading Service Type Repository with OpenCCM basic service types.
trader_feed 0.9.0: Reading from file $OpenCCM_HOMEDIR/xml/trading/basic.xml...
trader_feed 0.9.0: Compiling $OpenCCM_HOMEDIR/xml/trading/basic.xml file...
trader_feed 0.9.0: Compilation completed.
The CosTrading Service is started.
$
  

Let's note that this script automatically launches a CosTrading Service process and stores its IOR and PID into the OpenCCM Configuration Repository, e.g.:

$ ls $OpenCCM_CONFIG_DIR
. . . TradingService.IOR TradingService.PID
$
  

This script also feeds the CosTrading Service Type Repository with some OpenCCM service types. These service types are described in the $OpenCCM_HOMEDIR/xml/trading/basic.xml file conform to the Trading Service Type Descriptor XML DTD.

Warning: Only one CosTrading Service can be started for an OpenCCM Configuration Repository, e.g.:

$ trader_start
Error: The CosTrading Service is already started!
$
  

See the trader_stop script to stop the started CosTrading Service.

Setting the CosTrading Service to use

In a distributed configuration, you could want to use a CosTrading Service already started on another remote node instead of starting the CosTrading Service on the local node. Then the trader_set script allows you to set locally the IOR or the URL to the remote CosTrading Service to use, e.g.:

$ trader_set
usage: trader_set [IOR | URL]
$
$ trader_set IOR:...
The CosTrading Service is set.
$
$ trader_set http://host.domain:port/file
The CosTrading Service is set.
$
  

If the CosTrading Service to use is started on a node where the OpenCCM Comanche Server is also started, then you could set the CosTrading Service to use as following:

$ trader_set http://host.domain:8080/TradingService.IOR
The CosTrading Service is set.
$
  

Where host.domain refers to the node where the OpenCCM Comanche server is started.

Warning: The trader_set script does not control the correctness of the IOR or URL given as parameter, it just copies it into the local $OpenCCM_CONFIG_DIR/TradingService.IOR file.

Checking if the CosTrading Service is started

The trader_started script checks if the CosTrading Service is started or not, e.g.:

$ trader_stop
. . .
$ trader_started
Error: The CosTrading Service is not started!
$
  

Let's note that this OpenCCM script is mainly used by other OpenCCM scripts when they need to check if the CosTrading Service is started or not.

Obtaining the IOR of the running CosTrading Service

The trader_ior displays the IOR of the running CosTrading Service, e.g.:

$ trader_ior
IOR:000000000000002249444C3A6F6D672E6F72672F436F7354726164696E672F4C6F6F6B75703A
312E3000000000000001000000000000005C000102000000000F7072696D75732E6C69666C2E6672
00008FF3000000000014004F4F01031773EC04010000504F41FE28F2071B00000001000000010000
001C00000000000100200000000100010001000101090000000100010100
$
  

Starting a client GUI on the running CosTrading Service

The trader_gui starts a client GUI on the running CosTrading Service, e.g.:

$ trader_gui
An ORBacus 4.1 CosTrading Service GUI will be started.
  

Warning: Currently this script is only provided for the ORBacus product!

See the ccm_explorer script to start the OpenCCM Explorer which provides a generic plug-in for browsing the CosTrading Service.

Feeding the CosTrading Service Type Repository

The trader_feed script feeds the CosTrading Service Type Repository used by the OpenCCM Execution Tool Chain with some service type descriptions provided in an XML file, e.g.:

$ trader_feed test/trading/various.xml
trader_feed 0.9.0: Reading from file test/trading/various.xml...
trader_feed 0.9.0: Compiling test/trading/various.xml file...
trader_feed 0.9.0: Compilation completed.
$
  

The Trading Service Type Descriptor XML DTD is described here.

Stopping the CosTrading Service

The trader_stop script stops the previously started CosTrading Service, e.g.:

$ trader_stop
The CosTrading Service will be stopped.
The CosTrading Service is stopped.
$
$ trader_stop
Error: The CosTrading Service is not started!
$
  

Let's note that this script kills the CosTrading Service process and removes its associated IOR and PID files from the OpenCCM Configuration Repository.

Starting the CosTransactions Service

The ots_start script starts the CosTransactions Service used by the OpenCCM Execution Tool Chain, e.g.:

$ ots_start
The CosTransactions Service will be started.
Launching the ORBacus 4.1 CosTransactions Service.
The CosTransactions Service is started.
$
  

Let's note that this script automatically launches a CosTransactions Service process and stores its IOR and PID into the OpenCCM Configuration Repository, e.g.:

$ ls $OpenCCM_CONFIG_DIR
. . . TransactionService.IOR TransactionService.PID
$
  

Warning: Only one CosTransactions Service can be started for an OpenCCM Configuration Repository, e.g.:

$ ots_start
Error: The CosTransactions Service is already started!
$
  

See the ots_stop script to stop the started CosTransactions Service.

Setting the CosTransactions Service to use

In a distributed configuration, you could want to use a CosTransactions Service already started on another remote node instead of starting the CosTransactions Service on the local node. Then the ots_set script allows you to set locally the IOR or the URL to the remote CosTransactions Service to use, e.g.:

$ ots_set
usage: ots_set [IOR | URL]
$
$ ots_set IOR:...
The CosTransactions Service is set.
$
$ ots_set http://host.domain:port/file
The CosTransactions Service is set.
$
  

If the CosTransactions Service to use is started on a node where the OpenCCM Comanche Server is also started, then you could set the CosTransactions Service to use as following:

$ ots_set http://host.domain:8080/TransactionService.IOR
The CosTransactions Service is set.
$
  

Where host.domain refers to the node where the OpenCCM Comanche server is started.

Warning: The ots_set script does not control the correctness of the IOR or URL given as parameter, it just copies it into the local $OpenCCM_CONFIG_DIR/TransactionService.IOR file.

Checking if the CosTransactions Service is started

The ots_started script checks if the CosTransactions Service is started or not, e.g.:

$ ots_stop
. . .
$ ots_started
Error: The CosTransactions Service is not started!
$
  

Let's note that this OpenCCM script is mainly used by other OpenCCM scripts when they need to check if the CosTransactions Service is started or not.

Obtaining the IOR of the running CosTransactions Service

The ots_ior displays the IOR of the running CosTransactions Service, e.g.:

$ ots_ior
IOR:000000000000003349444C3A6F6D672E6F72672F436F735472616E73616374696F6E732F5472
616E73616374696F6E466163746F72793A312E30000000000001000000000000005C000102000000
000F7072696D75732E6C69666C2E667200008FFA000000000014004F4F0185E873EC04010000504F
41FE28FB087600000001000000010000001C00000000000100200000000100010001000101090000
000100010100
$
  

Stopping the CosTransactions Service

The ots_stop script stops the previously started CosTransactions Service, e.g.:

$ ots_stop
The CosTransactions Service will be stopped.
The CosTransactions Service is stopped.
$
$ ots_stop
Error: The CosTransactions Service is not started!
$
  

Let's note that this script kills the CosTransactions Service process and removes its associated IOR and PID files from the OpenCCM Configuration Repository.


Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster | Last modified at 2005-07-07 02:04 PM