CosNaming_NamingContext(3)
π CosNaming_NamingContext π
okay bestie, welcome to CosNaming_NamingContext β that's the Erlang module definition page, manual section 3, and she is the blueprint for naming contexts. β¨
πΈ NAME πΈ
CosNaming_NamingContext β this interface is the one that supports all the different bind and access functions for names in a context. that's it, that's her whole job. π
π¦ DESCRIPTION π¦
so like. this is the object that defines name scopes, right? and names have to be unique within a naming context. no dupes, periodt. but here's the thing β objects can have multiple names, and they can live in multiple naming contexts. and a naming context can itself be named in other contexts, and yes, cycles are permitted. it's giving nested friend groups, honestly. π₯
the type NameComponent used below is defined as:
-record('CosNaming_NameComponent', {id, kind=""}).
where id and kind are strings. π
the type Binding used below is defined as:
-record('CosNaming_Binding', {binding_name, binding_type}).
where binding_name is a Name and binding_type is an enum which has the values nobject and ncontext. π
both of these records live in the file CosNaming.hrl and you include it with:
-include_lib("orber/COSS/CosNaming/CosNaming.hrl").
and now, the β¨exceptionsβ¨ β there are a number of them that can be returned from functions in this interface. buckle up:
NotFoundis defined as
-record('CosNaming_NamingContext_NotFound',
{rest_of_name, why}).
CannotProceedis defined as
-record('CosNaming_NamingContext_CannotProceed',
{rest_of_name, cxt}).
InvalidNameis defined as
-record('CosNaming_NamingContext_InvalidName', {}).
NotFoundis defined as
-record('CosNaming_NamingContext_NotFound', {}).
AlreadyBoundis defined as
-record('CosNaming_NamingContext_AlreadyBound', {}).
NotEmptyis defined as
-record('CosNaming_NamingContext_NotEmpty', {}).
ok so yes, NotFound shows up twice in that list. that's what the original says, so that's what we're saying. no editing the lore. π
these exceptions are defined in the file CosNaming_NamingContext.hrl and you include it with:
-include_lib("orber/COSS/CosNaming/CosNaming_NamingContext.hrl").
π EXPORTS π
bind(NamingContext, Name, Object) -> Return
Types:
NameContext = #objref
Name = [NameComponent]
Object = #objref
Return = ok
creates a binding of a name and an object in the naming context. but listen β naming contexts that are bound using bind() do not participate in name resolution. so like, keep that in mind, bestie. π
rebind(NamingContext, Name, Object) -> Return
Types:
NamingContext = #objref
Name = [NameComponent]
Object = #objref
Return = ok
creates a binding of a name and an object in the naming context even if the name is already bound. it just. doesn't care. icon behaviour honestly. and same deal as bind(): naming contexts bound using rebind() do not participate in name resolution. π
bind_context(NamingContext1, Name, NamingContex2) -> Return
Types:
NamingContext1 = NamingContext2 =#objref
Name = [NameComponent]
Return = ok
the bind_context function creates a binding of a name and a naming context in the current context. and unlike the previous two?? naming contexts that are bound using bind_context() do participate in name resolution. slay. π₯
rebind_context(NamingContext1, Name, NamingContex2) -> Return
Types:
NamingContext1 = NamingContext2 =#objref
Name = [NameComponent]
Return = ok
the rebind_context function creates a binding of a name and a naming context in the current context even if the name already is bound. overachiever energy. and yes, naming contexts bound using rebind_context() participate in name resolution too. β¨
resolve(NamingContext, Name) -> Return
Types:
NamingContext = #objref
Name = [NameComponent]
Return = Object
Object = #objref
the resolve function is the way to retrieve an object bound to a name in the naming context. the given name must match the bound name exactly β no vibes-based matching, sorry. π and the type of the object is not returned, so clients are responsible for narrowing the object to the correct type. that part's on you, bestie. π«Ά
unbind(NamingContext, Name) -> Return
Types:
NamingContext = #objref
Name = [NameComponent]
Return = ok
the unbind operation removes a name binding from the naming context. bye bye binding. π
new_context(NamingContext) -> Return
Types:
NamingContext = #objref
Return = #objref
the new_context operation creates a new naming context. fresh out the box. π
bind_new_context(NamingContext, Name) -> Return
Types:
NamingContext = #objref
Name = [NameComponent]
Return = #objref
the new_context operation creates a new naming context and binds it to Name in the current context. two birds, one adorable function. π¦
destroy(NamingContext) -> Return
Types:
NamingContext = #objref
Return = ok
the destroy operation disposes the NamingContext object and removes it from the name server.
β οΈ the context must be empty β like, it must not contain any bindings β to be removed. do not try it on a full context, it's not gonna go well. π
list(NamingContext, HowMany) -> Return
Types:
NamingContext = #objref
HowMany = int()
Return = {ok, BindingList, BindingIterator}
BindingList = [Binding]
BindingIterator = #objref
the list operation returns a BindingList with a number of bindings up-to HowMany from the context. it also returns a BindinIterator which can be used to step through the list. and if the total number of existing bindings is less than, or equal to, the HowMany parameter, a NIL object reference is returned. π
Note: one must destroy theBindingIterator, unless it is aNILobject reference, by using'BindingIterator':destroy(). otherwise one can get dangling objects. seriously. dangling objects are not the vibe. π
and that's the whole page, bestie, you ate it. π
this icon was brought to you by Ericsson AB, version orber 5.2.2, and this very manual page CosNaming_NamingContext(3) β go forth and bind responsibly. πβ¨π
π¦ where this page comes from
- fedora 43: erlang-orber 1:5.2.2-1.fc43 Β· Apache-2.0
- fedora 44: erlang-orber 1:5.2.2-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms