From d5248dad5c0f7787bd5c24bdf24ff412f1c5cc72 Mon Sep 17 00:00:00 2001 From: "William R. Otte" Date: Fri, 4 Aug 2006 21:46:22 +0000 Subject: Fri Aug 4 21:40:46 UTC 2006 William R. Otte --- CIAO/ChangeLog | 11 + CIAO/docs/tutorials/CoSMIC/01.html | 254 +++++++------ CIAO/docs/tutorials/CoSMIC/02.html | 669 +++++++++++++--------------------- CIAO/docs/tutorials/CoSMIC/03.html | 137 +++---- CIAO/docs/tutorials/CoSMIC/04.html | 118 +++--- CIAO/docs/tutorials/CoSMIC/index.html | 261 ++++++------- CIAO/docs/tutorials/CoSMIC/style.css | 15 + 7 files changed, 689 insertions(+), 776 deletions(-) create mode 100644 CIAO/docs/tutorials/CoSMIC/style.css diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 1cf1d09f1e2..9e97f2da2af 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,14 @@ +Fri Aug 4 21:40:46 UTC 2006 William R. Otte + + * docs/tutorials/CoSMIC/01.html + * docs/tutorials/CoSMIC/02.html + * docs/tutorials/CoSMIC/03.html + * docs/tutorials/CoSMIC/04.html + * docs/tutorials/CoSMIC/style.css + * docs/tutorials/CoSMIC/index.html + + Style fixes, grammatical and spelling corrections, clarifications. + Thu Aug 3 20:38:39 UTC 2006 Nanbor Wang * DAnCE/NodeManager/NodeManager_Impl.cpp: diff --git a/CIAO/docs/tutorials/CoSMIC/01.html b/CIAO/docs/tutorials/CoSMIC/01.html index e43e2c148a8..8423a2175fd 100644 --- a/CIAO/docs/tutorials/CoSMIC/01.html +++ b/CIAO/docs/tutorials/CoSMIC/01.html @@ -1,125 +1,139 @@ - - + + + - + + + Getting Started - -

Getting Started
-

-Writing IDL files
-
-We will start from writing the idl file for each -component.
-   1. Create a directory named MyQuoter.
-   2. In MyQuoter directory, create one -directory Stock_Base for -the base idl and two more directories Broker, Distributor for each -component. In MyQuoter/Stock_Base, -place an idl file Stock_Base.idl -that -you could copy from here. -This file defines the interfaces and events that will be used by both -Stock Distributor and Stock Broker. We put together the -common interface definitions so the base library can be shared by both -components, reducing the size of "real" components.
-   3. In MyQuoter/Distributor, -place an idl -file Distributor.idl that -looks like this. -This file defines the StockDistributor component interfaces.
-   4. In MyQuoter/Broker -place an idl -file Broker.idl -that looks like this. -This file defines the StockBroker component interface.
-
-Importing IDL to PICML
-
-   To quick start our Stock Quoter -modeling process in GME, CoSMIC introduces idl_to_picml -, which is an executable program that imports the IDL files -you just created into PICML.
-    1. Make sure %COSMIC_ROOT%\bin is -included in the -PATH variable, e.g., c:\Program Files\ISIS\CoSMIC\bin.
-    2. Open a command prompt, run VCVARS32.BAT from the -MSVC .NET folder if you haven't done so. It will set the environment -for using Microsoft Visual Studio .NET tools so that idl_to_picml works -properly.
-in my machine, VCVARS32.bat is in C:\Program Files\Microsoft Visual -Studio .NET 2003\Vc7\bin
-    3. In the same command prompt, change directory to MyQuoter\, -and type the following -command:
-      > idl_to_picml -x MyQuoter -.\Stock_Base\Stock_Base.idl .\Broker\Broker.idl -.\Distributor\Distributor.idl -I .\Stock_Base
-   (if the above command does not work, you may also try this
-   >idl_to_picml -x MyQuoter .\Stock_Base\Stock_Base.idl -.\Broker\Broker.idl -.\Distributor\Distributor.idl  -I .\Stock_Base -I %TAO_ROOT% --I %TAO_ROOT%\orbsvcs -I %CIAO_ROOT%\ciao)

-        idl_to_picml -will parse -your IDL files and generated a MyQuoter.xme file in the MyQuoter -directory. Note that if -x option is not used, the default xme file -name will be PICML_default_xme_file.xme.
-    4. Start GME, select File->Import xml.., -and choose -the xme file just generated. You should be able to see an imported -PICML model similar to the one shown in Figure 2.
-
-

-
-Figure 2
-
     In the Browser -of the generated model, the PredefinedTypes -folder contains a bunch of atomic datatype elements that will be -referenced by other modeling parts later. You don't have to worry about -them for now. The models in InterfaceDefinitions folder -are the PICML representations ofthe IDL files you just imported. -Double-click to open Broker, it will show you -a white, document-like entity which represents a -<<FileRef>> instance and a yellow box-shaped entity -representing a <<Package>> instance. Their equivalent -representations in IDL files are "#include" and "module" respectively. -Figure 3 gives you a clear view of -GME representation of all the 3 idl files created. We will cover the -other folders in the next section.
-

-
-Figure 3
-
-
Now we are ready to model the rest of -the Stock Quoter systems.
-
-
-
-
-
-
-    -
-
-
Ming Xiong
-
- -Last modified: + + +

Getting Started

Writing IDL files
+
+ We will start from writing the idl file for each component.
+ +
    +
  1. Create a directory named MyQuoter.
  2. + +
  3. In MyQuoter + directory, create one directory Stock_Base for the base idl and + two more directories Broker, Distributor for each component. In + MyQuoter/Stock_Base, + place an idl file Stock_Base.idl that you could copy + from here. This + file defines the interfaces and events that will be used by + both Stock Distributor and Stock Broker.
  4. + +
  5. We put together the common + interface definitions so the base library can be shared by both + components, reducing the size of "real" components.
  6. + +
  7. In MyQuoter/Distributor, place an idl + file Distributor.idl + that looks like this. This + file defines the StockDistributor component + interfaces.
  8. + +
  9. In MyQuoter/Broker + place an idl file Broker.idl that looks like + this. This + file defines the StockBroker component interface.
  10. +

