1
<?xml version="1.0" encoding="latin1" ?>
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
9
<holder>Ericsson AB, All Rights Reserved</holder>
12
The contents of this file are subject to the Erlang Public License,
13
Version 1.1, (the "License"); you may not use this file except in
14
compliance with the License. You should have received a copy of the
15
Erlang Public License along with this software. If not, it can be
16
retrieved online at http://www.erlang.org/.
18
Software distributed under the License is distributed on an "AS IS"
19
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
20
the License for the specific language governing rights and limitations
23
The Initial Developer of the Original Code is Ericsson AB.
26
<title>CosNaming_NamingContext</title>
30
<date>1997-06-10</date>
33
<module>CosNaming_NamingContext</module>
34
<modulesummary>This interface supports different bind and access functions for names in a context.</modulesummary>
36
<p>This is the object that defines name scopes, names must be unique within a
37
naming context. Objects may have multiple names and may exist in multiple
38
naming contexts. Name context may be named in other contexts and cycles are
40
<p>The type <c>NameComponent</c> used below is defined as:</p>
42
-record('CosNaming_NameComponent', {id, kind=""}).
44
<p>where <c>id</c> and <c>kind</c> are strings. </p>
45
<p>The type <c>Binding</c> used below is defined as:</p>
47
-record('CosNaming_Binding', {binding_name, binding_type}).
49
<p>where <c>binding_name</c> is a Name and <c>binding_type</c> is an enum which
50
has the values <c>nobject</c> and <c>ncontext</c>.</p>
51
<p>Both these records are defined in the file <c>CosNaming.hrl</c> and it
54
-include_lib("orber/COSS/CosNaming/CosNaming.hrl").
56
<p>There are a number of exceptions that can be returned from functions in this
58
<list type="bulleted">
60
<p>NotFound is defined as </p>
62
-record('CosNaming_NamingContext_NotFound',
63
{rest_of_name, why}). </code>
66
<p>CannotProceed is defined as </p>
68
-record('CosNaming_NamingContext_CannotProceed',
69
{rest_of_name, cxt}). </code>
72
<p>InvalidName is defined as </p>
74
-record('CosNaming_NamingContext_InvalidName', {}). </code>
77
<p>NotFound is defined as </p>
79
-record('CosNaming_NamingContext_NotFound', {}). </code>
82
<p>AlreadyBound is defined as </p>
84
-record('CosNaming_NamingContext_AlreadyBound', {}). </code>
87
<p>NotEmpty is defined as </p>
89
-record('CosNaming_NamingContext_NotEmpty', {). </code>
92
<p>These exceptions are defined in the file <c>CosNaming_NamingContext.hrl</c> and it
95
-include_lib("orber/COSS/CosNaming/CosNaming_NamingContext.hrl").
100
<name>bind(NamingContext, Name, Object) -> Return</name>
101
<fsummary>Bind a Name to an Object</fsummary>
103
<v>NameContext = #objref</v>
104
<v>Name = [NameComponent]</v>
105
<v>Object = #objref</v>
109
<p>Creates a binding of a name and an object in the naming context.
110
Naming contexts that are bound using <em>bind()</em> do not participate
111
in name resolution.</p>
115
<name>rebind(NamingContext, Name, Object) -> Return</name>
116
<fsummary>Bind an Object to the Name even if the Name already is bound</fsummary>
118
<v>NamingContext = #objref</v>
119
<v>Name = [NameComponent]</v>
120
<v>Object = #objref</v>
124
<p>Creates a binding of a name and an object in the naming context even
125
if the name is already bound. Naming contexts that are bound using
126
<em>rebind()</em> do not participate in name resolution.</p>
130
<name>bind_context(NamingContext1, Name, NamingContex2) -> Return</name>
131
<fsummary>Bind a Name to an NamingContext</fsummary>
133
<v>NamingContext1 = NamingContext2 =#objref</v>
134
<v>Name = [NameComponent]</v>
138
<p>The bind_context function creates a binding of a name and a naming context in
140
Naming contexts that are bound using <em>bind_context()</em> participate
141
in name resolution.</p>
145
<name>rebind_context(NamingContext1, Name, NamingContex2) -> Return</name>
146
<fsummary>Bind an NamingContext to the Name even if the Name already is bound</fsummary>
148
<v>NamingContext1 = NamingContext2 =#objref</v>
149
<v>Name = [NameComponent]</v>
153
<p>The rebind_context function creates a binding of a name and a naming context in
154
the current context even if the name already is bound.
155
Naming contexts that are bound using <em>rebind_context()</em> participate
156
in name resolution.</p>
160
<name>resolve(NamingContext, Name) -> Return</name>
161
<fsummary>Retrieve an Object bound to Name</fsummary>
163
<v>NamingContext = #objref</v>
164
<v>Name = [NameComponent]</v>
165
<v>Return = Object</v>
166
<v>Object = #objref</v>
169
<p>The resolve function is the way to retrieve an object bound to a name in
170
the naming context. The given name must match exactly the bound name. The
171
type of the object is not returned, clients are responsible for narrowing
172
the object to the correct type.</p>
176
<name>unbind(NamingContext, Name) -> Return</name>
177
<fsummary>Remove the binding for a Name</fsummary>
179
<v>NamingContext = #objref</v>
180
<v>Name = [NameComponent]</v>
184
<p>The unbind operation removes a name binding from the naming context.</p>
188
<name>new_context(NamingContext) -> Return</name>
189
<fsummary>Create a new NamingContext</fsummary>
191
<v>NamingContext = #objref</v>
192
<v>Return = #objref</v>
195
<p>The new_context operation creates a new naming context.</p>
199
<name>bind_new_context(NamingContext, Name) -> Return</name>
200
<fsummary>Create a new NamingContext and bind it to a Name</fsummary>
202
<v>NamingContext = #objref</v>
203
<v>Name = [NameComponent]</v>
204
<v>Return = #objref</v>
207
<p>The new_context operation creates a new naming context and binds it to
208
Name in the current context.</p>
212
<name>destroy(NamingContext) -> Return</name>
213
<fsummary>Destroy a NamingContext</fsummary>
215
<v>NamingContext = #objref</v>
219
<p>The destroy operation disposes the NamingContext object and removes it from the
220
name server. The context must be empty e.g. not contain any bindings to be
225
<name>list(NamingContext, HowMany) -> Return</name>
226
<fsummary>List returns a all bindings in the context</fsummary>
228
<v>NamingContext = #objref</v>
229
<v>HowMany = int()</v>
230
<v>Return = {ok, BindingList, BindingIterator}</v>
231
<v>BindingList = [Binding]</v>
232
<v>BindingIterator = #objref</v>
235
<p>The list operation returns a BindingList with a number of bindings up-to
236
HowMany from the context. It also returns a BindinIterator which can be used to
237
step through the list. If the total number of existing bindings are less
238
than, or equal to, the <c>HowMany</c> parameter a NIL object reference
242
<p>One must destroy the BindingIterator, unless it is a NIL object
243
reference, by using 'BindingIterator':destroy(). Otherwise one can get
244
dangling objects.</p>