summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorturkaye <turkaye@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-02-04 15:54:02 +0000
committerturkaye <turkaye@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-02-04 15:54:02 +0000
commit91a40a6dd32193641d3c8712dcf89127f24959dd (patch)
tree3007d4b39d58e9c1bc9717ff3794c7ef462f8dc7
parent936d78c1b68145f3bbaa90b652c255d3bfcfbcf5 (diff)
downloadATCD-91a40a6dd32193641d3c8712dcf89127f24959dd.tar.gz
*** empty log message ***
-rw-r--r--TAO/CIAO/ChangeLog8
-rwxr-xr-xTAO/CIAO/DAnCE/examples/Hello/descriptors/basicNodeDaemon.pl40
-rw-r--r--TAO/CIAO/DAnCE/examples/Hello/step-by-step.html165
3 files changed, 213 insertions, 0 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog
index 8925bf276a1..0ddfa2dae44 100644
--- a/TAO/CIAO/ChangeLog
+++ b/TAO/CIAO/ChangeLog
@@ -1,3 +1,11 @@
+Fri Feb 4 09:35:00 2005 Emre Turkay <turkaye@dre.vanderbilt.edu>
+
+ * DAnCE/examples/Hello/descriptors/basicNodeDaemon.pl:
+ The perl script to create node daemons created.
+
+ * DAnCE/examples/Hello/step-by-step.html:
+ Step by step tutorial for the DAnCE.
+
Fri Feb 4 12:11:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
* tools/RTComponentServer/RTConfig_Manager.h:
diff --git a/TAO/CIAO/DAnCE/examples/Hello/descriptors/basicNodeDaemon.pl b/TAO/CIAO/DAnCE/examples/Hello/descriptors/basicNodeDaemon.pl
new file mode 100755
index 00000000000..81eb9204afc
--- /dev/null
+++ b/TAO/CIAO/DAnCE/examples/Hello/descriptors/basicNodeDaemon.pl
@@ -0,0 +1,40 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../bin";
+use PerlACE::Run_Test;
+
+$status = 0;
+$iorfile1 = PerlACE::LocalFile ("NodeApp1.ior");
+$iorfile2 = PerlACE::LocalFile ("NodeApp2.ior");
+
+#for ($iter = 0; $iter <= $#ARGV; $iter++) {
+# if ($ARGV[$iter] eq "-h" || $ARGV[$iter] eq "-?") {
+# print "Run_Test Perl script for NodeApplicationTest \n\n";
+# print "run_test \n";
+# print "\n";
+# print "-h -- prints this information\n";
+# exit 0;
+# }
+#}
+
+
+unlink $iorfile1;
+unlink $iorfile2;
+
+$CIAO_ROOT=$ENV{'CIAO_ROOT'};
+
+$SV1 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/Node_Daemon",
+ "-ORBEndpoint iiop://localhost:30000 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication");
+
+$SV2 = new PerlACE::Process ("$CIAO_ROOT/DAnCE/NodeManager/Node_Daemon",
+ "-ORBEndpoint iiop://localhost:40000 -s $CIAO_ROOT/DAnCE/NodeApplication/NodeApplication");
+
+$SV1->Spawn ();
+$SV2->Spawn ();
+
+sleep (99999999999);
diff --git a/TAO/CIAO/DAnCE/examples/Hello/step-by-step.html b/TAO/CIAO/DAnCE/examples/Hello/step-by-step.html
new file mode 100644
index 00000000000..ba5225694a3
--- /dev/null
+++ b/TAO/CIAO/DAnCE/examples/Hello/step-by-step.html
@@ -0,0 +1,165 @@
+<!--//$Id$ -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>Step-By-Step of How to build a CIAO application</title>
+</head>
+
+<body
+ text = "#000000"
+ link = "#000fff"
+ vLink= "#ff0f0f"
+ aLink = "#0000ff"
+ bgColor = "#ffffff">
+
+<hr>
+<h2>Simple <a href="http://www.dre.vanderbilt.edu/CIAO">CIAO</a> tutorial</h2>
+<hr>
+<b>Note:</b>
+<li><a href="http://www.dre.vanderbilt.edu/cosmic">CoSMIC</a> tools are not used in this tutorial.</li>
+<li>This is only a <em>GENERAL</em> way of building up a CIAO application. The user could always change the process in his own way. For example: the IDL file content, the project structure etc.</li>
+<li>To download the code please refer to the CVS repository at <code>$CIAO_ROOT/DAnCE/examples/Hello</code>.</li>
+<li>If you just want to try the example you could jump to the <em>Make</em> then the <em>Run</em> section.</li>
+<hr>
+
+<h2>Example Description</h2>
+This Hello example is contructed in the following ways:
+<li>1. There are 2 components in the system: Sender and Receiver</li>
+<li>2. The Sender will send out the timeout event to the Receiver.</li>
+<li>3. Upon receiving the timeout event, the Receiver will go and fetch data from the Sender. </li>
+<li>4. The user could deploy multiple instances of the Receiver without changing any C++/idl source code.</li>
+<hr>
+
+<h2>Step-By-Step</h2>
+<hr>
+<ul><h3>Hello_Base</h3>
+<li>1. Write an IDL file (<code>Hello_Base.idl</code>) 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 <code>timeout</code> and an interface <code>ReadMessage</code>, which are used by both the Sender and the Receiver, so we put both of them in Hello.idl.</li>
+
+<li>2. Use <code>$CIAO_ROOT/bin/generate_component_mpc.pl -n Hello_Base</code> to generate the <a href="http://downloads.ociweb.com/MPC/MakeProjectCreator.pdf">MPC</a> file for ITS_Base. Note: There are only 2 projects in the mpc file, Hello_Base_DnC_stub and Hello_Base_DnC_svnt.</li>
+
+<li>3. Open the mpc file and follow the instructions below</li>
+<ul>For the project <code>Hello_Base_svnt</code>:
+ <li>Change the parent prject from <code>ciao_svnt</strong> to <code>ciao_server_dnc.</strong></li>
+ <li>Delete the <code>IDL_Files</code> and <code>CIDL_Files</code> part.</li>
+ <li>Delete all the files in the <code>Source_File</code> part except <code>Hello_BaseS.cpp.</code></li>
+ <br>
+ <strong>Note:</strong> These steps are needed because that <code>Hello_Base</code> is not a component but libs(stub and skel) which will be used by the component libraries. However, since we generate the mpc file using the <code>generate_component_mpc.pl</code> we have to handcraft the file. The user can hand write this file if he prefer to.
+</ul>
+
+<br>
+<li>4. Follow the instruction from the output of the last step, use the perl script (<code>generate_export_file.pl</code>) to generate the Export files.</li>
+</ul>
+
+<hr>
+
+<ul><h3>For Every Components</h3>
+
+<li>1. Use: <br>
+<ul>
+<code>$CIAO_ROOT/bin/generate_component_mpc.pl -p Hello_Base Sender <br>
+ $$CIAO_ROOT/bin/generate_component_mpc.pl -p Hello_Base Receiver
+</code><br></ul>
+Note:
+<ul>
+<li>I have different directories for <code>Hello_Base/Sender/Receiver</code> respectively.</li>
+
+<li>For every <code>_stub</code> project, add:<br>
+ <code>"libs += Hello_Base_DnC_stub"</code><br>
+
+</ul>
+
+<li>2. Use the export script to generate the export files(3 files per component).</li>
+
+<li>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 <code>trigger</code> specific to the Sender.</li>
+
+<li>4. Write the CIDL file for every component.</li>
+
+<li>5. Write <code>_exec.h</code> and <code>_exec.cpp</code> files which actually implement the component.</li>
+<br>
+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 CIAO programmer.
+
+<hr>
+
+<h3>The Entry Point</h3>
+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 I created a TAO application called starter. The starter will call on a special trigger interface on the Sender to get the whole process started. The starter program should collocate with Sender because it reads the ior of the Sender. Please see the the last part of <code>Hello/Sender/Sender.mpc</code> file for detial.
+
+<hr>
+
+<h3>Make</h3>
+<li>Go to the top directory of your workspace and do:<br>
+ <code>$ACE_ROOT/bin/mwc.pl</code>(use -type option if you are using a compiler/IDE other than gnuace -which by default generates GNU makefiles-)</li>
+<li>Look at the generated Makefile(*unx) , Solution/workspace files(Windows) and you got it.</li>
+
+<hr>
+
+<h3>Assemble</h3>
+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 wich multiple Receiver. However, you need to change the Sender.idl to make it <em>publishes</em> timeout event instead of <em>emits</em> event.
+
+<br>
+
+<li> You need to create a bunch of XML descriptors which are explained as below.
+
+<dl>
+ <dt> Component Interface Descriptor (.ccd) </dt>
+ <dd> Describes the interface, ports, &amp; properties of one component </dd>
+
+ <dt> Implementation Artifact Descriptor (.iad) </dt>
+ <dd> Describes the implementation artifacts (e.g., DLLs, OS, etc.) of one
+ component. </dd>
+
+ <dt> Component Package Descriptor (.cpd) </dt>
+ <dd> Describes multiple alternative implementations of one component. </dd>
+
+ <dt> Package Configuration Descriptor (.pcd) </dt>
+ <dd> Describes a configuration of a component package </dd>
+
+ <dt> Top-level Package Descriptor (package.tpd) </dt>
+ <dd> Describes the top-level component package in a package (.cpk) </dd>
+
+ <dt> Component Implementation Descriptor (.cid) </dt>
+ <dd> Describes a specific implementation of a component interface
+ Implementation can be either monolithic- or assembly-based
+ Contains subcomponent instantiations in case of assembly based
+ implementations
+ Contains interconnection information between components </dd>
+
+ <dt> Component Packages (.cpk) </dt>
+ <dd> A component package can contain a single component
+ A component package can also contain an assembly </dd>
+</dl>
+
+<li> Copy the Deployment.xsd and XMI.xsd files from the Hello/descriptors directory.
+
+<li> Create the <em>.dat</em> file containing the location of each component instance. </li>
+
+<br>
+Note: Creating all the descriptors is a tedious and boring job, you can download <a href="http://www.dre.vanderbilt.edu/cosmic"> CoSMIC </a> to assist you in this step.
+</li>
+
+<hr>
+<h3>Run</h3>
+Finally you are ready to test the application you have made.
+<br><br>
+
+<UL>
+ <LI> Change into the <em> descriptors </em> directory Start NodeManagers (NodeDameon) by running <code> basicNodeDaemon.pl </code>
+
+ <LI> Start the execution manager:
+ <code>$CIAO_ROOT/DAnCE/ExecutionManager/Execution_Manager -o EM.ior -i hello.dat </code>
+ </LI>
+
+ <LI> Start the executor:
+ <code> $CIAO_ROOT/DAnCE/RepositoryManager/executor -p package.tpd -d Hello.cdp -k file://EM.ior </code>
+
+ <LI> After this, components should be deployed successfully. You can run the $CIAO_ROOT/DAnCE/examples/Sender/starter to start the application.
+ Please make sure that the component IOR file for the EC component is present when you run this client.
+
+ <BR/>
+ </LI>
+</UL>
+
+<hr>
+<b>Email: </b><a href="mailto:"</a<ADDRESS>ciao-users@cse.wustl.edu</ADDRESS>
+</body>
+</html>
+