Salome HOME
PR : merge branch V1_2c dans branche principale pour V1_3_0_b1
[modules/kernel.git] / doc / html / INPUT / sources / static / overview_Naming.html
1 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">\r
2 <html>\r
3 <head>\r
4    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
5    <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">\r
6    <title>Naming Service Description</title>\r
7 <link href="doxygen.css" rel="stylesheet" type="text/css">\r
8 </head>\r
9 <body>\r
10 &nbsp;\r
11 <center><table WIDTH="96%" >\r
12 <tr>\r
13 <td><a href="http://www.opencascade.com"><img src="sources/logocorp.gif" BORDER=0 height=46 width=122></a></td>\r
14 \r
15 \r
16 <td>\r
17 <div align=right><a href="http://www.opencascade.org/SALOME/"><img src="sources/application.gif" BORDER=0 height=46 width=108></a></div>\r
18 </td>\r
19 </tr>\r
20 </table></center>\r
21 \r
22 \r
23 <h1><a name="page2">Naming Service Description </a></h1>\r
24 <br>\r
25 <h2>Introduction</h2>\r
26 <p>This page contains an abridged version of the Naming Service specification \r
27   edited by the Object Management Group, Inc.(OMG). The objective of this document is to give the users of SALOME \r
28   application a brief overview of the Naming Service implemented in SALOME. \r
29   A complete version of this document can be found <a href="http://www.omg.org" target="top">here.</a> <a name="#cont"></a>\r
30   </p>\r
31         <br>\r
32 <a name="cont"></a><h2>Table of contents </h2>\r
33 <b><i>\r
34 <ul>\r
35   <li><a href="#1">1. Overview</a></li>\r
36   <li><a href="#2">2. SALOME Naming Service </a></li>\r
37                 <ul>\r
38                 <li><a href="#2_1">2.1 Introduction </a></li>\r
39                 <li><a href="#2_2">2.2 Definitions </a></li>\r
40                 <li><a href="#2_3">2.3 Partition of SALOME name directory hierarchy </a></li>\r
41                 <li><a href="#2_4">2.4 SALOME name directory persistence </a></li>\r
42                 <li><a href="#2_5">2.5 SALOME naming service features </a></li>\r
43                 </ul>\r
44   \r
45 </ul>\r
46 </i> </b> <br>\r
47 \r
48 <a name="1"></a><h2>1. Overview</h2>\r
49 <p>This chapter presents the OMG Naming Service and explains how the Naming Service can be used to decouple clients and servers by\r
50 providing an external reference exchange mechanism. The chapter also covers how to solve the bootstrapping problem for clients and\r
51 servers by controlling their configuration. \r
52  </p>\r
53   \r
54 <p>In practice, copying stringified references from a server to all its clients is clumsy and does not scale. The Naming Service provides a way\r
55 for servers to advertise references under a name, and for clients to retrieve them. The advantages are: \r
56 </p>\r
57 <ul>\r
58   <li>Clients and servers can use meaningful names instead of having to deal with stringified references. </li>\r
59     <li> By changing a reference in the service without changing its name, you can transparently direct clients to a different object.</li> \r
60     <li> The Naming Service solves the bootstrapping problem because it provides a fixed point for clients and servers to rendezvous. </li>\r
61 </ul>\r
62 <p>The Naming Service is much like a white pages phone book. Given a name, it \r
63   returns an object reference. </p>\r
64   \r
65 <p>The terminology used in description of NamigService is the following: </p>\r
66 \r
67 <ul>\r
68   <li>A name-to-IOR association is called by a name binding. </li>\r
69   <li>Each binding identifies exactly one object reference, but an object reference \r
70     may be bound more than once (have more than one name). </li>\r
71   <li><a name="graph"></a>A naming context is an object that contains name bindings. \r
72     The names within a context must be unique. Naming contexts can contain bindings \r
73     to other naming contexts, so naming contexts can form graphs. Binding contexts \r
74     in other contexts creates a <i>naming graph</i> \97 a directed graph with nodes \r
75     and labeled edges where the nodes are contexts. A naming graph allows more \r
76     complex names to reference an object. Given a context in a naming graph, a \r
77     sequence of names can reference an object. This sequence of names (called \r
78     a <i>compound name</i>) defines a path in the naming graph to navigate the \r
79     resolution process. Figure 1-1 shows an example of a naming graph. </li>\r
80   <li>Binding a name to a context means to add a name\96IOR pair to a context. </li>\r
81   <li>Resolving a name means to look for a name in a context and to obtain the \r
82     IOR bound under that name.</li>\r
83 </ul>\r
84 \r
85   \r
86 <div align="center"><img src="ns_f3-1.jpg"> </div>\r
87 <p align="center"><font size="-1"><i>Figure 1-1</i> A Naming Graph </font></p>\r
88  <i><a href="#cont">Back to the contents</a></i>\r
89  <br>\r
90  <a name="2"></a>\r
91 <h2>2. SALOME Naming Service </h2>\r
92 <a name="2_1"></a>\r
93 <h3>2.1 Introduction</h3\r
94  \r
95 >\r
96 <p>The SALOME Naming Service is a kernel function which supplies a name directory \r
97   hierarchy for pointing out CORBA objects. This name directory hierarchy allows, \r
98   from symbolic names, to dynamically find the references of distributed SALOME \r
99   objects, without information about their location. SALOME objects which can \r
100   be reached via the naming service are:</p>\r
101   \r
102 <ul>\r
103   <li>The kernel services</li>\r
104   <li>Containers\r
105   <li>SALOME components instances\r
106 </ul>\r
107 <p>The name directory hierarchy in SALOME represents a graph of directories containing \r
108   symbolic associations name-reference on objects. (It has been described in the \r
109   <a href="#graph">previous section</a>)</p>\r
110 <a name="2_2"></a>\r
111 <h3>2.2 Definitions</h3>\r
112 <dl>\r
113 <dt><i><b>Directory</b></i></dt> \r
114 <dd>Context of names containing symbolic associations name-reference on objects.</dd><br><br>\r
115  <dt><i><b>"/"</b></i></dt>\r
116  <dd>Character used in SALOME to separate two names of a directory</dd><br><br>\r
117  <dt><i><b>Access path</b></i></dt> \r
118  <dd>List of names (separated by "/" character representing the path to be followed \r
119  in the graph to reach an association name-reference (the last name in the sequence).</dd>\r
120 </dl> \r
121 <blockquote><b>Note:</b>An object can be referenced by several symbolic names \r
122   in one or several directories.</blockquote>\r
123   <a name="2_3"></a>\r
124 <h3>2.3 Partition of SALOME name directory hierarchy</h3>\r
125 <p>The hierarchical organization of the SALOME name directory is not completely frozen .\r
126 Because the framework allows the simultaneous opening of several studies, the following levels are determined:</p>\r
127 <pre> \r
128  /Kernel\r
129  /Container/\r
130                /Component       \r
131 </pre>\r
132 <a name="2_4"></a>\r
133 <h3>2.4 SALOME name directory persistence</h3>\r
134 <p>During a SALOME session, stopping a server in charge of the Naming Service \r
135   doesn't imply the loss of the contents of the SALOME name directory hierarchy. \r
136   A backup file is produced and can be used to restart the Naming Service. So, \r
137   one can recover the state of the SALOME name directory hierarchy at restart \r
138   time. During such breakdown, every call to any function of the Naming Service \r
139   invokes an exception of type <i>Unreachable service</i>.</p>\r
140 <a name="2_5"></a>\r
141 <h3>2.5 SALOME Naming Service features</h3>\r
142 <p>Usage and administration of the name directory hierarchy is realized by means of the following functions:</p> \r
143 <ul>\r
144   <li>Recording and recovering of the reference of an object </li>\r
145   <li>Searching for a symbolic name</li>\r
146   <li>Creating of a directory, reading and modifying of the current directory</li>\r
147   <li>Destructing of a symbolic name and a diredtory</li>\r
148 </ul>\r
149 <p>The access path used in these functions can be defined, either from the root, or from any\r
150 directory of SALOME name directory hierarchy.</p> \r
151 \r
152 <p>In SALOME there is s standard interface of Naming Service, and any user can \r
153   use it for binding and finding objects. How to use it, it's possible to find \r
154   in any CORBA documentation. However in SALOME there is an additional layer which \r
155   hides calls to standard interface. </p>\r
156  <p>The precise API reference for these functions you can find <a href="classSALOME__Naming Service.html">here.</a> </p>\r
157 <p>Here is a short list of public methods which are used for working with the SALOME Naming Service:</p>\r
158 <dl>\r
159 <dt><h4>Register</h4> </dt>\r
160 <dd>Method which register object reference in the naming service with given name. It makes assignment between IOR and stringified name.\r
161 Then it's possible to get object reference from name using "Resolve" method. </dd>\r
162 <br><br>\r
163 <dt><h4>Resolve</h4> </dt>\r
164   <dd>Try to obtain object reference from name. It's necessary before publishing \r
165     IOR in the Naming Service by Register method. </dd>\r
166 <br><br>\r
167 <dt><h4>Find</h4> </dt>\r
168   <dd>The purpose of this method is to research a name from the current directory \r
169     of the naming service. Then if there is occurrence the naming service changes \r
170     directory to go to the directory where last occurrence is found. </dd>\r
171 <br><br>\r
172 <dt><h4>CreateDirectory</h4> </dt>\r
173 <dd>This method allows to create one or several directories in the current directory</dd>\r
174 <br><br>\r
175 <dt><h4>ChangeDirectory</h4> </dt>\r
176 <dd>Moves the current directory. The current directory is moved to the root directory if the input parameter <i>Name</i> is "/".</dd>\r
177 <br><br>\r
178 <dt><h4>CurrentDirectory</h4> </dt>\r
179 <dd>Method allowing to get the current directory.</dd>\r
180 <br><br>\r
181 <dt><h4>list</h4> </dt>\r
182 <dd>Method allowing to list and print the whole context beginning from the current context.</dd> \r
183 <br><br>\r
184 <dt><h4>list_directory</h4> </dt>\r
185 <dd>Method to get all contexts contained in the current directory.</dd> \r
186 <br><br>\r
187 <dt><h4>DestroyName</h4> </dt>\r
188 <dd>Destroys a symbolic name-object reference association.</dd>\r
189 <br><br>\r
190 <dt><h4>DestroyDirectory</h4> </dt>\r
191 <dd>Destroys an empty directory.</dd>\r
192 </dl>\r
193 \r
194 <i><a href="#cont">Back to the contents</a></i>\r
195 <br>\r
196 </body>\r
197 </html>\r