/usr/share/doc/polyorb-doc/html/polyorb_ug/A-Complete-Example.html is in polyorb-doc 2.11~20140418-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This is free software; you can redistribute it and/or modify it under
terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version. This software is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>PolyORB User’s Guide: A Complete Example</title>
<meta name="description" content="PolyORB User’s Guide: A Complete Example">
<meta name="keywords" content="PolyORB User’s Guide: A Complete Example">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="About-This-Guide.html#About-This-Guide" rel="start" title="About This Guide">
<link href="Index.html#Index" rel="index" title="Index">
<link href="About-This-Guide.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="The-Configuration-Language.html#The-Configuration-Language" rel="up" title="The Configuration Language">
<link href="Partition-Runtime-Parameters.html#Partition-Runtime-Parameters" rel="next" title="Partition Runtime Parameters">
<link href="Partition-Attribute-ORB_005fTasking_005fPolicy.html#Partition-Attribute-ORB_005fTasking_005fPolicy" rel="prev" title="Partition Attribute ORB_Tasking_Policy">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="A-Complete-Example"></a>
<div class="header">
<p>
Previous: <a href="Partition-Attribute-ORB_005fTasking_005fPolicy.html#Partition-Attribute-ORB_005fTasking_005fPolicy" accesskey="p" rel="prev">Partition Attribute ORB_Tasking_Policy</a>, Up: <a href="The-Configuration-Language.html#The-Configuration-Language" accesskey="u" rel="up">The Configuration Language</a> [<a href="About-This-Guide.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="A-Complete-Example-1"></a>
<h4 class="subsubsection">8.5.4.27 A Complete Example</h4>
<p>Almost every keyword and construct defined in the configuration language
has been used in the following sample configuration file.
</p>
<div class="smallexample">
<pre class="smallexample">
<b>configuration</b> MyConfig <b>is</b>
Partition_1 : Partition := ();
<b>procedure</b> Master_Procedure <b>is</b> <b>in</b> Partition_1;
Partition_2, Partition_3 : Partition;
<b>for</b> Partition_2'Host <b>use</b> "foo.bar.com";
<b>function</b> Best_Node (Partition_Name : String) <b>return</b> String;
<b>pragma</b> Import (Shell, Best_Node, "best-node");
<b>for</b> Partition_3'Host <b>use</b> Best_Node;
Partition_4 : Partition := (RCI_B5);
<b>for</b> Partition_1'Directory <b>use</b> "/usr/you/test/bin";
<b>for</b> Partition'Directory <b>use</b> "bin";
<b>procedure</b> Another_Main;
<b>for</b> Partition_3'Main <b>use</b> Another_Main;
<b>for</b> Partition_3'Reconnection <b>use</b> Block_Until_Restart;
<b>for</b> Partition_4'Command_Line <b>use</b> "-v";
<b>for</b> Partition_4'Termination <b>use</b> Local_Termination;
<b>pragma</b> Starter (Convention => Ada);
<b>pragma</b> Boot_Server
(Protocol_Name => "tcp",
Protocol_Data => "`hostname`:`unused-port`");
<b>pragma</b> Version (False);
<b>begin</b>
Partition_2 := (RCI_B2, RCI_B4, Normal);
Partition_3 := (RCI_B3);
<b>end</b> MyConfig;
</pre></div>
<ol>
<li> <b>Line 01</b>
Typically, after having created the following configuration file the user
types:
<div class="smallexample">
<pre class="smallexample">
po_gnatdist myconfig.cfg
</pre></div>
<p>If the user wants to build only some partitions then he will list the
partitions to build on the <tt>po_gnatdist</tt> command line as follows:
</p>
<div class="smallexample">
<pre class="smallexample">
po_gnatdist myconfig.cfg partition_2 partition_3
</pre></div>
<p>The name of the file prefix must be the same as the name of the
configuration unit, in this example <tt>myconfig.cfg</tt>. The file suffix
must be <tt>cfg</tt>. For a given distributed application the user can have
as many different configuration files as desired.
</p>
</li><li> <b>Line 04</b>
Partition 1 contains no RCI package. However, it will contain the main
procedure of the distributed application, called <i>Master_Procedure</i> in
this example. If the line <i>procedure Master_Procedure is in
Partition_1;</i> was missing, Partition 1 would be completely empty. This is
forbidden, because a partition has to contain at least one library unit.
<p><tt>po_gnatdist</tt> produces an executable with the name of <i>Master_Procedure</i>
which will start the various partitions on their host machines in the
background. The main partition is launched in foreground. Note that by
killing this main procedure the whole distributed application is terminated.
</p>
</li><li> <b>Line 08</b>
Specify the host on which to run partition 2.
</li><li> <b>Line 12</b>
Use the value returned by a program to figure out at execution time the
name of the host on which partition 3 should execute. For instance,
execute the shell script <tt>best-node</tt> which takes the partition name as
parameter and returns a string giving the name of the machine on which
partition_3 should be launched.
</li><li> <b>Line 14</b>
Partition 4 contains one RCI package RCI_B5 No host is specified for
this partition. The startup script will ask for it interactively when it
is executed.
</li><li> <b>Line 16</b>
Specify the directory in which the executable of partition partition_1
will be stored.
</li><li> <b>Line 17</b>
Specify the directory in which all the partition executables will be
stored (except partition_1, see <a href="Pragmas-and-Representation-Clauses.html#Pragmas-and-Representation-Clauses">Pragmas and Representation Clauses</a>). Default is the current directory.
</li><li> <b>Line 20</b>
Specify the partition main subprogram to use in a given partition.
</li><li> <b>Line 22</b>
Specify a reconnection policy in case of a crash of Partition_3. Any attempt to
reconnect to Partition_3 when this partition is dead will be
blocked until Partition_3 restarts. By default, any restart is
rejected (Reject_On_Restart). Another policy is to raise
Communication_Error on any reconnection attempt until Partition_3 has
been restarted.
</li><li> <b>Line 23</b>
Specify additional arguments to pass on the command line when a given
partition is launched.
</li><li> <b>Line 24</b>
Specify a termination mechanism for partition_4. The default is to
compute a global distributed termination. When Local_Termination is
specified a partition terminates as soon as local termination is
detected (standard Ada termination).
</li><li> <b>Line 26</b>
Specify the kind of startup method the user wants. There are 3
possibilities: Shell, Ada and None. Specifying <i>Shell</i> builds a shell
script. All the partitions will be launched from a shell script. If
<i>Ada</i> is chosen, then the main Ada procedure itself is used to launch
the various partitions. If method <i>None</i> is chosen, then no launch
method is used and the user must start each partition manually.
<p>If no starter is given, then an Ada starter will be used.
</p>
<p>In this example, Partition_2, Partitions_3 and Partition_4 will be
started from Partition_1 (ie from the Ada procedure Master_Procedure).
</p>
</li><li> <b>Line 30</b>
Specify the use of a particular boot server.
</li><li> <b>Line 32</b>
It is a bounded error to elaborate a partition of a distributed
program that contains a compilation unit that depends on a different
version of the declaration of an RCI library unit than the one included in
the partition to which the RCI library unit was assigned. When the
pragma Version is set to False, no consistency check is performed.
</li><li> <b>Line 34</b>
The configuration body is optional. The user may have fully described
his configuration in the declaration part.
</li><li> <b>Line 35</b>
Partition 2 contains two RCI packages RCI_B2 and RCI_B4 and a normal
package. A normal package is not categorized.
</li><li> <b>Line 36</b>
Partition 3 contains one RCI package RCI_B3
</li></ol>
<hr>
<div class="header">
<p>
Previous: <a href="Partition-Attribute-ORB_005fTasking_005fPolicy.html#Partition-Attribute-ORB_005fTasking_005fPolicy" accesskey="p" rel="prev">Partition Attribute ORB_Tasking_Policy</a>, Up: <a href="The-Configuration-Language.html#The-Configuration-Language" accesskey="u" rel="up">The Configuration Language</a> [<a href="About-This-Guide.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|