+ Importing IDL to PICML
+
+    To quick start our Stock Quoter modeling process in + GME, CoSMIC introduces idl_to_picml , which is an + executable program that imports the IDL files you just created + into PICML.
+ +
    +
  1. Make sure %COSMIC_ROOT%\bin is included in the + PATH variable, e.g., c:\Program + Files\ISIS\CoSMIC\bin.
  2. + +
  3. Open a command prompt, run VCVARS32.BAT from the MSVC .NET + folder if you haven't done so. It will set the environment for + using Microsoft Visual Studio .NET tools so that idl_to_picml works properly.
    + in my machine, VCVARS32.bat is in C:\Program Files\Microsoft + Visual Studio .NET 2003\Vc7\bin
  4. + +
  5. In the same command prompt, change directory to + MyQuoter\, and type the following command:
    +    > -x MyQuoter .\Stock_Base\Stock_Base.idl + .\Broker\Broker.idl .\Distributor\Distributor.idl -I + .\Stock_Base
    +    (if the above command does not work, you may also + try this
    +    >idl_to_picml -x MyQuoter + .\Stock_Base\Stock_Base.idl .\Broker\Broker.idl + .\Distributor\Distributor.idl  -I .\Stock_Base -I + %TAO_ROOT% -I %TAO_ROOT%\orbsvcs -I + %CIAO_ROOT%\ciao)
    +   idl_to_picml will parse your IDL files and + generated a MyQuoter.xme file in the + MyQuoter directory. Note that if -x option is not + used, the default xme file name will be + PICML_default_xme_file.xme.
    + 4. Start GME, select File->Import xml.., + and choose the xme file just generated. You should be able to + see an imported PICML model similar to the one shown in Figure + 2.
  6. +

+ +
+
+
+ Figure 2
+
+ +

  In the Browser of the generated model, the + PredefinedTypes folder contains a bunch of atomic + datatype elements that will be referenced by other modeling parts + later. You don't have to worry about them for now. The models in + InterfaceDefinitions folder are the PICML + representations ofthe IDL files you just imported. Double-click + to open Broker, it will show you a white, document-like + entity which represents a <<FileRef>> instance and a + yellow box-shaped entity representing a <<Package>> + instance. Their equivalent representations in IDL files are + "#include" and "module" respectively. Figure 3 gives you a clear + view of GME representation of all the 3 idl files created. We + will cover the other folders in the next section.

+ +
+
+
+ Figure 3
+
+
Now we are ready to model the rest of the Stock Quoter + systems.
+
+
+
+
+ +
+ Ming Xiong
+
+ + Last modified: diff --git a/CIAO/docs/tutorials/CoSMIC/02.html b/CIAO/docs/tutorials/CoSMIC/02.html index 6c8cee01aa2..6c5dadec9c0 100644 --- a/CIAO/docs/tutorials/CoSMIC/02.html +++ b/CIAO/docs/tutorials/CoSMIC/02.html @@ -1,422 +1,255 @@ - - + + + - Building a Stock Quoter with TAO - A Tutorial - + + + Building a Stock Quoter with TAO - A Tutorial + - -

Building Stock Quoter system in PICML
-

-Now we can start modelling the Quoter system using PICML. If there's -anything that confuses you as we go through each step, here is a pre-built Quoter model for your -reference. -It has everything that we will be achieving in this section. -
-
Note: -In case you don't know, to importa a XML file, just select File->Import XML.. from -GME and choose your XML model
-
-The paradigm of PICML is designed keeping in mind the OMG Deployment -& Configuration (D&C) specification (ptc/2003-07-08), so -the modeling process is straightforwrd if you are familar -with the specification. Please go to DAnCE -project for more information.
-
-
-

Table of Contents

- -
-The complete PICML Quoter model consists of modeling elements -distributed in various folders.. idl_to_picml -has created -all these folders and some of the modeling entities for us, as you -might have seen. In -the rest of the section, we will explain the purpose of each folder as -well as the modeling entities contained in these folders. We will also -show how to model some of the folders that have to be done by hand. -Before we start, it is worth reminding you that, please don't forget to -check the constraints when you are done with your model. In particular, -whenever you are about to generate something from your model, check the -constraint first by choosing
-File->Check->Check All in -GME. This will help you find a lot of logic error in your model.
- -

ImplementationArtifacts
-

-
This folder contains implementation artifacts associated with -components. idl_to_picml has -created these artifacts for us, with their dependency relationships -correctly captured. Figure 4 shows the Implementation Artifacts for Broker. -

-Figure 4.
-

-
-
-

ComponentImplementation
-

-
This folder contains models that describes the implementations of -component interfaces. In the Quoter example, we will have two -monolithic component implementations; respectively StockDistributorImplementation StockBrokerImplementation, and an -assembly -component implementation: StockQuoter, -which is an assembly of StockDistributorImplementation -and StockBrokerImplementaion. -idl_to_picml has created the -monolithic component implementations for us, as shown in figure 5 for -example, but we have to put them together by hand in order to construct -a Quoter system.
-
-
-

-Figure 5
-

-Assembly component is a recursive concept. It provides a boundary for -the composition of monolithic components.Assembly component does not -provide real implementation for any interface, i.e., it is a virtual -component. Modeling an assembly component is different from modeling a -monolithic component: you don't need to worry about the -artifacts.Instead, you need to create connections between monolithic -components so that they can talk via ports. Let's try to assemble the StockQuoter.
-
    -
  1. Right click folder ComponentImplementations, -choose Insert -Model->ComponentImplementationContainer, rename it -as "StockQuoterImplementation" in the Attribute Panel. Double click to -open it.
    -
  2. -
  3. From the Part Browser, drag a <<ComponentAssembly>> -to the modeling window, -name it "StockQuoter". Double click to open it.
    -
  4. -
  5. Now we will create two instances for interfaces StockBroker and StockDistributor. To do -that, expand the folder InterfaceDefinitions, -then expand the InterfaceDefinitions/Broker, then InterfaceDefinitions/Broker/Stock until the interface -definition of StockBroker shows. -While expanding the tree, always keep -the "StockQuoter" <<ComponentAssembly>> window open. -Then drag MyQuoter/InterfaceDefinitions/Broker/Stock/StockBroker -in the -browser to the "StockQuoter" <<ComponentAssembly>> window -while pressing ALT key. Repeat the -same steps for MyQuoter/InterfaceDefinitions/Distributor/Stock/StockDistributor, -and you will see two instances of component interfaces have been -created as shown in Figure 6 (the black line in the figure only -indicates .mapping)
    -
  6. -
-
-

-
-Figure 6 -
-
    -
  1. Create an <<PublishConnector>>.
    -
  2. -
  3. Now assemble the components together according to Figure 1(make sure you change to connect -mode ) and -the resulting assembly model should look like Figure 7. Note that to -create connections between -StockDistributor.notify_out and StockBroker.notify_in, you will need -the intermediate connector <<PublishConnector>>.
    -
  4. -
-
-
-Figure 7
-
-
- -

ComponentPackage
-

-This folder contains deployable component packages. Every instance in -an assembly should have a corresponding monolithic implementation and -packaged in a ComponentPackagebe To create a package for StockBroker.instance
-
    -
  1. Right click folder ComponentPackages -, -insert a <<PackageContainer>>, name it "Broker"; Double -click to open it.
    -
  2. -
  3. From the PartBrowser, add the following:
    -
      -
    • a <<ComponentPackage>> named "Broker";
    • -
    • a <<ComponentImplementationReference>> named -"Broker";
    • -
    • a <<ComponentRef>> named "Broker";
    • -
    -
  4. -
  5. Refer the <<ComponentImplementationReference>> Broker -to MyQuoter/ComponentImplementations/StockBrokerImplementation/StockBrokerMonolithicImpl. -Refer the -<<ComponentRef>> Broker to MyQuoter/InterfaceDefinitions/Broker/Stock/StockBroker. -To do a refering in GME, simply drage the tree node in the Browser -"into" the reference model. For example, you should drage the tree node - MyQuoter/ComponentImplementations/StockBrokerImplementation/StockBrokerMonolithicImpl -into <<ComponentImplementationReference>> Broker. Check -GME manual(tutorials) for more information.
  6. -
  7. Switch to Connect Mode and create two connections according to -the following relationship.
    -
      -
    • <<ComponentImplementationReference>> Broker -implements <<ComponentPackage>> Broker;
    • -
    • <<ComponentPackage>> Broker realizes -<<ComponentRef>> Broker.
    • -
    -
    -
    -     The model you built should resemble Figure 8.
    -
    -

    -
    -Figure 8
    -
    -
    Now create a -ComponentPackage/StockDistributor following the same steps.
    -
    -
  8. -
    -
    -
    We will also need to create a package -for the assembly component -StockQuoter. Remember assembly component is a virtual component, it -does not "realize" a certain interface, so different from the Broker -and Distributor packages, the -StockQuoter does not need a <<ComponentRef>>. To create -this model:
    -
    -
    -
    -
      - 1. Insert a <<ComponentPackage>> named "StockQuoter"
      -
      2. Add a -<<ComponentImplementationReference>> named "StockQuoter", -refer it to MyQuoter/ComponentImplementations/StockQuoter/StockQuoter -
    -
      - 3. Switch to connect mode and connect -<<ComponentImplementationReference>> StockQuoter with -<<ComponentPackage>> StockQuoter, as in Figure 9.
      -
      -
    -
      -
        -
      -
    -
    -
    -
    -

    -
    -
    -

    -
    -Figure 9
    -
    -
    -
    -
-
-
-

PackageConfiguration
-

-This folder contains just one model capturing specific configuration of -Component packages.
-
    -
  1. In the folder PackageConfiguration, -and create a -<<PackageConfigurationContainer>>, name it "Default", click -to -open it.
    -
  2. -
  3. Add a <<PackageConfiguration>> named "default" and a -<<ComponentPackageReference>>, name it "StockQuoter", -connect "Default" to "StockQuoter"
    -
  4. -
  5. Refer <<ComponentPackageReference>> StockQuoter to -<<ComponentPackage>> MyQuoter/ComponentPackage/StockQuoter/StockQuoter -
    -(Not <<ComponentImplementationReference>>
    MyQuoter/ComponentPackage/StockQuoter/StockQuoter!)  -
  6. -
-
-
- -

ToplevelPackage
-

-This folder contains one model capturing information about the -top-level element that will be fed to -the application.
-
    -
  1. In the folder ToplevelPackage, -and create a -<<ToplevelPackageContainer>>, name it "Default", double -click to open it.
    -
  2. -
  3. Add a <<ToplevelPackage>> named "ToplevelPackage" -and a <<PackageConfigurationReference>>, name it "Default", -connect "ToplevelPackage" to "Default"
    -
  4. -
  5. Refer "Default" to MyQuoter/PackageConfiguration/Default/Default
    -
  6. -
-
-
- -

Targets
-

-This folder contains domain-specific models capturing information about -the target -environment in which component-based application will be deployed. In -this Quoter example, we can either deploy the two components into ONE -host, or into TWO different host. We will deploy the Quoter into two -different host.
-
    -
  1. In the folder Targets, -insert a new <<Domain>> named "Domain"; double click to -open it.
    -
  2. -
  3. From the Part Browser, add two <<Node>> named -"Broker" and "Distributor" respectively.
    -
  4. -
-
-Now we are ready to deploy our Components to the actual physical -environment.
-
- -

DeploymentPlan
-

-This folder contains a plan model that captures information about the -assignment of component to nodes.
-
    -
  1. In the folder DeploymentPlan, -insert a model -<<DeploymentPlan>>; name it "Plan", click to open it
    -
  2. -
  3. From the PartBrowser, add the following:
    -
      -
    • Two <<CollocationGroup>>
    • -
    • Two <<NodeReference>> named "Node_Broker" and -"Node_Distributor" respectively, refering to MyQuoter/Targets/Domain/Broker -and MyQuoter/Targets/Domain/Distributor respectively
    • -
    • Two <<ComponentRef>> named "StockBroker" and -"StockDistributor" respectively, refering to MyQuoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockBroker -and MyQuoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockDistributor -respectively. Note that the <<ComponentRef>> in -DeploymentPlan is not refering to the interface, but rather, the actual -instance of the implementation.
    • -
    -
  4. -
  5. Switch to Connect Mode, connect one -<<CollocationGroup>> to <<NodeReference>> Node_Broker, -connect another -<<CollocationGroup>> to <<NodeReference>> Node_Distributor. -Now the model looks like the following.
    -
    -

    -
    -Figure 10.
    -
    -
    -
  6. -
  7. Now we need to associate <<ComponentRef>> -StockBroker to the -<<CollocationGroup>> running on the -<<NodeReference>> Broker, and <<ComponentRef>> -StockDistributor to the <<CollocationGroup>> running on the -<<NodeReference>> Distributor. To do that, switch the Edit -Mode Bar to Set Mode (), and move -the cursor to the <<CollocationGroup>> running on -<<NodeReference>> Distributor, right-click on it. You will -find the cursor is changed to set mode cursor, and only the -<<CollocationGroup>> you clicked in is highlighted, as -shown -in Figure 11.
    -
    -
  8. -
-
-

-
-Figure 11
-
-
-
 Now move your cursor to -<<ComponentRef>>  StockDistributor, and left-click it, -so that it looks like Figure 12.
-
-
-

-
-Figure 12
-
-
-
   This operation -associates StockDistributor component to the -<<CollocationGroup>> running on Distributor node. -To do the same with -Broker, just right-click on another <<CollocationGroup>>, -and left-click on StockBroker <<CollocationGroup>> which is -highlighted.
-
-
-
-
-Up to this point, we are basiclly done with the modeling part. Before -we generate anything from this model though, please DO remember to check the -constraints of the model as we mentioned earlier.
-
-After we are done with the modeling, the flattened_deploymentplan -interpreter that comes along with PICML will help us to generate a -flattened_deploymentplan.cdp file. Please make sure you generate this -file to MyQuoter/descriptors. -

-
-
-Ming Xiong
-
- -Last modified: -
-
-
-
+ + +

Building Stock Quoter system in PICML


+ +

This section describes modeling the Quoter application using PICML. If you have trouble producing a functioning model from this tutorial, please see the, pre-built Quoter model which is provided for your reference. This model contains all elements created as part of this tutorial.

+ +
+ Note: To import an XML file in GME, select File->Import XML.. from GME and choose your XML model
+
+ +

The PICML paradigm is designed for the OMG Deployment & Configuration (D&C) specification (ptc/2003-07-08), so the modeling process is straightforward if you are familiar with the specification. Please see the DAnCE project for more information.

+
+ +

Table of Contents

+ + +
+ +

The complete PICML Quoter model consists of modeling elements distributed across various folders. If you used idl_to_picml to generate the initial model, you will see that it has created all these folders and some of the tedious boilerplate modeling for us. The rest of the section will explain the purpose of each folder as well as the modeling entities contained in these folders. We will also show how to model some of the folders that have to be done by hand.

+ +
+ Important: The interpreters that generate deployment artifacts expect very strict constraints in the model. When you finish your model, and any time you wish to generate anything, it is a good idea to check constraints by clicking on File->Check->Check All in GME. This will help you find many logic errors in your model. +
+ +

ImplementationArtifacts

+ +

This folder contains implementation artifacts associated with components. idl_to_picml has created these artifacts for us, with their dependency relationships correctly captured. Figure 4 shows the Implementation Artifacts for Broker.

+ +
+
+ Figure 4.

+
+
+ +

ComponentImplementation

+ +

This folder contains models that describe the implementations of component interfaces. In the Quoter example, we will have two monolithic component implementations - named StockDistributorImplementation and StockBrokerImplementation - and an assembly component implementation named StockQuoter, which is an assembly of StockDistributorImplementation and StockBrokerImplementaion. idl_to_picml has created the monolithic component implementations for us, as shown in figure 5 for example, but we have to specify the connections between them in order to construct a Quoter system.

+ +
+
+ Figure 5
+
+ +

Assembly components provide a boundary for the composition of monolithic components and even other assemblies. Assembly components do not provide actual implementations for their interface, it is a virtual component that delegates its ports and attributes to one or more of the entities it contains. There are slight differences between modeling an assembly and modeling a monolithic component. Since the assembly is a virtual component, it is not necessary to model a MonolithicImplementation. Instead, instances of other components are placed within the assembly and connected. Let's try to assemble the StockQuoter.

+ +
    +
  1. Right click the ComponentImplementations folder, choose Insert Model->ComponentImplementationContainer, rename it as "StockQuoterImplementation" in the Attribute Panel. Double click to open it.
  2. + +
  3. From the Part Browser, drag a <<ComponentAssembly>> to the modeling window, name it "StockQuoter". Double click to open it.
  4. + +
  5. Now we will create two instances for interfaces StockBroker and StockDistributor. To do that, expand the folder InterfaceDefinitions, then expand the InterfaceDefinitions/ Broker, then InterfaceDefinitions/ Broker/ Stock until the interface definition of StockBroker shows. While expanding the tree, always keep the "StockQuoter" <<ComponentAssembly>> window open. Then drag MyQuoter/InterfaceDefinitions/Broker/Stock/StockBroker in the browser to the "StockQuoter" <<ComponentAssembly>> window while pressing ALT key. Repeat the same steps for MyQuoter/InterfaceDefinitions/Distributor/Stock/StockDistributor, and you will see two instances of component interfaces have been created as shown in Figure 6 (the black line in the figure only indicates .mapping)
  6. +

+ +
+
+
+ Figure 6
+
+ +
    +
  1. Create an <<PublishConnector>>.
  2. + +
  3. Now assemble the components together according to Figure 1(make sure you change to connect mode ) and the resulting assembly model should look like Figure 7. Note that to create connections between StockDistributor.notify_out and StockBroker.notify_in, you will need the intermediate connector <<PublishConnector>>.
  4. +

+
+ Figure 7
+
+ + +

ComponentPackage

This folder contains deployable component packages. Every instance in an assembly should have a corresponding monolithic implementation and packaged in a ComponentPackagebe To create a package for StockBroker.instance
+ +
    +
  1. Right click folder ComponentPackages , insert a <<PackageContainer>>, name it "Broker"; Double click to open it.
  2. + +
  3. From the PartBrowser, add the following:
    + +
      +
    • a <<ComponentPackage>> named "Broker";
    • + +
    • a <<ComponentImplementationReference>> named "Broker";
    • + +
    • a <<ComponentRef>> named "Broker";
    • +
    +
  4. + +
  5. Refer the <<ComponentImplementationReference>> Broker to MyQuoter/ComponentImplementations/StockBrokerImplementation/StockBrokerMonolithicImpl. Refer the <<ComponentRef>> Broker to MyQuoter/InterfaceDefinitions/Broker/Stock/StockBroker. To create a reference in GME, simply drag the tree node in the Browser "into" the reference model. For example, you should drag the tree node MyQuoter/ComponentImplementations/StockBrokerImplementation/StockBrokerMonolithicImpl into <<ComponentImplementationReference>> Broker. Check GME manual(tutorials) for more information.
  6. + +
  7. Switch to Connect Mode and create two connections according to the following relationship.
    + +
      +
    • <<ComponentImplementationReference>> Broker implements <<ComponentPackage>> Broker;
    • + +
    • <<ComponentPackage>> Broker realizes <<ComponentRef>> Broker.
    • +

    +
    +      The model you built should resemble Figure 8.
    +
    + +
    +
    +
    + Figure 8
    +
    +
    Now create a ComponentPackage/StockDistributor following the same steps. +
  8. + +
  9. +
    + We will also need to create a package for the assembly component StockQuoter. Remember assembly component is a virtual component, it does not "realize" a certain interface, so different from the Broker and Distributor packages, the StockQuoter does not need a <<ComponentRef>>. To create this model: + +
      +
    1. Insert a <<ComponentPackage>> named "StockQuoter"
    2. + +
    3. Add a <<ComponentImplementationReference>> named "StockQuoter", refer it to MyQuoter/ComponentImplementations/StockQuoter/StockQuoter
    4. + +
    5. Switch to connect mode and connect <<ComponentImplementationReference>> StockQuoter with <<ComponentPackage>> StockQuoter, as in Figure 9.
    6. +
    +
  10. +
+ +
+
+
+ Figure 9
+
+
+
+ + +

PackageConfiguration

This folder contains just one model capturing specific configuration of Component packages.
+ +
    +
  1. In the folder PackageConfiguration, and create a <<PackageConfigurationContainer>>, name it "Default", click to open it.
  2. + +
  3. Add a <<PackageConfiguration>> named "default" and a <<ComponentPackageReference>>, name it "StockQuoter", connect "Default" to "StockQuoter"
  4. + +
  5. Refer <<ComponentPackageReference>> StockQuoter to <<ComponentPackage>> MyQuoter/ComponentPackage/StockQuoter/StockQuoter
    + (Not <<ComponentImplementationReference>>
    MyQuoter/ComponentPackage/StockQuoter/StockQuoter!) 
  6. +

+
+ + +

ToplevelPackage

This folder contains one model capturing information about the top-level element that will be fed to the application.
+ +
    +
  1. In the folder ToplevelPackage, and create a <<ToplevelPackageContainer>>, name it "Default", double click to open it.
  2. + +
  3. Add a <<ToplevelPackage>> named "ToplevelPackage" and a <<PackageConfigurationReference>>, name it "Default", connect "ToplevelPackage" to "Default"
  4. + +
  5. Refer "Default" to MyQuoter/PackageConfiguration/Default/Default
  6. +

+
+ + +

Targets

This folder contains domain-specific models capturing information about the target environment in which component-based application will be deployed. In this Quoter example, we can either deploy the two components into ONE host, or into TWO different host. We will deploy the Quoter into two different host.
+ +
    +
  1. In the folder Targets, insert a new <<Domain>> named "Domain"; double click to open it.
  2. + +
  3. From the Part Browser, add two <<Node>> named "Broker" and "Distributor" respectively.
  4. +

+ Now we are ready to deploy our Components to the actual physical environment.
+
+ + +

DeploymentPlan

