CosNaming Overview


The CosNaming module contains all IDL definitions for the CORBA naming service. The interfaces consist of:

Use the NamingContext and BindingIterator interfaces to access standard naming service functionality. Use the NamingContextExt interface to use URLs and string representations of names.

The rest of this chapter describes data types common to the CosNaming module that are defined directly within its scope.

CosNaming::Binding Structure

// IDL 
struct Binding { 
    Name binding_name; 
    BindingType binding_type; 
}; 

A Binding structure represents a single binding in a naming context. A Binding structure indicates the name and type of the binding:

binding_name 

The full compound name of the binding.

binding_type 

The binding type, indicating whether the name is bound to an application object or a naming context.

When browsing a naming graph in the naming service, an application can list the contents of a given naming context, and determine the name and type of each binding in it. To do this, the application calls the NamingContext::list() method on the target NamingContext object. This method returns a list of Binding structures.

See Also

CosNaming::BindingList

CosNaming::BindingType 
NamingContext::list() 

CosNaming::BindingList Sequence

// IDL 
typedef sequence<Binding> BindingList; 

A sequence containing a set of Binding structures, each of which represents a single name binding.

An application can list the bindings in a given naming context using the NamingContext::list() method. An output parameter of this method returns a value of type BindingList.

See Also

CosNaming::Binding

CosNaming::BindingType  
NamingContext::list()  

About Sequences

CosNaming::BindingType Enumeration

// IDL 
enum BindingType {nobject, ncontext}; 

The enumerated type BindingType represents these two forms of name bindings:

nobject

Describes a name bound to an application object.

ncontext

Describes a name bound to a naming context in the naming service.



There are two types of name binding in the CORBA naming service: names bound to application objects, and names bound to naming contexts. Names bound to application objects cannot be used in a compound name, except as the last element in that name. Names bound to naming contexts can be used as any component of a compound name and allow you to construct a naming graph in the naming service.

Name bindings created using NamingContext::bind() or NamingContext::rebind() are nobject bindings.

Name bindings created using the operations NamingContext::bind_context() or NamingContext::rebind_context() are ncontext bindings.

See Also

CosNaming::Binding

CosNaming::BindingList 

CosNaming::Istring Data Type

// IDL 
typedef string Istring; 

Type Istring is a place holder for an internationalized string format.

CosNaming::Name Sequence

// IDL 
typedef sequence<NameComponent> Name; 

A Name represents the name of an object in the naming service. If the object name is defined within the scope of one or more naming contexts, the name is a compound name. For this reason, type Name is defined as a sequence of name components.

Two names that differ only in the contents of the kind field of one NameComponent structure are considered to be different names.

Names with no components, that is sequences of length zero, are illegal.

See Also

CosNaming::NameComponent

About Sequences

CosNaming::NameComponent Structure

// IDL 
struct NameComponent { 
    Istring id; 
    Istring kind; 
}; 

A NameComponent structure represents a single component of a name that is associated with an object in the naming service. The members consist of:

id 

The identifier that corresponds to the name of the component.

kind 

The element that adds secondary type information to the component name.



The id field is intended for use purely as an identifier. The semantics of the kind field are application-specific and the naming service makes no attempt to interpret this value.

A name component is uniquely identified by the combination of both id and kind fields. Two name components that differ only in the contents of the kind field are considered to be different components.

See Also

CosNaming::Name