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

The OpenCCM Compilation Tool Chain

The OpenCCM Compilation Tool Chain is a set of tools for compiling CORBA Components specifications (i.e. OMG IDL 3.0, OMG PSDL, OMG CIDL, and XMI 1.1 UML 1.4 Profile for CORBA Components files) and for generating CORBA Components implementation artefacts (i.e. OMG IDL 2.x interfaces and local interfaces, container code, XML CCM descriptors).

The OpenCCM Compilation Tool Chain is composed of the following tools:

ToolDescription
ir3_startStarts the OpenCCM Interface Repository.
ir3_startedChecks if the OpenCCM Interface Repository is started.
ir3_stopStops the OpenCCM Interface Repository.
idl3_checkChecks OMG IDL 3.0 files.
ir3_feedFeeds OMG IDL 3.0 files into the OpenCCM Interface Repository.
xmi2irFeeds XMI 1.1 UML 1.4 documents into the OpenCCM Interface Repository.
ir3_destroyDestroys OpenCCM Interface Repository objects.
ir3_idl3Generates OMG IDL 3.0 files from the OpenCCM Interface Repository.
ir3_xmiGenerates XMI 1.1 UML documents from the OpenCCM Interface Repository.
ir3_idl2Generates equivalent OMG IDL 2.4 files from the OpenCCM Interface Repository.
ir3_javaGenerates Java container code from the OpenCCM Interface Repository.
ir3_jimplGenerates Java component business implementation skeletons from the OpenCCM Interface Repository.
cidl_cifCompiles OMG CIDL files and generates associated OMG IDL and Java component executor skeleton files.
cidlCompiles specifications and regenerates the OMG CIDL part only.
cif_jimplGenerates Java business component implementation skeletons from OMG CIDL.
psdl_javaCompiles OMG PSDL files and generates associated Java mapping implementations.
psdlCompiles specifications and regenerates the OMG PSDL part only.

In the following sections, all OpenCCM Compilation 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.

The OpenCCM Interface Repository

The OpenCCM Interface Repository is the central part of the OpenCCM Compilation Tool Chain. This permanent repository is composed of CORBA objects storing CORBA Components specifications and making them accessible at runtime. The OMG IDL interfaces of the OpenCCM Interface Repository are fully conform to the interfaces defined in the CORBA 3.0 Core Specification.

Then the following OpenCCM compilers feed CORBA Components specifications into the OpenCCM Interface Repository and the following OpenCCM generators obtain specifications from the OpenCCM Interface Repository.

Let's note that before using any OpenCCM Compilation Tool Chain tools, it is required to start the OpenCCM Interface Repository with the ir3_start script.

Warning: To use any of the OpenCCM generation tools, it is required to feed the OpenCCM Interface Repository with OMG IDL 3.0 files or XMI 1.1 UML 1.4 docuuments.

Starting the OpenCCM Interface Repository

The ir3_start script starts the OpenCCM Interface Repository, e.g.:

$ ir3_start
The OpenCCM Interface Repository will be started.
Creating the $OpenCCM_CONFIG_DIR directory.
Launching the OpenCCM Interface Repository.
Feeding the OpenCCM Interface Repository with the IFR_3_0.idl file.
. . .
Feeding the OpenCCM Interface Repository with the Components.idl file.
. . .
The OpenCCM Interface Repository is started.
$

Let's note that this script automatically creates the $OpenCCM_CONFIG_DIR directory if it does not exist, launches the OpenCCM Interface Repository process, and feeds it with the IFR_3_0.idl and Components.idl specifications.

Moreover, the IOR, PID, and standard output of the started OpenCCM Interface Repository are stored into the OpenCCM Configuration Repository, e.g.:

$ ls $OpenCCM_CONFIG_DIR
IR3.IOR IR3.PID IR3.output IR3.start
$

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

$ ir3_start
Error: The OpenCCM Interface Repository is already started!
$

By default, the OpenCCM Interface Repository automatically computes the OMG IDL 2.x mapping for component and home definitions. The --no-mappings option allows you to disable this default behaviour, e.g.:

$ ir3_start --no-mappings
. . .
$

Warning: Don't disable the OMG IDL 2.x mapping computation if you will use OpenCCM generators.

See the ir3_stop script to stop the started OpenCCM Interface Repository.

Checking if the OpenCCM Interface Repository is started

The ir3_started script checks if the OpenCCM Interface Repository is started, e.g.:

$ ir3_stop
. . .
$ ir3_started
Error: The OpenCCM Interface Repository is not started!
$

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

Stopping the OpenCCM Interface Repository

The ir3_stop script stops the previously started OpenCCM Interface Repository, e.g.:

$ ir3_start
. . .
$ ir3_stop
The OpenCCM Interface Repository will be stopped.
Removing the $OpenCCM_CONFIG_DIR directory.
The OpenCCM Interface Repository is stopped.
$

Let's note that this script shutdowns the OpenCCM Interface Repository process, removes its associated IOR, PID, and standard output files, and removes the $OpenCCM_CONFIG_DIR directory.

Checking OMG IDL 3.0 files

The idl3_check script checks if the specified OMG IDL 3.0 file is conform to OMG IDL 3.0 grammar and semantics rules, e.g.:

$ cat test/sample.idl3
// This file is the OMG IDL 3.0 example used in the OpenCCM User's Guide.
#pragma prefix "ccm.objectweb.org"
module sample
{
  component MyComponent {};
  home MyHome manages MyComponent {};
};
$
$ idl3_check test/sample.idl3
idl3_check 0.8.2: Reading from file test/sample.idl3...
idl3_check 0.8.2: Preprocessing file test/sample.idl3...
idl3_check 0.8.2: File test/sample.idl3 preprocessed.
idl3_check 0.8.2: Compiling test/sample.idl3 file...
idl3_check 0.8.2: Compilation completed: 0 warning.
$

The idl3_check script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
--cpp pathSet the path to the external C preprocessor used.
-PInhibit generation of #-lines with line-number information.
-DNAME or
-DNAME=DEF
Define NAME as DEF, default is 1.
-UNAMERemove any definition for NAME.
-IDIRPut DIR in the include file search path.

To obtain usage and help information, do:

$ idl3_check --help
Usage: idl3_check [-h|--help] [--version] [--silent]
                  [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR]
                  omg_idl_file

Options:
  -h, --help         Display this information and exit
  --version          Output version information and exit
  --silent           Silent output messages
  --cpp path         Set the path to the external C preprocessor used
  -P                 Inhibit generation of #-lines with line-number information
  -DNAME, -DNAME=DEF Define NAME as DEF, default is 1
  -UNAME             Remove any definition for NAME
  -IDIR              Put DIR in the include file search path

Description:
  Compile and check an OMG IDL file

$

To obtain version information, do:

$ idl3_check --version
OpenCCM idl3_check 0.8.2

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

By default, the idl3_check script displays messages. To silent these output messages, do:

$ idl3_check --silent test/sample.idl3
$

By default, the idl3_check script uses an internal preprocessor written in Java. However, it is possible to use any external C/C++ preprocessor, e.g.:

$ idl3_check --cpp /usr/bin/cpp test/sample.idl3
. . .
$

Let's note that the standard -P, -D, -U and -I options for the C/C++ preprocessor could be passed as arguments to idl3_check before the file name, e.g.:

$ idl3_check -DFOO -Itest test/sample.idl3
. . .
$

When some preprocessing options are often used, e.g. -IAnIncludeDir, -DTheMacro, then they could be set by default in the xml/launcher/IDL3Check.xml file if they are specific to the idl3_check script or in the xml/launcher/Compiler.xml file if they are required by all OpenCCM compilation scripts.

By default, the __OMG_IDL_3__ macro is defined by the OpenCCM OMG IDL/PSDL/CIDL compiler. This macro could be used to distinguish if used OMG IDL modules should be imported from the OpenCCM Interface Repository or if their associated files should be included, e.g.

// An OMG IDL file.

#ifdef __OMG_IDL_3__

// This file is compiled by an OMG IDL 3.x compliant compiler.

import CORBA;

#else

// This file is compiled by a non OMG IDL 3.x compliant compiler.

#include <CORBA.idl>

#endif

// ...

Feeding OMG IDL 3.0 files into the OpenCCM Interface Repository

The ir3_feed script allows you to compile a specified OMG IDL 3.0 file and to feed it into the OpenCCM Interface Repository, e.g.:

$ ir3_feed test/sample.idl3
ir3_feed 0.8.2: Reading from file test/sample.idl3...
ir3_feed 0.8.2: Preprocessing file test/sample.idl3...
ir3_feed 0.8.2: File test/sample.idl3 preprocessed.
ir3_feed 0.8.2: Compiling test/sample.idl3 file...
ir3_feed 0.8.2: Compilation completed: 0 warning.
$

Warning: OMG IDL files must be fed into the OpenCCM Interface Repository only once!!!

The ir3_feed script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
--cpp pathSet the path to the external C preprocessor used.
-PInhibit generation of #-lines with line-number information.
-DNAME or
-DNAME=DEF
Define NAME as DEF, default is 1.
-UNAMERemove any definition for NAME.
-IDIRPut DIR in the include file search path.

To obtain usage and help information, do:

$ ir3_feed --help
Usage: ir3_feed [-h|--help] [--version] [--silent]
                [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR]
                omg_idl_files

Options:
  -h, --help         Display this information and exit
  --version          Output version information and exit
  --silent           Silent output messages
  --cpp path         Set the path to the external C preprocessor used
  -P                 Inhibit generation of #-lines with line-number information
  -DNAME, -DNAME=DEF Define NAME as DEF, default is 1
  -UNAME             Remove any definition for NAME
  -IDIR              Put DIR in the include file search path

Description:
  Feed the OpenCCM Interface Repository with OMG IDL files

$

To obtain version information, do:

$ ir3_feed --version
OpenCCM ir3_feed 0.8.2

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

By default, the ir3_feed script displays messages. To silent these output messages, do:

$ ir3_feed --silent test/sample.idl3
$

By default, the ir3_feed script uses an internal preprocessor written in Java. However, it is possible to use any external C/C++ preprocessor, e.g.:

$ ir3_feed --cpp /usr/bin/cpp test/sample.idl3
. . .
$

Let's note that the standard -P, -D, -U and -I options for the C/C++ preprocessor could be passed as arguments to ir3_feed before the file name, e.g.:

$ ir3_feed -DFOO -Itest test/sample.idl3
. . .
$

When some preprocessing options are often used, e.g. -IAnIncludeDir, -DTheMacro, then they could be set by default in the xml/launcher/IR3Feed.xml file if they are specific to the ir3_feed script or in the xml/launcher/Compiler.xml file if they are required by all OpenCCM compilation scripts.

By default, the __OMG_IDL_3__ macro is defined by the OpenCCM OMG IDL/PSDL/CIDL compiler. This macro could be used to distinguish if used OMG IDL modules should be imported from the OpenCCM Interface Repository or if their associated files should be included, e.g.

// An OMG IDL file.

#ifdef __OMG_IDL_3__

// This file is compiled by an OMG IDL 3.x compliant compiler.

import CORBA;

#else

// This file is compiled by a non OMG IDL 3.x compliant compiler.

#include <CORBA.idl>

#endif

// ...

Feeding XMI 1.1 UML 1.4 documents into the OpenCCM Interface Repository

The xmi2ir script allows you to parse a specified XMI 1.1 UML 1.4 document and to feed it into the OpenCCM Interface Repository.

These XMI 1.1 UML 1.4 documents must respect the OMG XMI 1.1 (see OMG TC Document formal/00-11-02) and the OMG UML 1.4 (see OMG TC Document formal/01-09-67) specifications. The elements of the UML model must be stereotyped with the stereotypes defined in the UML Profile for CORBA (OMG TC Document formal/02-04-01) and CORBA Components (OMG TC Document mars/03-07-01) specifications.

These XMI 1.1 UML 1.4 documents can be written with any text editor, but it can be generated by a UML tool, e.g.:

  • from Rational Rose or Softeam Objecteering, with an XMI Export plug-in
  • from Poseidon, with the XMI file contained in the ZIP archive saved by the tool (.zargo or .zuml)
  • from Eclipse-Omondo, with the XMI file saved as <project>/.uml/uml.repository

For example, the corresponding UML diagram of the sample.idl3 file (described above) can be represented by the following schema:

The UML Class Diagram

Next, the XMI 1.1 UML 1.4 documents can be generated by the UML tools to parse them and to feed them into the OpenCCM Interface Repository with the xmi2ir command, e.g.:

$ cat test/sample.xmi
. . .
$
$ xmi2ir test/sample.xmi
. . .
xmi2ir 0.8: Reading from test/sample.xmi...
xmi2ir 0.8: Checking if the UML model is correct...
xmi2ir 0.8: The UML model is correct.
xmi2ir 0.8: Feeding the UML model into the OpenCCM Interface Repository...
xmi2ir 0.8: The UML model is fed into the OpenCCM Interface Repository.
$

Warning: XMI 1.1 UML 1.4 documents must be fed into the OpenCCM Interface Repository only once!!!

The xmi2ir script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.

To obtain usage and help information, do:

$ xmi2ir --help
Usage: xmi2ir [-h|--help] [--version] [--silent] xmi_uml_document

Options:
  -h, --help         Display this information and exit
  --version          Output version information and exit
  --silent           Silent output messages

Description:
  Feed the OpenCCM Interface Repository with an XMI 1.1 UML 1.4 document

$

To obtain version information, do:

$ xmi2ir --version
OpenCCM xmi2ir 0.8.2

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

By default, the xmi2ir script displays messages. To silent these output messages, do:

$ xmi2ir --silent test/sample.xmi
$

Destroying OpenCCM Interface Repository objects

The ir3_destroy script allows you to destroy a specified object from the OpenCCM Interface Repository.

Destroying an object from the OpenCCM Interface Repository requires to provide its full OMG IDL scope name, e.g.:

$ ir3_destroy ::sample
ir3_destroy 0.8.2: ::sample destroyed successfully.
$

If the object to destroy does not exist in the OpenCCM Interface Repository, then an error is reported, e.g.:

$ ir3_destroy ::sample
ir3_destroy 0.8.2: ::sample not found in the OpenCCM Interface Repository!
$

If the object is referenced by other OpenCCM Interface Repository objects, then it could not be destroyed until other objects are destroyed, e.g.:

$ ir3_feed test/sample.idl3
. . .
$ ir3_destroy sample::MyComponent
ir3_destroy 0.8.2: sample::MyComponent not destroyed because dependency exits
in the OpenCCM Interface Repository preventing destruction!

$ ir3_destroy sample::MyHome
ir3_destroy 0.8.2: sample::MyHome destroyed successfully.

$ ir3_destroy sample::MyComponent
ir3_destroy 0.8.2: sample::MyComponent destroyed successfully.
$

The ir3_destroy script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.

To obtain usage and help information, do:

$ ir3_destroy --help
Usage: ir3_destroy [-h|--help] [--version] [--silent] omg_idl_scoped_name

Options:
  -h, --help Display this information and exit
  --version  Output version information and exit
  --silent   Silent output messages

Description:
  Destroy an object from the OpenCCM Interface Repository

$

To obtain version information, do:

$ ir3_destroy --version
OpenCCM ir3_destroy 0.8.2

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

By default, the ir3_destroy script displays messages. To silent these output messages, do:

$ ir3_feed test/sample.idl3
. . .
$ ir3_destroy --silent sample
$

Generating OMG IDL 3.0 files from the OpenCCM Interface Repository

The ir3_idl3 script allows you to generate the OMG IDL 3.0 definition associated to an OpenCCM Interface Repository object and its children objects, e.g.:

$ ir3_idl3 sample
ir3_idl3 0.8.2: Generating OMG IDL 3.0 for sample...
ir3_idl3 0.8.2: OMG IDL 3.0 generated in generated.idl3.
$

By default, the ir3_idl3 script generates the generated.idl3 file.

$ cat generated.idl3
. . .
#ifndef __SAMPLE__
#define __SAMPLE__

#pragma prefix "ccm.objectweb.org"
module sample
{
    component MyComponent;

    component MyComponent
    {
    };
    home MyHome
         manages ::sample::MyComponent
    {
    };

};

#endif
$

The ir3_idl3 script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
-o outputfileSet the output file name, default is generated.idl3.
-i ir_objectAdd import ir_object statement.

To obtain usage and help information, do:

$ ir3_idl3 --help
Usage: ir3_idl3 [-h|--help] [--version] [--silent]
                [-o outputfile] [-i ir_object] declaration

Options:
  -h, --help    Display this information and exit
  --version     Output version information and exit
  --silent      Silent output messages
  -o outputfile Set the output file name, default is generated.idl3
  -i ir_object  Add import ir_object statement

Description:
  Generate OMG IDL 3.0 for a declaration from the OpenCCM Interface Repository

$

To obtain version information, do:

$ ir3_idl3 --version
OpenCCM ir3_idl3 0.8.2

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

By default, the ir3_idl3 script displays messages. To silent these output messages, do:

$ ir3_idl3 --silent sample
$

By default, the ir3_idl3 script generates the OMG IDL 3.0 definition into the generated.idl3 file.
However, this script can produce the output into a file specified by the -o outputfile option, e.g.:

$ ir3_idl3 -o tmp.idl3 sample
ir3_idl3 0.8.2: Generating OMG IDL 3.0 for sample ...
ir3_idl3 0.8.2: OMG IDL 3.0 generated in tmp.idl3.
$
$ cat tmp.idl3
. . .
#ifndef __SAMPLE__
#define __SAMPLE__

#pragma prefix "ccm.objectweb.org"
module sample
{
    component MyComponent;

    component MyComponent
    {
    };
    home MyHome
         manages ::sample::MyComponent
    {
    };

};

#endif
$

Using the -i option produces an import statement at the begin of the generated OMG IDL 3.0 file, e.g.:

$ ir3_idl3 -i Components sample
. . .
$ cat generated.idl3
. . .
import Components;
. . .
$

Generating XMI 1.1 UML documents from the OpenCCM Interface Repository

The ir3_xmi script generates valid XMI 1.1 documents conform to the OMG XMI 1.1 UML DTD (see OMG TC Document ad/99-10-05.txt) available for download at the XMI 1.1 Specification section at the OMG website. This script conforms with the OMG UML Profile for CORBA Specification (see OMG TC Document formal/02-04-01) even when dealing with CORBA Components declarations. This may change in a future release when the UML Profile for CORBA Components Specification will be published.

The ir3_xmi script allows you to generate the OMG XMI 1.1 UML document associated to an OpenCCM Interface Repository object and its children objects, e.g.:

$ ir3_xmi sample
<?xml version="1.0" encoding="UTF-8"?>
. . .
<!DOCTYPE XMI SYSTEM "xmi.dtd">
<XMI xmi.version="1.1" xmlns:UML="org.omg/UML1.3">
    <XMI.header>
        <XMI.documentation>
            <XMI.exporter>OpenCCM XMI generator</XMI.exporter>
        </XMI.documentation>
    </XMI.header>
    <XMI.content>
    . . .
    </XMI.content>
</XMI>
$

By default, the ir3_xmi script generates the OMG XMI 1.1 UML document to the standard output.
However, this script can produce the output into a file specified by the -o filename option, e.g.:

$ ir3_xmi -o tmp.xml sample
$
$ cat tmp.xml
<?xml version="1.0" encoding="UTF-8"?>
. . .
<!DOCTYPE XMI SYSTEM "xmi.dtd">
<XMI xmi.version="1.1" xmlns:UML="org.omg/UML1.3">
    <XMI.header>
        <XMI.documentation>
            <XMI.exporter>OpenCCM XMI generator</XMI.exporter>
        </XMI.documentation>
    </XMI.header>
    <XMI.content>
    . . .
    </XMI.content>
</XMI>
$

The generated OMG XMI 1.1 UML document will always declare the XMI 1.1 UML DTD it refers to. If none has been specified from the command line, the XMI 1.1 document will assume that the XMI 1.1 DTD is stored in the same directory as itself and named xmi.dtd.

Using the -dtd xmi_dtd option allows you to set the full path location of the XMI UML DTD file, e.g.:

$ ir3_xmi -dtd UML.dtd sample
<?xml version="1.0" encoding="UTF-8"?>
. . .
<!DOCTYPE XMI SYSTEM "UML.dtd">
. . .
$

Setting the correct location of the XMI 1.1 UML DTD is only required when the user wants to validate generated XMI 1.1 UML documents.

Currently, the XMI 1.1 UML DTD is located in the src/dtd/xmi/XMI_1_1_UML.dtd file.

Generating equivalent OMG IDL 2.4 mapping from the OpenCCM Interface Repository

The ir3_idl2 script allows you to generate the equivalent OMG IDL 2.4 CCM mapping associated to an OpenCCM Interface Repository object and its children objects, e.g.:

$ ir3_idl2 sample
ir3_idl2 0.8.2: Generating OMG IDL2 for sample...
ir3_idl2 0.8.2: OMG IDL2 generated in generated.idl and generated_local.idl.
$

The generated.idl file contains the remote OMG IDL 2.4 interfaces allowing clients to interact with components and homes.

$ cat generated.idl
. . .

#ifndef __SAMPLE__
#define __SAMPLE__
#include <Components.idl>

#pragma prefix "ccm.objectweb.org"
module sample
{
    interface MyComponent;
    interface MyHomeExplicit;
    interface MyHomeImplicit;
    interface MyHome;

    interface MyComponent
                  : ::Components::CCMObject
    {
    };
    interface MyHomeExplicit
                  : ::Components::CCMHome
    {
    };
    interface MyHomeImplicit
                  : ::Components::KeylessCCMHome
    {
        ::sample::MyComponent create()
           raises(::Components::CreateFailure);
    };
    interface MyHome
                  : ::sample::MyHomeExplicit,
                    ::sample::MyHomeImplicit
    {
    };

};

#endif
$

The generated_local.idl file contains the local OMG IDL 2.4 interfaces allowing developers to implement components and homes.

$ cat generated_local.idl
. . .
#ifndef __SAMPLE__LOCAL
#define __SAMPLE__LOCAL
#include "generated.idl"

#pragma prefix "ccm.objectweb.org"
module sample
{
    local interface CCM_MyComponent_Executor;
    local interface CCM_MyComponent;
    local interface CCM_MyComponent_Context;
    local interface CCM_MyHomeExplicit;
    local interface CCM_MyHomeImplicit;
    local interface CCM_MyHome;

    local interface CCM_MyComponent_Executor
                  : ::Components::EnterpriseComponent
    {
    };
    local interface CCM_MyComponent
                  : ::sample::CCM_MyComponent_Executor
    {
    };
    local interface CCM_MyComponent_Context
                  : ::Components::CCMContext
    {
    };
    local interface CCM_MyHomeExplicit
                  : ::Components::HomeExecutorBase
    {
    };
    local interface CCM_MyHomeImplicit
    {
        ::Components::EnterpriseComponent create()
           raises(::Components::CCMException);
    };
    local interface CCM_MyHome
                  : ::sample::CCM_MyHomeExplicit,
                    ::sample::CCM_MyHomeImplicit
    {
    };
};

#endif
$

See the CORBA Component Model Specification for more information about the equivalent OMG IDL 2.4 mapping.

The ir3_idl2 script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
-o outputfileSet the output file name, default is generated.idl.
-i fileAdd a #include <file> statement.
-ipath fileAdd a #include "file" statement where file must be the complete file path.

To obtain usage and help information, do:

$ ir3_idl2 --help
Usage: ir3_idl2 [-h|--help] [--version] [--silent]
                [-o outputfile] [-i file] [-ipath file] declaration

Options:
  -h, --help    Display this information and exit
  --version     Output version information and exit
  --silent      Silent output messages
  -o outputfile Set the output file name, default is generated.idl
  -i file       Add a #include <file> statement
  -ipath file   Add a #include "file" statement where
                file must be the complete file path

Description:
  Generate OMG IDL2 for a declaration from the OpenCCM Interface Repository

$

To obtain version information, do:

$ ir3_idl2 --version
OpenCCM ir3_idl2 0.8.2

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

By default, the ir3_idl2 script displays messages. To silent these output messages, do:

$ ir3_idl2 --silent sample
$

By default, the ir3_idl2 script generates the OMG IDL 2.4 CCM mapping into the generated.idl and generated_local.idl files. However, this script can produce the output into files specified by the -o outputfile option, e.g.:

$ ir3_idl2 -o tmp.idl sample
ir3_idl2 0.8.2: Generating OMG IDL2 for sample...
ir3_idl2 0.8.2: OMG IDL2 generated in tmp.idl and tmp_local.idl.
$ cat tmp.idl tmp_local.idl
. . .
$

Using the -i flag produces an #include statement at the begin of the generated OMG IDL 2.4 file, e.g.:

$ ir3_idl2 -i file1.idl sample
. . .
$ cat generated.idl
. . .
#include <file1.idl>
. . .
$

Using the -ipath flag produces a user #include statement at the begin of the generated OMG IDL 2.4 file, e.g.:

$ ir3_idl2 -ipath file2.idl sample
. . .
$ cat generated.idl
. . .
#include "file2.idl"
. . .
$

Generating Java container code from the OpenCCM Interface Repository

The ir3_java script allows you to generate the Java container code associated to an OpenCCM Interface Repository object and its children objects, e.g.:

$ ir3_java ::sample
File '.../MyComponentCCM.java' has been generated
File '.../MyComponentSkeletonInterceptor.java' has been generated
File '.../MyComponentStubInterceptor.java' has been generated
File '.../MyComponentMonolithicWrapper.java' has been generated
File '.../MyHomeCCM.java' has been generated
File '.../MyHomeSkeletonInterceptor.java' has been generated
File '.../MyHomeStubInterceptor.java' has been generated
idl_to_mi 0.8.2: Generating MetaInformation implementations for sample...
File '.../MyHome_homeMI.java' has been generated
File '.../MyHome_interfaceMI.java' has been generated
File '.../MyComponent_componentMI.java' has been generated
idl_to_mi 0.8.2: MetaInformation for sample generated.
$

The Java container code is generated in a directory associated to the generated Java package, e.g.:

$ ls org/objectweb/ccm/sample
MyComponentCCM.java                  MyHomeCCM.java
MyComponent_componentMI.java         MyHome_homeMI.java
MyComponentMonolithicWrapper.java    MyHome_interfaceMI.java
MyComponentSkeletonInterceptor.java  MyHomeSkeletonInterceptor.java
MyComponentStubInterceptor.java      MyHomeStubInterceptor.java
$

See Generation and implementation rules for more information.

Generating Java component business implementation skeletons from the OpenCCM Interface Repository

The ir3_jimpl script allows you to generate Java component business implementation skeletons associated to an OpenCCM Interface Repository object and its children objects, e.g.:

$ ir3_jimpl ::sample
File 'org/objectweb/ccm/sample/MyComponentMonolithicImpl.java' has been generated
File 'org/objectweb/ccm/sample/MyHomeImpl.java' has been generated
$

The Java container code is generated in a directory associated to the generated Java package, e.g.:

$ ls org/objectweb/ccm/sample
MyComponentMonolithicImpl.java MyHomeImpl.java
$

These generated files could be used as starting point to implement components and homes, i.e. writting their functional part.

See Generation and implementation rules for more information.

Compiling OMG CIDL files and generating associated OMG IDL and Java files

The cidl_cif script allows you to compile an OMG CIDL file and generate:

  • local OMG IDL interfaces mapping for OMG CIDL definitions
  • Java component and home executor skeletons implementing previous interfaces
  • Java class dependencies files for each CIDL composition
$ cat test/sample.cidl
// This file is the OMG CIDL example used in the OpenCCM User's Guide.
#pragma prefix "ccm.objectweb.org"
module sample
{
   composition session SampleSessionComposition
   {
       home executor HomeImpl
       {
           implements MyHome;
           manages ComponentImpl;
       };
   };
};
$
$ cidl_cif test/sample.cidl
cidl_cif 0.8.2: Reading from file test/sample.cidl...
cidl_cif 0.8.2: Preprocessing file test/sample.cidl...
cidl_cif 0.8.2: File test/sample.cidl preprocessed.
cidl_cif 0.8.2: Compiling test/sample.cidl file...
cidl_cif 0.8.2: Compilation completed: 0 warning.
cidl_cif 0.8.2: Generating CIF mapping from test/sample.cidl...
cidl_cif 0.8.2: OMG IDL mapping generated in generated_cif.idl.
cidl_cif 0.8.2: Generating CIF implementations...
File '.../generated/.../HomeImpl.java' has been generated
File '.../generated/.../ComponentImpl.java' has been generated
cidl_cif 0.8.2: CIF implementations generated.
cidl_cif 0.8.2: Generating CIDL dependencies...
File '.../dependencies/SampleSessionComposition.dep' has been generated
cidl_cif 0.8.2: CIDL dependencies generated.
$

The generated_cif.idl file contains the local OMG IDL 2.4 interfaces mapping OMG CIDL definitions.

$ cat generated_cif.idl
. . .
#ifndef __FILE_generated_cif_idl__
#define __FILE_generated_cif_idl__


#pragma prefix "ccm.objectweb.org"
module sample
{
    module SampleSessionComposition
    {
        local interface CIF_HomeImpl;
        local interface CIF_SegmentBase;
        local interface CIF_ComponentImpl;

        local interface CIF_HomeImpl
                      : ::sample::CCM_MyHome
        {
        };
        local interface CIF_SegmentBase
        {
            ::sample::CCM_MyComponent_Context get_context();
            ::sample::SampleSessionComposition::CIF_ComponentImpl get_main_segment();
        };
        local interface CIF_ComponentImpl
                      : ::sample::SampleSessionComposition::CIF_SegmentBase,
                        ::Components::ExecutorLocator,
                        ::Components::SessionComponent,
                        ::sample::CCM_MyComponent_Executor
        {
        };

    };

};

#endif
$

The generated OMG IDL interfaces are implemented by the generated HomeImpl and ComponentImpl Java classes.

$ ls generated/org/objectweb/ccm/sample/SampleSessionComposition/
ComponentImpl.java HomeImpl.java
$

These generated classes are the home and component executor skeletons which must be inherited by the business implementation classes.

The SampleSessionComposition.dep file contains all classes to run this compostion except user implementation classes.

$ cat dependencies/SampleSessionComposition.dep
# ==================================================================
# Package for Composition :
# ::sample::SampleSessionComposition
# ==================================================================

# ==================================================================
# Component ::sample::SampleSessionComposition::HomeImpl::ComponentImpl
# ==================================================================
org/objectweb/ccm/sample/CCM_MyComponent.class
org/objectweb/ccm/sample/CCM_MyComponentHelper.class
org/objectweb/ccm/sample/CCM_MyComponentHolder.class
org/objectweb/ccm/sample/CCM_MyComponentOperations.class
org/objectweb/ccm/sample/CCM_MyComponent_Context.class
org/objectweb/ccm/sample/CCM_MyComponent_ContextHelper.class
org/objectweb/ccm/sample/CCM_MyComponent_ContextHolder.class
org/objectweb/ccm/sample/CCM_MyComponent_ContextOperations.class
org/objectweb/ccm/sample/CCM_MyComponent_Executor.class
org/objectweb/ccm/sample/CCM_MyComponent_ExecutorHelper.class
org/objectweb/ccm/sample/CCM_MyComponent_ExecutorHolder.class
org/objectweb/ccm/sample/CCM_MyComponent_ExecutorOperations.class
org/objectweb/ccm/sample/MyComponent.class
org/objectweb/ccm/sample/MyComponentCCM.class
org/objectweb/ccm/sample/MyComponentHelper.class
org/objectweb/ccm/sample/MyComponentHolder.class
org/objectweb/ccm/sample/MyComponentMonolithicWrapper.class
org/objectweb/ccm/sample/MyComponentOperations.class
org/objectweb/ccm/sample/MyComponentPOA*.class
org/objectweb/ccm/sample/MyComponentPOATie.class
org/objectweb/ccm/sample/MyComponentSkeletonInterceptor.class
org/objectweb/ccm/sample/MyComponentStubInterceptor.class
org/objectweb/ccm/sample/MyComponent_componentMI.class
org/objectweb/ccm/sample/MyComponent_interfaceMI.class
org/objectweb/ccm/sample/SampleSessionComposition/CIF_ComponentImpl.class
org/objectweb/ccm/sample/SampleSessionComposition/CIF_ComponentImplHelper.class
org/objectweb/ccm/sample/SampleSessionComposition/CIF_ComponentImplHolder.class
org/objectweb/ccm/sample/SampleSessionComposition/CIF_ComponentImplOperations.class
org/objectweb/ccm/sample/SampleSessionComposition/CIF_SegmentBase.class
org/objectweb/ccm/sample/SampleSessionComposition/CIF_SegmentBaseHelper.class
org/objectweb/ccm/sample/SampleSessionComposition/CIF_SegmentBaseHolder.class
org/objectweb/ccm/sample/SampleSessionComposition/CIF_SegmentBaseOperations.class
org/objectweb/ccm/sample/SampleSessionComposition/ComponentImpl.class
org/objectweb/ccm/sample/_MyComponentStub.class
...
$

The cidl_cif script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
--cpp pathSet the path to the external C preprocessor used.
-PInhibit generation of #-lines with line-number information.
-DNAME or
-DNAME=DEF
Define NAME as DEF, default is 1.
-UNAMERemove any definition for NAME.
-IDIRPut DIR in the include file search path.
-o outputfileSet the output file name, default is generated_cif.idl.
-ipath fileAdd a #include "file" statement where file must be the complete file path.
-d outputdirGenerate Java implementations into directory outputdir, default is generated/.
-dep dependencies_dirGenerate CIDL class dependencies into directory dependencies_dir, default is dependencies/.
--noprefix aprefixCIDL class dependencies starting with aprefix will not be included.

To obtain usage and help information, do:

$ cidl_cif --help
Usage: cidl_cif [-h|--help] [--version] [--silent]
                [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR]
                [-o outputfile] [-ipath file] [-d outputdir]
                [-dep dependencies_dir] [--noprefix aprefix] file

Options:
  -h, --help            Display this information and exit
  --version             Output version information and exit
  --silent              Silent output messages
  --cpp path            Set the path to the external C preprocessor used
  -P                    Inhibit generation of #-lines with line-number information
  -DNAME, -DNAME=DEF    Define NAME as DEF, default is 1
  -UNAME                Remove any definition for NAME
  -IDIR                 Put DIR in the include file search path
  -o outputfile         Set the output file name, default is generated_cif.idl
  -ipath file           Add a #include "file" statement where
                        file must be the complete file path
  -d outputdir          Generate Java implementations into directory <outputdir>,
                        default is generated/
  -dep dependencies_dir Generate CIDL class dependencies into directory <dependencies_dir>,
                        default is dependencies/
  --noprefix aprefix    CIDL class dependencies starting with <aprefix>
                        will not be included.

Description:
  Compile an OMG CIDL file and generate its associated:
  - local CIF interfaces
  - Java component and home executor skeletons
  - class dependencies files

$

To obtain version information, do:

$ cidl_cif --version
OpenCCM cidl_cif 0.8.2

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

By default, the cidl_cif script displays messages. To silent these output messages, do:

$ cidl_cif --silent test/sample.cidl
$

By default, the cidl_cif script uses an internal preprocessor written in Java. However, it is possible to use any external C/C++ preprocessor, e.g.:

$ cidl_cif --cpp /usr/bin/cpp test/sample.cidl
. . .
$

Let's note that the standard -P, -D, -U and -I options for the C/C++ preprocessor could be passed as arguments to cidl_cif before the file name, e.g.:

$ cidl_cif -DFOO -Itest test/sample.cidl
. . .
$

When some preprocessing options are often used, e.g. -IAnIncludeDir, -DTheMacro, then they could be set by default in the xml/launcher/CIDLtoCIF.xml file if they are specific to the cidl_cif script or in the xml/launcher/Compiler.xml file if they are required by all OpenCCM compilation scripts.

By default, the __OMG_IDL_3__ macro is defined by the OpenCCM OMG IDL/PSDL/CIDL compiler. This macro could be used to distinguish if used OMG IDL modules should be imported from the OpenCCM Interface Repository or if their associated files should be included, e.g.

// An OMG CIDL file.

#ifdef __OMG_IDL_3__

// This file is compiled by an OMG IDL 3.x compliant compiler.

import CORBA;

#else

// This file is compiled by a non OMG IDL 3.x compliant compiler.

#include <CORBA.idl>

#endif

// ...

By default, the cidl_cif script generates the CIDL to OMG IDL mapping into the generated_cif.idl file. However, this script can produce the output into a file specified by the -o outputfile option, e.g.:

$ cidl_cif -o mapping.idl test/sample.cidl
. . .
$ cat mapping.idl
. . .
$

Using the -ipath flag produces a user #include statement at the begin of the generated OMG IDL 2.4 file, e.g.:

$ cidl_cif -ipath file.idl test/sample.cidl
. . .
$ cat generated_cif.idl
. . .
#include "file.idl"
. . .
$

By default, the cidl_cif script generates the Java component and home executor skeleton classes into the generated/ directory.
However, the -d outputdir option allows you to specify another directory, e.g.:

$ cidl_cif -d mapping test/sample.cidl
. . .
$ ls mapping/org/objectweb/ccm/sample/SampleSessionComposition/
ComponentImpl.java HomeImpl.java
$

By default, the cidl_cif script generates class files dependencies from OMG CIDL compositions into the dependencies/ directory.
However, the -dep dependencies_dir option allows you to specify another directory, e.g.:

$ cidl_cif -dep sample_dep test/sample.cidl
. . .
$ ls sample_dep/
SampleSessionComposition.dep
$

By default, the cidl_cif script generates all compositions class files dependencies.
You can restrict dependencies by adding the --noprefix aprefix option to remove class files whose name begins with aprefix, e.g.:

$ cidl_cif --noprefix org/objectweb/ccm/sample/SampleSessionComposition/ test/sample.cidl
. . .
$ cat SampleSessionComposition.dep
# ==================================================================
# Package for Composition :
# ::sample::SampleSessionComposition
# ==================================================================

# ==================================================================
# Component ::sample::SampleSessionComposition::HomeImpl::ComponentImpl
# ==================================================================
org/objectweb/ccm/sample/CCM_MyComponent.class
org/objectweb/ccm/sample/CCM_MyComponentHelper.class
org/objectweb/ccm/sample/CCM_MyComponentHolder.class
org/objectweb/ccm/sample/CCM_MyComponentOperations.class
org/objectweb/ccm/sample/CCM_MyComponent_Context.class
org/objectweb/ccm/sample/CCM_MyComponent_ContextHelper.class
org/objectweb/ccm/sample/CCM_MyComponent_ContextHolder.class
org/objectweb/ccm/sample/CCM_MyComponent_ContextOperations.class
org/objectweb/ccm/sample/CCM_MyComponent_Executor.class
org/objectweb/ccm/sample/CCM_MyComponent_ExecutorHelper.class
org/objectweb/ccm/sample/CCM_MyComponent_ExecutorHolder.class
org/objectweb/ccm/sample/CCM_MyComponent_ExecutorOperations.class
org/objectweb/ccm/sample/MyComponent.class
org/objectweb/ccm/sample/MyComponentCCM.class
org/objectweb/ccm/sample/MyComponentHelper.class
org/objectweb/ccm/sample/MyComponentHolder.class
org/objectweb/ccm/sample/MyComponentMonolithicWrapper.class
org/objectweb/ccm/sample/MyComponentOperations.class
org/objectweb/ccm/sample/MyComponentPOA*.class
org/objectweb/ccm/sample/MyComponentPOATie.class
org/objectweb/ccm/sample/MyComponentSkeletonInterceptor.class
org/objectweb/ccm/sample/MyComponentStubInterceptor.class
org/objectweb/ccm/sample/MyComponent_componentMI.class
org/objectweb/ccm/sample/MyComponent_interfaceMI.class
org/objectweb/ccm/sample/_MyComponentStub.class
...
$

Warning: The good way to generate CIF mapping is as following:

  1. ir3_feed <file.idl3>
  2. ir3_feed <file.psdl>
  3. ir3_feed <file.cidl>

OMG PSDL and CIDL files should have an import statement to access OMG IDL declarations fed into the OpenCCM Interface Repository.

Compiling specifications and regenerating the OMG CIDL part only

The cidl script allows you to compile a specification file and regenerate the OMG CIDL part only, e.g.:

$ cidl test/sample.cidl
cidl 0.8.2: Reading from file test/sample.cidl...
cidl 0.8.2: Preprocessing file test/sample.cidl...
cidl 0.8.2: File test/sample.cidl preprocessed.
cidl 0.8.2: Compiling test/sample.cidl file...
cidl 0.8.2: Compilation completed: 0 warning.
cidl 0.8.2: Generating CIDL from test/sample.cidl...
cidl 0.8.2: CIDL generated in generated.cidl.
$

By default, the cidl script regenerates the generated.cidl file.

$ cat generated.cidl
. . .
#pragma prefix "ccm.objectweb.org"
module sample
{

    composition session SampleSessionComposition
    {
        home executor HomeImpl
        {
            implements ::sample::MyHome;
            manages ComponentImpl;
        };
    };

};
$

The cidl script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
--cpp pathSet the path to the external C preprocessor used.
-PInhibit generation of #-lines with line-number information.
-DNAME or
-DNAME=DEF
Define NAME as DEF, default is 1.
-UNAMERemove any definition for NAME.
-IDIRPut DIR in the include file search path.
-o outputfileSet the output file name, default is generated.cidl.

To obtain usage and help information, do:

$ cidl --help
Usage: cidl [-h|--help] [--version] [--silent]
            [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR]
            [-o outputfile] file

Options:
  -h, --help         Display this information and exit
  --version          Output version information and exit
  --silent           Silent output messages
  --cpp path         Set the path to the external C preprocessor used
  -P                 Inhibit generation of #-lines with line-number information
  -DNAME, -DNAME=DEF Define NAME as DEF, default is 1
  -UNAME             Remove any definition for NAME
  -IDIR              Put DIR in the include file search path
  -o outputfile      Set the output file name, default is generated.cidl

Description:
  Compile a file and regenerate the OMG CIDL part only

$

To obtain version information, do:

$ cidl --version
OpenCCM cidl 0.8.2

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

By default, the cidl script displays messages. To silent these output messages, do:

$ cidl --silent test/sample.cidl
$

By default, the cidl script uses an internal preprocessor written in Java. However, it is possible to use any external C/C++ preprocessor, e.g.:

$ cidl --cpp /usr/bin/cpp test/sample.cidl
. . .
$

Let's note that the standard -P, -D, -U and -I options for the C/C++ preprocessor could be passed as arguments to cidl before the file name, e.g.:

$ cidl -DFOO -Itest test/sample.cidl
. . .
$

When some preprocessing options are often used, e.g. -IAnIncludeDir, -DTheMacro, then they could be set by default in the xml/launcher/CIDLtoCIDL.xml file if they are specific to the cidl script or in the xml/launcher/Compiler.xml file if they are required by all OpenCCM compilation scripts.

By default, the __OMG_IDL_3__ macro is defined by the OpenCCM OMG IDL/PSDL/CIDL compiler. This macro could be used to distinguish if used OMG IDL modules should be imported from the OpenCCM Interface Repository or if their associated files should be included, e.g.

// An OMG CIDL file.

#ifdef __OMG_IDL_3__

// This file is compiled by an OMG IDL 3.x compliant compiler.

import CORBA;

#else

// This file is compiled by a non OMG IDL 3.x compliant compiler.

#include <CORBA.idl>

#endif

// ...

By default, the cidl script regenerates the OMG CIDL file into the generated.cidl file. However, this script can produce the output into a file specified by the -o outputfile option, e.g.:

$ cidl -o tmp.cidl test/sample.cidl
. . .
$ cat tmp.cidl
. . .
$

Generating Java business component implementation skeletons from OMG CIDL

The cif_jimpl script allows you to generate Java business component implementation skeletons for an OMG CIDL file, e.g.:

$ cif_jimpl test/sample.cidl
cif_jimpl 0.8.2: Reading from file test/sample.cidl...
cif_jimpl 0.8.2: Preprocessing file test/sample.cidl...
cif_jimpl 0.8.2: File test/sample.cidl preprocessed.
cif_jimpl 0.8.2: Compiling test/sample.cidl file...
cif_jimpl 0.8.2: Compilation completed: 0 warning.
File '.../generated/.../MyHomeImpl.java' has been generated
File '.../generated/.../MyComponentImpl.java' has been generated
$

These generated files could be used as starting point to implement components and homes, i.e. writting their functional part.

$ ls generated/org/objectweb/ccm/sample/SampleSessionComposition/
MyComponentImpl.java  MyHomeImpl.java
$

The cif_jimpl script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
--cpp pathSet the path to the external C preprocessor used.
-PInhibit generation of #-lines with line-number information.
-DNAME or
-DNAME=DEF
Define NAME as DEF, default is 1.
-UNAMERemove any definition for NAME.
-IDIRPut DIR in the include file search path.
-d outputdirGenerate Java templates into directory outputdir, default is generated/.

To obtain usage and help information, do:

$ cif_jimpl --help
Usage: cif_jimpl [-h|--help] [--version] [--silent]
                 [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR]
                 [-d outputdir] file

Options:
  -h, --help         Display this information and exit
  --version          Output version information and exit
  --silent           Silent output messages
  --cpp path         Set the path to the external C preprocessor used
  -P                 Inhibit generation of #-lines with line-number information
  -DNAME, -DNAME=DEF Define NAME as DEF, default is 1
  -UNAME             Remove any definition for NAME
  -IDIR              Put DIR in the include file search path
  -d outputdir       Generate Java implementations templates into directory <outputdir>,
                     default is generated/

Description:
  Compile an OMG CIDL file and generate its associated Java implementation templates.
$

To obtain version information, do:

$ cif_jimpl --version
OpenCCM cif_jimpl 0.8.2

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

By default, the cif_jimpl script displays messages. To silent these output messages, do:

$ cif_jimpl --silent test/sample.cidl
$

By default, the cif_jimpl script uses an internal preprocessor written in Java. However, it is possible to use any external C/C++ preprocessor, e.g.:

$ cif_jimpl --cpp /usr/bin/cpp test/sample.cidl
. . .
$

Let's note that the standard -P, -D, -U and -I options for the C/C++ preprocessor could be passed as arguments to cif_jimpl before the file name, e.g.:

$ cif_jimpl -DFOO -Itest test/sample.cidl
. . .
$

When some preprocessing options are often used, e.g. -IAnIncludeDir, -DTheMacro, then they could be set by default in the xml/launcher/CIFtoJavaImpl.xml file if they are specific to the cif_jimpl script or in the xml/launcher/Compiler.xml file if they are required by all OpenCCM compilation scripts.

By default, the __OMG_IDL_3__ macro is defined by the OpenCCM OMG IDL/PSDL/CIDL compiler. This macro could be used to distinguish if used OMG IDL modules should be imported from the OpenCCM Interface Repository or if their associated files should be included, e.g.

// An OMG CIDL file.

#ifdef __OMG_IDL_3__

// This file is compiled by an OMG IDL 3.x compliant compiler.

import CORBA;

#else

// This file is compiled by a non OMG IDL 3.x compliant compiler.

#include <CORBA.idl>

#endif

// ...

By default, the cif_jimpl script generates the Java implementation templates into the generated/ directory.
However, the -d outputdir option allows you to specify another directory, e.g.:

$ cif_jimpl -d mapping test/sample.cidl
. . .
$ ls mapping/org/objectweb/ccm/sample/SampleSessionComposition/
MyComponentImpl.java  MyHomeImpl.java
$

Warning: The good way to generate CIF implemention templates is as following:

  1. ir3_feed <file.idl3>
  2. ir3_feed <file.psdl>
  3. ir3_feed <file.cidl>

OMG PSDL and CIDL files should have an import statement to access OMG IDL declarations fed into the OpenCCM Interface Repository.

Compiling OMG PSDL files and generating associated Java mapping implementations

The psdl_java script allows you to compile an OMG PSDL file and generate associated Java mapping implementations:

  • Java interfaces and classes
  • The JDO descriptor
$ cat test/sample.psdl
// This file is the OMG PSDL example used in the OpenCCM User's Guide.
#pragma prefix "ccm.objectweb.org"
module sample
{
  storagetype ST {};
  storagehome SH of ST {};
};
$
$ psdl_java test/sample.psdl
psdl_java 0.8.2: Reading from file test/sample.psdl...
psdl_java 0.8.2: Preprocessing file test/sample.psdl...
psdl_java 0.8.2: File test/sample.psdl preprocessed.
psdl_java 0.8.2: Compiling test/sample.psdl file...
psdl_java 0.8.2: Compilation completed: 0 warning.
psdl_java 0.8.2: Generating Java mapping from test/sample.psdl ...
File '.../generated/org/objectweb/ccm/sample/sample.jdo' has been generated
File '.../generated/org/objectweb/ccm/sample/ST.java' has been generated
File '.../generated/org/objectweb/ccm/sample/SH.java' has been generated
psdl_java 0.8.2: Java mapping generated.
$

The generated classes are the Java mapping associated to the OMG PSDL definitions. The .jdo file contains JDO information allowing a JDO enhancer to inject code related to persistence automatically.

$ ls generated/org/objectweb/ccm/sample/
sample.jdo  SH.java  ST.java
$

