Quoter example README

To download the source codes of this example please refer to the SVN repository at $CIAO_ROOT\docs\tutorials\Quoter\Simple


Example Description

The StockDistributor component would be monitoring a real-time stock database. When the values of particular stocks change, it pushes a CCM eventtype that contains the stock's name via a CCM event source to the corresponding CCM
event sink implemented by one or more StockBroker components. If these components are interested in the stock they can obtain more information about it by invoking a request/response operation via their CCM receptacle on a CCM facet exported by the StockDistributor component. The diagram of this example is shown in fig 1.


figure 1

This example is based on a series of  CORBA Component Model columns written by Douglas Schmidt and Steve Vinoski, and has been consistently used as a example for TAO. Please refer to TAO online tutorial for details.

The files you will find

  • The interfaces, data types and exceptions shared by the components of this application are specified in the Stock_Base.idl.The lib generated from Stock_Base.idl is linked to all the components of this example.
  •  mpc files for each of the components are available in the components directories. We use the  MPC to generate makefiles and Visual C++ project/solutions files for all ACE, TAO and CIAO libraries.
  •  idl and cidl files for each component are placed in components directory.
  •  The _exec.h and _exec.cpp files are the actual implementation of the components.

  • Make

    Navigate to  the directory $CIAO_ROOT/docs/tutorials/Quoter/Simple and do:
    $ACE_ROOT/bin/mwc.pl -type gnuace (use different -type option if you are using a compiler/IDE other than GNU make)
    For example, use %ACE_ROOT%/bin/mwc.pl -type vc71 if you are using Visual C++ 7.1 IDE.

    Then build/make the generated project/make files. Correct errors in the source codes if necessary.

    Assemble

    Now we can step forward to build the assembly.

  • In the descriptor subdirectory, you'll find a XML descriptor file that describes your deployment plan, the flattened_deploymentplan.cdp. This file declaratively specifies how the component assembly is constructed. Specifically, it defines the component types, component instances, component connections and implementation artifact descriptions.
  •  
  • Please make sure that the Modified_Deployment.xsd and XMI.xsd files are in the Display/descriptors directory. The former file could be found in $CIAO_ROOT/docs/schema directory.

    Note: Creating the deployment plan descriptor is a tedious and error-prone job, you can download CoSMIC to assist you in this step. Please refer to this tutorial to see how you can use CoSMIC to automatically generate the descriptor file.


  • Running the program

    >From different shells in $CIAO_ROOT/docs/tutorials/Quoter/Simple/descriptors/ directory:

    The Stock.dat file describes the deployment daemons CIAO's Execution_Manager will contact to instantiate ComponentServer's, home's, and component instances. Each line specify the name of a installation "destination" and the corresponding corbaloc IOR for the CIAO_Daemon.

           
            Start the distributor service at a frequency of  3 hertz:
           ../Distributor/Distributor.exe -o   -r3

            Use the broker program to subscribe to MSFT stock
            ../Broker/Broker.exe -s MSFT

            Subscribe to IBM stock
            ../Broker/Broker.exe -s IBM

            Unsubscribe to MSFT stock
            ../Broker/Broker -u MSFT

            Turn off the distribution service:
            ../Distributor/Distributor -f

    Please contact [email protected] if you have any questions.