This folder contains a plan model that captures information about the assignment of component to nodes.
+ +
    +
  1. In the folder DeploymentPlan, insert a model <<DeploymentPlan>>; name it "Plan", click to open it
  2. + +
  3. From the PartBrowser, add the following:
    + +
      +
    • Two <<CollocationGroup>>
    • + +
    • Two <<NodeReference>> named "Node_Broker" and "Node_Distributor" respectively, refering to MyQuoter/Targets/Domain/Broker and MyQuoter/Targets/Domain/Distributor respectively
    • + +
    • Two <<ComponentRef>> named "StockBroker" and "StockDistributor" respectively, refering to MyQuoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockBroker and MyQuoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockDistributor respectively. Note that the <<ComponentRef>> in DeploymentPlan is not referring to the interface, but rather the actual instance of the implementation.
    • +
    +
  4. + +
  5. Switch to Connect Mode, connect one <<CollocationGroup>> to <<NodeReference>> Node_Broker, connect another <<CollocationGroup>> to <<NodeReference>> Node_Distributor. Now the model looks like the following.
    +
    + +
    +
    +
    + Figure 10.
    +
    +
    +
  6. + +
  7. Now we need to associate <<ComponentRef>> StockBroker to the <<CollocationGroup>> running on the <<NodeReference>> Broker, and <<ComponentRef>> StockDistributor to the <<CollocationGroup>> running on the <<NodeReference>> Distributor. To do that, switch the Edit Mode Bar to Set Mode (), and move the cursor to the <<CollocationGroup>> running on <<NodeReference>> Distributor, right-click on it. You will find the cursor is changed to set mode cursor, and only the <<CollocationGroup>> you clicked in is highlighted, as shown in Figure 11.
    +
  8. +
+ +
+
+
+ Figure 11
+
+
+ +

Now move your cursor to <<ComponentRef>>  StockDistributor, and left-click it, so that it looks like Figure 12.

+ +
+
+
+ Figure 12
+
+
+ +

This operation associates StockDistributor component to the <<CollocationGroup>> running on Distributor node. To do the same with Broker, just right-click on another <<CollocationGroup>>, and left-click on StockBroker <<CollocationGroup>> which is highlighted.
+

+
+ + +

Up to this point, we are basically done with the modeling part. Before we generate anything from this model though, please DO remember to check the constraints of the model as we mentioned earlier.

+ +

After we are done with the modeling, the flattened_deploymentplan interpreter that comes along with PICML will help us to generate a flattened_deploymentplan.cdp file. Please make sure you generate this file to MyQuoter/descriptors.

+ +
+
+
+
+ Ming Xiong
+
+ + Last modified: diff --git a/CIAO/docs/tutorials/CoSMIC/03.html b/CIAO/docs/tutorials/CoSMIC/03.html index df614e1b2bc..d8d068ff223 100644 --- a/CIAO/docs/tutorials/CoSMIC/03.html +++ b/CIAO/docs/tutorials/CoSMIC/03.html @@ -1,68 +1,79 @@ - - + + + + Building a Stock Quoter with TAO - A Tutorial - + - -

Implementing Quoter Components with DAnCE
-

-We discuss this section after the PICML modeling only because we would -like to focus our attention more on the modeling stage. It does not -indicate that the implementation of components has to be -subsequent to the work we've done under GME. They are totally -orthogonal to each other. In fact, they are so orthogonal  that we -won't go into details as to how DAnCE programming should be done. We'll -briefly go through the functionality of each component and provides the -links to their implementations respectively. For a hands on experience -on DAnCE programming, please refer to $CIAO_ROOT/DAnCE/examples/Hello.
-
-Broker Component
-   
The Broker componennt waits to -be notified by the Distributor component about stock changes. When a -stock change event arrives,  it will go back to Distributor -component and retrieve the information it interest in and output them -to the console. The users are allowed to subscribe to the interested -stock value through the interface supported by Broker component. Here's -the complete version of Broker_exec.h -and Broker_exec.cpp. -
-
-Distributor Component
-  
The Distributor componennt monitors -the real time stock database and publishes events whenever it detects -stock change. In our program, we use a ACE_Task  to simmulate this -real-life activity. The task will run in a seperate thread and -periodically increment the stock value by 1. In the same time the stock -value is incremented, an StockName -event along with the name of the changed stock will be sent. Here's the -complete version of Distributor_exec.h -and Distributor_exec.cpp
-
-Broker client
-   
The Broker client program is -the driver program for client to control Broker component, subscribe -and unsubscribe to a specific stock. Here's the complete version of -Broker.cpp
-
-Distributor client
-    
The Distributor client -program is the driver program for client -to control Distributor component, turn on and off the distribution -service, set up the frequency, etc. Here's the complete version of -Distributor.cpp
-
-

-

-
-
Ming Xiong
-
- -Last modified: - + + +

Implementing Quoter Components with DAnCE

We + discuss this section after the PICML modeling only because we + would like to focus our attention more on the modeling stage. It + does not indicate that the implementation of components has to be + subsequent to the work we've done under GME. They are totally + orthogonal to each other. In fact, they are so orthogonal  + that we won't go into details as to how DAnCE programming should + be done. We'll briefly go through the functionality of each + component and provides the links to their implementations + respectively. For a hands on experience on DAnCE programming, + please refer to $CIAO_ROOT/DAnCE/examples/Hello.
+
+ Broker Component
+    
The Broker component + waits to be notified by the Distributor component about stock + changes. When a stock change event arrives,  it will go back + to Distributor component and retrieve the information it interest + in and output them to the console. The users are allowed to + subscribe to the interested stock value through the interface + supported by Broker component. Here's the complete version of + Broker_exec.h + and Broker_exec.cpp.
+ +
+ Distributor Component
+   
The Distributor component + monitors the real time stock database and publishes events + whenever it detects stock change. In our program, we use a + ACE_Task  to simulate this real-life activity. The task + will run in a separate thread and periodically increment the + stock value by 1. In the same time the stock value is + incremented, an StockName event along with the name + of the changed stock will be sent. Here's the complete version of + Distributor_exec.h + and Distributor_exec.cpp
+ +
+ Broker client
+    
The Broker client program + is the driver program for client to control Broker component, + subscribe and unsubscribe to a specific stock. Here's the + complete version of Broker.cpp
+
+ Distributor client
+      The Distributor + client program is the driver program for client to control + Distributor component, turn on and off the distribution service, + set up the frequency, etc. Here's the complete version of + Distributor.cpp +
+

+ + +
+ Ming Xiong
+
+ + Last modified: + diff --git a/CIAO/docs/tutorials/CoSMIC/04.html b/CIAO/docs/tutorials/CoSMIC/04.html index 27a5344af23..dce2fb1364c 100644 --- a/CIAO/docs/tutorials/CoSMIC/04.html +++ b/CIAO/docs/tutorials/CoSMIC/04.html @@ -1,57 +1,77 @@ - - + + + + + Building a Stock Quoter with TAO - A Tutorial - + - -

Running the application

- -Now that we have all the components and driver programs successfully built, along with the flattened_deploymentplan generated by PICML, we will be able to run our application

- -From different command prompts in %CIAO_ROOT%/docs/tutorials/Quoter/Simple/descriptors/ -directory:
    -
  • Start NodeManagers (NodeDameon) by running runNodeDaemon.pl
  • -
  • Start the execution manager -%CIAO_ROOT%/DAnCE/ExecutionManager/Execution_Manager -o ior -i Stock.dat  -
-

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 -IOR for the CIAO_Daemon.

-
    -
  • NOTE: As one can see, we use the "Stock.dat" file to instruct the - Execution_Manager how to find the endpoint of each individual NodeManager - (i.e., Node Daemon) where component(s) will be deployed, so this is - non-standard. We plan to use Naming Service to do this in the future.
  • -
-
    -
  • Start the plan_launcher by running -%CIAO_ROOT%/DAnCE/Plan_Launcher/Plan_Launcher -p -flattened_deploymentplan.cdp -k file://ior
  • -
  • By now the components should be successfully deployed. You may -run the driver program to start the application. e.g. you can try the -following
    -
  • -
-        -%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Distributor/Distributor.exe -o
-
-        -%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Broker/Broker.exe -s MSFT
-
-        -%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Broker/Broker.exe -s IBM
-
-        -%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Broker/Broker.exe -u MSFT
-
-        -%CIAO_ROOT%/docs/tutorials/Quoter/Simple/Distributor/Distributor.exe -f
-
+ +

Running the application

Now that we have all the + components and driver programs successfully built, along with the + flattened_deploymentplan generated by PICML, we will be able to + run our application
+
+ From different command prompts in + %CIAO_ROOT%/docs/tutorials/Quoter/Simple/descriptors/ + directory: + +
    +
  • Start NodeManagers (NodeDameon) by running + runNodeDaemon.pl
  • + +
  • Start the execution manager + %CIAO_ROOT%/DAnCE/ExecutionManager/Execution_Manager -o + ior -i Stock.dat 
  • +
+ +

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 IOR for the CIAO_Daemon.

+ +
    +
  • NOTE: As one can see, we use the "Stock.dat" file + to instruct the Execution_Manager how to find the endpoint of + each individual NodeManager (i.e., Node Daemon) where + component(s) will be deployed, so this is non-standard. We plan + to use Naming Service to do this in the future.
  • +
+
    +
  • Start the plan_launcher by running + %CIAO_ROOT%/DAnCE/Plan_Launcher/Plan_Launcher -p + flattened_deploymentplan.cdp -k file://ior
  • +
  • By now the components should be successfully deployed. You + may run the driver program to start the application. e.g. you + can try the following
  • +
        + %CIAO_ROOT%/docs/tutorials/Quoter/Simple/Distributor/Distributor.exe + -o
+
+         + %CIAO_ROOT%/docs/tutorials/Quoter/Simple/Broker/Broker.exe + -s MSFT
+
+         + %CIAO_ROOT%/docs/tutorials/Quoter/Simple/Broker/Broker.exe + -s IBM
+
+         + %CIAO_ROOT%/docs/tutorials/Quoter/Simple/Broker/Broker.exe + -u MSFT
+
+         + %CIAO_ROOT%/docs/tutorials/Quoter/Simple/Distributor/Distributor.exe + -f
+
diff --git a/CIAO/docs/tutorials/CoSMIC/index.html b/CIAO/docs/tutorials/CoSMIC/index.html index eafa4cf52c4..a487b0f4350 100644 --- a/CIAO/docs/tutorials/CoSMIC/index.html +++ b/CIAO/docs/tutorials/CoSMIC/index.html @@ -1,136 +1,145 @@ - - + + + + + Building a Stock Quoter with TAO - A Tutorial - + - -

Building a Stock Quoter with CoSMIC and DAnCE - A Tutorial
-

-

This tutorial provides a step-by-step lesson on developing -component-based distributed applications using CoSMIC modeling -toolkit and CIAO -DAnCE framework. The example application used in this tutorial is a -Stock Quoter that consists of two components; the StockDistributor -and the StockBroker. The StockDistributor -notifies one or more stock brokers whenever a stock price changes. Upon -receiving the notification, the StockBroker -fetches information about a particular stock from the StockDistributor. The figure bellow -shows the application diagram. -This Stock Quoter application -is based on a series of CORBA -component model columns written by Doug Schmidt and Steve Vinoski for C/C++ Users Journal and has consistently -been -used as an example for TAO.
-

-

-
-Stock Quoter application Diagram
-
-

This tutorial will show you how to use generic modeling techniques CoSMIC to assist the -development process of CIAO applications. All the necessary steps to -build a component-based application model via CoSMIC -toolkit are documented here. -

