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

Table of Contents

  1. Writing an application with OpenCCM
  2. Defining components and homes with OMG IDL 3.0
  3. Defining component and home compositions with OMG CIDL
  4. Compiling and generating code with OpenCCM
  5. Implementing "business" code
  6. Compilation
  7. XML and deployment

Writing an application with OpenCCM

This document describes how to write an application with OpenCCM. To illustrate this purpose, the development process on the demo1 example will be explained.

Defining components and homes with OMG IDL 3.0

Firstly, you should define interfaces, components and their homes in an OMG IDL 3.0 file.

$ cat demo1.idl3
module demo1
{
    /**
     * Interface for synchronous communications between components.
     */
    interface Display
    {
        /**
         * Print a string text.
         *
         * @param text The string text.
         */
        void print(in string text);
    };

    /**
     * The Client component type.
     */
    component Client
    {
        /** The identifier name property. */
        attribute string the_name;

        /**
         * The receptable to_server to connect the Client component
         * to a Display object or facet reference.
         */
        uses Display to_server;
    };

    /**
     * Simple home for instantiating Client components.
     */
    home ClientHome manages Client
    {
    };

    /**
     * The Server component type.
     */
    component Server
    {
        /** The identifier name property. */
        attribute string the_name;

        /** The facet for Clients components. */
        provides Display for_clients;
    };

    /**
     * Simple home for instantiating Server components.
     */
    home ServerHome manages Server
    {
    };
};
$

For more details, see the CORBA Component Model Specification.

Defining component and home compositions with OMG CIDL

Currently, only session and service compositions are supported (entity compositions will come soon).

You must declare a composition for each component implementation, e.g.:

$ cat demo1.cidl
module demo1
{
    composition session ClientSessionComposition
    {
        home executor HomeImpl
        {
            implements ClientHome;
            manages ComponentImpl;
        };
    };

    composition session ServerSessionComposition
    {
        home executor HomeImpl
        {
            implements ServerHome;
            manages ComponentImpl;
        };
    };
};
$

Here, HomeImpl is the home executor skeleton class name and ComponentImpl is the component executor skeleton class name. Executors have the same name in the two compositions, but it does not care because each composition is mapped to a different module.

Compiling and generating code with OpenCCM

Now, we can generate from previous .idl3 and .cidl files.

  • Starts the OpenCCM Interface Repository:
    $ ir3_start

  • Feeds the OpenCCM Interface Repository with an OMG IDL 3.0 file:
    $ ir3_feed demo1.idl3

  • Generates OMG IDL 2.x mapping for the demo1 module:
    $ ir3_idl2 -o demo1.idl ::demo1

  • Generates OpenCCM skeletons for the demo1 module:
    $ ir3_java ::demo1

  • Generates CIDL based component executor skeleton interfaces and implementations:
    $ cidl_cif -o demo1_cif.idl -d generated demo1.cidl

  • Stops the OpenCCM Interface Repository:
    $ ir3_stop

Implementing "business" code

With CIDL/CIF, you do not have to matter with non-business code. It can be generated automatically. Your only preoccupation is to extend the CIDL generated skeletons, e.g. "ComponentImpl" in this case.

Demo1 implementation with CIF

All interfaces implemented by the component are already specified in the component skeleton, so you just have to extend the skeleton. Then you must implement the body of the operations.

Compilation

  • Generates CORBA 2.x stubs:
    $ jidl demo1.idl
    $ jidl demo1_local.idl
    $ jidl demo1_cif.idl
    $
    

  • Compiles generated Java CORBA 2.x stubs.
    TO BE COMPLETED

  • Compiles generated Java OpenCCM skeletons.
    TO BE COMPLETED

  • Compile all Java implementation sources.
    TO BE COMPLETED

  • Build the Java archive.
    TO BE COMPLETED

XML and deployment

See Writing CCM XML meta files.


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