The psdl_java script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
--cpp pathSet the path to the external C preprocessor used.
-PInhibit generation of #-lines with line-number information.
-DNAME or
-DNAME=DEF
Define NAME as DEF, default is 1.
-UNAMERemove any definition for NAME.
-IDIRPut DIR in the include file search path.
-d outputdirGenerate Java mapping into directory outputdir, default is generated/.
-jdoprop jdo_properties_fileGet user classes definition from the properties file jdo_properties_file, default is jdouser.properties

To obtain usage and help information, do:

$ psdl_java --help
Usage: psdl_java [-h|--help] [--version] [--silent]
                 [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR]
                 [-d outputdir] file
                 [-jdoprop jdo_properties_file]

Options:
  -h, --help         Display this information and exit
  --version          Output version information and exit
  --silent           Silent output messages
  --cpp path         Set the path to the external C preprocessor used
  -P                 Inhibit generation of #-lines with line-number information
  -DNAME, -DNAME=DEF Define NAME as DEF, default is 1
  -UNAME             Remove any definition for NAME
  -IDIR              Put DIR in the include file search path
  -d outputdir       Generate Java mapping in directory <outputdir>,
                     default is generated/
  -jdoprop jdo_properties_file Get user classes definition from the properties file <jdo_properties_file>
                               default is "jdouser.properties"

Description:
  Compile an OMG PSDL file and generate its associated Java mapping

$

To obtain version information, do:

$ psdl_java --version
OpenCCM psdl_java 0.8.2

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

By default, the psdl_java script displays messages. To silent these output messages, do:

$ psdl_java --silent test/sample.psdl
$

By default, the psdl_java script uses an internal preprocessor written in Java. However, it is possible to use any external C/C++ preprocessor, e.g.:

$ psdl_java --cpp /usr/bin/cpp test/sample.psdl
. . .
$

Let's note that the standard -P, -D, -U and -I options for the C/C++ preprocessor could be passed as arguments to psdl_java before the file name, e.g.:

$ psdl_java -DFOO -Itest test/sample.psdl
. . .
$

When some preprocessing options are often used, e.g. -IAnIncludeDir, -DTheMacro, then they could be set by default in the xml/launcher/PSDLtoJava.xml file if they are specific to the psdl_java script or in the xml/launcher/Compiler.xml file if they are required by all OpenCCM compilation scripts.

By default, the __OMG_IDL_3__ macro is defined by the OpenCCM OMG IDL/PSDL/CIDL compiler. This macro could be used to distinguish if used OMG IDL modules should be imported from the OpenCCM Interface Repository or if their associated files should be included, e.g.

// An OMG PSDL file.

#ifdef __OMG_IDL_3__

// This file is compiled by an OMG IDL 3.x compliant compiler.

import CORBA;

#else

// This file is compiled by a non OMG IDL 3.x compliant compiler.

#include <CORBA.idl>

#endif

// ...

By default, the psdl_java script generates the Java mapping into the generated/ directory. However, the -d outputdir option allows you to specify another directory, e.g.:

$ psdl_java -d mapping test/sample.psdl
. . .
$ ls mapping/org/objectweb/ccm/sample/
sample.jdo  SH.java  ST.java
$

When user classes inherit from generated classes for OMG PSDL, this is required with JDO to enhance these user classes. The -jdoprop jdo_properties_file option allows you to specify which user classes must be enhanced. jdo_properties_file is the name of the properties file used to specify user classes inheritance. This file must define properties as following:

my_user_class = its_super_class 

This means that my_user_class inherits from its_super_class. If there are multiple inheritance levels, you must specify all classes that are not defined in the OMG PSDL file.

Then the psdl_java script can produce specific tags for JDO or generate a full JDO file if the user classes are in another packages.

Compiling specifications and regenerating the OMG PSDL part only

The psdl script allows you to compile a specification file and regenerate the OMG PSDL part only, e.g.:

$ psdl test/sample.psdl
psdl 0.8.2: Reading from file test/sample.psdl...
psdl 0.8.2: Preprocessing file test/sample.psdl...
psdl 0.8.2: File test/sample.psdl preprocessed.
psdl 0.8.2: Compiling test/sample.psdl file...
psdl 0.8.2: Compilation completed: 0 warning.
psdl 0.8.2: Generating PSDL from test/sample.psdl...
psdl 0.8.2: PSDL generated in generated.psdl.
$

By default, the psdl script regenerates the generated.psdl file.

$ cat generated.psdl
. . .
#pragma prefix "ccm.objectweb.org"
module sample
{
    storagetype ST;

    storagetype ST
    {
    };
    storagehome SH
                of ::sample::ST
    {
    };

};
$

The psdl script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
--cpp pathSet the path to the external C preprocessor used.
-PInhibit generation of #-lines with line-number information.
-DNAME or
-DNAME=DEF
Define NAME as DEF, default is 1.
-UNAMERemove any definition for NAME.
-IDIRPut DIR in the include file search path.
-o outputfileSet the output file name, default is generated.psdl.

To obtain usage and help information, do:

$ psdl --help
Usage: psdl [-h|--help] [--version] [--silent]
            [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR]
            [-o outputfile] file

Options:
  -h, --help         Display this information and exit
  --version          Output version information and exit
  --silent           Silent output messages
  --cpp path         Set the path to the external C preprocessor used
  -P                 Inhibit generation of #-lines with line-number information
  -DNAME, -DNAME=DEF Define NAME as DEF, default is 1
  -UNAME             Remove any definition for NAME
  -IDIR              Put DIR in the include file search path
  -o outputfile      Set the output file name, default is generated.psdl

Description:
  Compile a file and regenerate the OMG PSDL part only

$

To obtain version information, do:

$ psdl --version
OpenCCM psdl 0.8.2

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

By default, the psdl script displays messages. To silent these output messages, do:

$ psdl --silent test/sample.psdl
$

By default, the psdl script uses an internal preprocessor written in Java. However, it is possible to use any external C/C++ preprocessor, e.g.:

$ psdl --cpp /usr/bin/cpp test/sample.psdl
. . .
$

Let's note that the standard -P, -D, -U and -I options for the C/C++ preprocessor could be passed as arguments to psdl before the file name, e.g.:

$ psdl -DFOO -Itest test/sample.psdl
. . .
$

When some preprocessing options are often used, e.g. -IAnIncludeDir, -DTheMacro, then they could be set by default in the xml/launcher/PSDLtoPSDL.xml file if they are specific to the psdl script or in the xml/launcher/Compiler.xml file if they are required by all OpenCCM compilation scripts.

By default, the __OMG_IDL_3__ macro is defined by the OpenCCM OMG IDL/PSDL/CIDL compiler. This macro could be used to distinguish if used OMG IDL modules should be imported from the OpenCCM Interface Repository or if their associated files should be included, e.g.

// An OMG PSDL file.

#ifdef __OMG_IDL_3__

// This file is compiled by an OMG IDL 3.x compliant compiler.

import CORBA;

#else

// This file is compiled by a non OMG IDL 3.x compliant compiler.

#include <CORBA.idl>

#endif

// ...

By default, the psdl script regenerates the OMG PSDL file into the generated.psdl file. However, this script can produce the output into a file specified by the -o outputfile option, e.g.:

$ psdl -o tmp.psdl test/sample.psdl
. . .
$ cat tmp.psdl
. . .
$

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