All ORB NamingContext
's implement
two additional methods as specified by the IDL below:
/** * Extended Naming Context. */ interface NamingContext : ::CosNaming::NamingContextExt { void add(in ::CosNaming::Name n, in Object obj) raises( NotFound, CannotProceed, InvalidName, AlreadyBound); void add_context(in ::CosNaming::Namen, in ::CosNaming::NamingContext nc) raises(NotFound, CannotProceed, InvalidName, AlreadyBound); };
The add
method is used to bind more than one object with
a given name. That is, you can invoke the method multiple times and bind
multiple objects with the same name to form an Object Group. When
a NamingContext
object has no binding with the given name,
add
is equivalent to a bind
.
The add_context
method is used to bind more than one
NamingContext
's with a given name. That is, you can invoke the method multiple
times and bind contexts with the same name to form a Context Group.
When a NamingContext
object has no bindings with the given name,
add_context
is equivalent to a bind_context
.
When the client resolves a name, one of the objects with the given name is returned back providing load balancing and fault tolerance.
In this example we will bind multiple objects to the same name in the namespace. Everytime the client resolves the name, it can potentially get a different object.
Copyright © 2003, 2004 Novell, Inc. All rights reserved. Copyright © 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.