-
-
Note:
-1. Although the descriptor files generated by CoSMIC toolkits are -portable, the modeling environment required by CoSMIC (GME) only -supports MS Windows platforms currently. So this tutorial will focus on -Windows users.
-2. The CIAO/DAnCE codes used for this tutorial can be found in %CIAO_ROOT%/docs/tutorials/Quoter/Simple. -
-3. The current tutorial is tested under GME 5.9.21, and  CosMIC -0.4.8. It will be subject to change as version of GME and CoSMIC -evolves.
-
-Prerequisite
-
-
   Before you start, -you need the following: -
    -
  1. ACE+TAO+CIAO (Component Integraated ACE ORB). ACE + TAO + -CIAO provide the CCM infrastructure necessary to enable the CCM-based -distributed component interaction. You can click here to download -the latest -ACE + TAO + CIAO and click here -for information on how -to build ACE+TAO+CIAO.

    + +

    Building a Stock Quoter with CoSMIC and DAnCE - A + Tutorial

    + +

    This tutorial provides a step-by-step lesson on developing + component-based distributed applications using CoSMIC modeling + toolkit and CIAO/DAnCE + framework. The example application used in this tutorial is a + Stock Quoter that consists of two components; the + StockDistributor and the StockBroker. The + StockDistributor notifies one or more stock brokers + whenever a stock price changes. Upon receiving the notification, + the StockBroker fetches information about a particular + stock from the StockDistributor. The figure bellow shows + the application diagram. This Stock Quoter application is based + on a series of CORBA + component model columns written by Doug Schmidt and + Steve Vinoski + for C/C++ Users Journal and has + consistently been used as an example for TAO.

    + +
    +
    +
    + Stock Quoter application Diagram
    +
    + +

    This tutorial will show you how to use generic modeling + techniques CoSMIC to assist the + development process of CIAO applications. All the necessary steps + to build a component-based application model via CoSMIC toolkit are + documented here.

    + +
    +
    + Note:
    + 1. Although the descriptor files generated by CoSMIC toolkits + are portable, the modeling environment required by CoSMIC (GME) + only supports Microsoft Windows platforms.
    + 2. The CIAO/DAnCE codes used for this tutorial can be found in + %CIAO_ROOT%/docs/tutorials/Quoter/Simple.
    + 3. The current tutorial is tested under GME 5.9.21, and  + CosMIC 0.4.8. It will be subject to change as version of GME + and CoSMIC evolves.
    +
    +
    Prerequisites
    +
    +    Before you start, you will need the following: + +
      +
    1. ACE+TAO+CIAO (Component Integraated ACE + ORB). ACE + TAO + CIAO provide the CCM infrastructure + necessary to enable the CCM-based distributed component + interaction. You can click here to download + the latest ACE + TAO + CIAO and click + here for information on how to build ACE+TAO+CIAO.
    2. + +
    3. Generic Modeling Environment (GME). GME is + a configurable toolkit for creating domain-specific modeling + and program synthesis environments. It provides the execution + environment for CoSMIC toolkits. Click here + to download GME.
    4. + +
    5. CoSMIC toolkit. Click here to download + the latest CoSMIC release.
    6. +
    -
  2. Generic Modeling Environment (GME). GME is a configurable -toolkit for creating domain-specific modeling and program synthesis -environments. It provides the execution environment for CoSMIC -toolkits. Click here -to download GME.

    +

    +
    + Note:
    -
  3. CoSMIC toolkit. Click here to download the -latest CoSMIC release.

    +

      +
    1. Please use only the version of GME that the CoSMIC + package you have downloaded requires. Attempts to use earlier + or later versions may result in undefined behavior.
    2. -
    +
  4. Make sure you install GME before you install CoSMIC.
  5. +
+
+ Getting + Started
+
+    This section describes the IDL files used by the + example and shows you how to import IDL into PICML + (Platform-Independent Component Modeling Language); a + domain-specific modeling language which is defined using GME. + PICML is designed to help to bridge the gap between design-time + verification and model-checking tools and the deployment of + component implementations.
+
+ Modeling StockQuoter system with + PICML
+
+     This section describes how to model the Stock + Quoter components in PICML.
+     
+ Implementing Quoter components with + DAnCE
+
+     This section provides codes for the Quoter + example.
+
+ Running the + application
+
+    After all the components and descriptors generated + by PICML are in place. You are ready to compile and run the + application.
+
+
-
-
Note:
-1.Usually you should download the latest GME, but it is possible that -CoSMIC hasn't been updated yet to support the very latest GME..The -installation process of CoSMIC will tell you which version it is -expecting.  So please make sure the GME -version you are using is the version required by CoSMIC. A different -version of GME may result in -undefined errors.
-2.Make sure you install GME first before you start with CoSMIC toolkits.
-
- -Getting Started
-
-   This section describes the IDL files used by the example -and -shows you how to import IDL into -PICML (Platform-Independent Component Modeling Language); a -domain-specific modeling language which is defined using GME. PICML is -designed to help to bridge the gap between design-time verification and -model-checking tools and the deployment of component implementations. -
-
-Modeling -StockQuoter system with PICML
-
-    This section describes how to model the Stock -Quoter components in PICML.
-    
-Implementing Quoter components with DAnCE
-
-    This section provides codes for the Quoter example.
-
-Running the application
-
-   After all the components and descriptors generated by -PICML are in place. You are ready to compile and run the application.
-
-
-
Ming Xiong
-
- -Last modified: Fri May 5 21:29:07 CDT 2006 - +
+ Ming Xiong
+
+ + Last modified: Fri May 5 21:29:07 CDT 2006 diff --git a/CIAO/docs/tutorials/CoSMIC/style.css b/CIAO/docs/tutorials/CoSMIC/style.css new file mode 100644 index 00000000000..b86b9ceb671 --- /dev/null +++ b/CIAO/docs/tutorials/CoSMIC/style.css @@ -0,0 +1,15 @@ + +/* Important Node */ +div.important { + position: center; + width: 75%; + text-align: left; + border: 1; + background: #FAEBD7; +} + +div.important strong { + font-weight: bold; + color: red; + font-variant: small-caps; +} -- cgit v1.2.1