OpenCCM - The UML Compilation Tool Chain

The UML OpenCCM Compilation Tool Chain

The UML OpenCCM Compilation Tool Chain is a set of tools for feeding the OpenCCM Platform from an XMI 1.1 UML 1.4 Profile for CORBA Components document and for generating OMG IDL 3.0, OMG CIDL and Java implementation files from the same XMI file.

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

ToolDescription
xmi2irFeeds XMI 1.1 UML 1.4 documents into the OpenCCM Interface Repository.
uml2ccmGenerates the OMG IDL 3.0, CIDL and the Java implementation (CIF or monolithic) from the XMI 1.1 UML 1.4 document.

In the following sections, all UML 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 XMI 1.1 UML 1.4 documents

These commands feeds the platform or generates differents files from an XMI document in parameter. This 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.

The 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) or with an XMI export feature (in last releases).
  • from Eclipse-Omondo, with the XMI file saved as <project>/.uml/uml.repository

If your UML tool is Poseidon, you can download the CORBA stereotypes and the CIF stereotypes : CORBAStereotypes.zuml, CIFStereotypes.zuml

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.

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

The UML Class Diagram

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

$ xmi2ir test/sample.xmi
. . .
xmi2ir 0.8.2: Reading from test/sample.xmi...
xmi2ir 0.8.2: Checking if the UML model is correct...
xmi2ir 0.8.2: The UML model is correct.
xmi2ir 0.8.2: Feeding the UML model into the OpenCCM Interface Repository...
xmi2ir 0.8.2: 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-2004 INRIA - USTL - LIFL - GOAL
. . .
$

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

$ xmi2ir --silent test/sample.xmi
$

Generating OMG IDL 3.0, CIDL and the Java implementation files from the XMI 1.1 UML 1.4 document

The uml2ccm script allows you to parse a specified XMI 1.1 UML 1.4 document and to generate the corresponding OMG IDL 3.0, CIDL and Java implementation files.
These implementation files can be the CIF or the monolithic version, depending on the --monolithic option of the command.

For example, the corresponding UML diagram of the Demo 1 can be represented by the following picture:

The Demo 1 Overview

Next, the implementation of the Client (CIF) can be represented by the following model. The implementation classes correspond to the classes which will be generated by the command. Theses classes contain all the features present in the generated classes (attributes, methods, ...). The content of the differents methods are contained in the modelisation, but not visible on the picture.

The Demo 1 Client Implementation

For the implementation of the Server, it's the same kind of UML representation.

The Demo 1 Server Implementation

All these pictures are extracted from a UML file, then we can execute the uml2ccm command with the corresponding XMI file in parameter. In this example, we work on the CIF implementation (no --monolithic option).

$ uml2ccm demo1-cif.xmi -d out
uml2ccm 0.8.1: Generating the Java implementation files...
uml2ccm 0.8.1: Transformation of the Home ClientHomeImpl ...
uml2ccm 0.8.1: Transformation of the Component ClientImpl ...
uml2ccm 0.8.1: Transformation of the Home ServerHomeImpl ...
uml2ccm 0.8.1: Transformation of the Component ServerImpl ...
uml2ccm 0.8.1: Generating the OMG IDL 3.0 and OMG CIDL files...
uml2ccm 0.8.1: Generating OMG IDL 3.0 file outDemo1Mono/demo1.idl3 ...
uml2ccm 0.8.1: Generating OMG CIDL file outDemo1Mono/demo1.cidl ...
uml2ccm 0.8.1: The OMG IDL 3.0, OMG CIDL and Java implementation files are generated.

$

Now, the generated OMG IDL 3.0 and OMG CIDL files are conform to the UML representation:

$ cat out/demo1.idl3
. . .
#ifndef __DEMO1__
#define __DEMO1__

#pragma prefix "ccm.objectweb.org"
module demo1
{
    interface Display;
    component Client;
    component Server;
    
    interface Display
    {
        void print(in string text);
    };
    component Client 
    {
        attribute string the_name;
        uses ::demo1::Display to_server;
    };
    home ClientHome 
         manages ::demo1::Client
    {
    };
    component Server 
    {
        attribute string the_name;
        provides ::demo1::Display for_clients;
    };
    home ServerHome 
         manages ::demo1::Server
    {
    };
    
};

#endif

$
$ cat out/demo1.cidl
. . .
#ifndef __DEMO1__
#define __DEMO1__

#pragma prefix "ccm.objectweb.org"
module demo1
{
    composition session ClientSessionComposition
    {
        home executor HomeImpl
        {
            implements ::demo1::ClientHome;
            manages ComponentImpl;
        };
    };
    composition session ServerSessionComposition
    {
        home executor HomeImpl
        {
            implements ::demo1::ServerHome;
            manages ComponentImpl;
        };
    };
    
};

#endif

$

So, thanks to the uml2ccm command, all the Java implementation files and the OMG IDL 3.0 and OMG CIDL files are generated. To run the demo, it only remains to write the main class which launches the differents components.
In the monolithic mode, the generated Java implementation files are completed with the mandatories methods (if they are not present in the UML representation), like the ccm_activate, ccm_passivate, ccm_remove, set_session_context methods.

This generation are based on the MDA approach. This command runs MDA transformations from the UML representation to the Java implementation and to the OMG IDL 3.0 and OMG CIDL langage. So, this feature is an example that the MDA approach can be used to create an application.

The uml2ccm script supports the following options:

OptionDescription
-h or
--help
Display usage and help information, and exit.
--versionOutput version information and exit.
--silentSilent output messages.
--monolithicGenerate the monolithic version of the Java implementation (CIF Implementation by default).
-d directory or
--outputdir directory
Set the output directory for the generated files ('generated' by default).

To obtain usage and help information, do:

$ uml2ccm --help
Usage: uml2ccm [-h|--help] [--version] [--silent] [--monolithic] [-d|--outputdir directory] xmi_uml_document

Options:
  -h, --help                Display this information and exit
  --version                 Output version information and exit
  --silent                  Silent output messages
  --monolithic              Generate the monolithic version of the Java implementation (CIF Implementation by default)
  -d, --outputdir directory Set the output directory for the generated files ('generated' by default)

Description:
  Transform the XMI 1.1 UML 1.4 document to the OMG IDL 3.0, OMG CIDL and Java Implementation files

$

To obtain version information, do:

$ uml2ccm --version
OpenCCM uml2ccm 0.8.2

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

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

$ uml2ccm --silent test/sample.xmi
$
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster | Last modified at 2005-07-07 02:04 PM