Simple CIAO tutorial

Note:

Example Description

This Hello example is contructed in the following ways:

Step-By-Step

Hello_Base

  1. Write an IDL file (Hello_Base.idl) which contains all the interfaces and events common to all the components. The reason we do this is becuse the generated lib of this idl file will be linked in by all the components in the system. To reduce the size of the component lib we have to include only the necesary part. In this example, we have an eventtype timeout and an interface ReadMessage, which are used by both the Sender and the Receiver, so we put both of them in Hello.idl.
  2. Look at the Hello_Base.mpc file to get an idea how the Hello_Base_stub and Hello_Base_svnt projects are organized. MPC is a utility we used to generate makefiles or VC project/solution files for all ACE, TAO and CIAO libraries.

For Every Components

  1. Use:
    $CIAO_ROOT/bin/generate_component_mpc.pl -p Hello_Base Sender
    $CIAO_ROOT/bin/generate_component_mpc.pl -p Hello_Base Receiver

    Note:

  2. Use the export script to generate the export files. (3 files per component).
  3. Write an idl file for every compoent. Here you can put the component specific IDL definitions in this file. In this example we have a interface trigger specific to the Sender. Please note that the Sender component "supports" (IDL keyword) this interface.
  4. Write the CIDL file for every component.
  5. Write _exec.h and _exec.cpp files which actually implement the component.
Writing all those files could be troublesome to a new CCM user. The best way of learning this is to read the example source code. If you are familliar with CORBA programming, it should not take too much time before you can declare yourself as a CCM programmer.


The Entry Point

After both components are implemented we still need a small program to initialize the process. In Sender.idl there is a Sender specific interface with a single method in it created for this purpose. Hence there is a CORBA client application called starter. The starter will make a invocation on a supported interface called trigger on the Sender component to get the whole distributed application started. The starter will first obtain the Sender component object reference through the ior string supplied as a command argument. Please see the the last part of Hello/Sender/Sender.mpc file for details.


Make


Assemble

Now we can step forward to build the assembly. Here we are going to build the simplest case only, which is 1 Receiver and 1 Sender. If you are interested in CIAO you could try 1 Sender with multiple Receiver. However, you need to change the Sender.idl to make it publishes timeout event instead of emits event.

Deploy with DAnCE

Finally you are ready to deploy the component-based application you have developed.


More Features

Recently DAnCE is enabled with a feature called Redeployment and Reconfiguration (ReDaC). For more information about how to use this feature, please refer to the ReDaC-Usage-Example.html under $CIAO_ROOT/examples/Hello/.


Email: ciao-users@cse.wustl.edu