Discussion:
[omniORB] How to check the NameService for existing services
R. P. Janaka
2008-08-05 15:19:19 UTC
Permalink
Hi all,

Do I have a way to check the NameService for already existing services
before registering a new service.

Because I am having a problem when I am going to register a new service with
the NameService.
--
Regards,
R. P. Janaka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080805/b60dad56/attachment.htm
Nigel Rantor
2008-08-05 15:40:16 UTC
Permalink
Post by R. P. Janaka
Hi all,
Do I have a way to check the NameService for already existing services
before registering a new service.
Because I am having a problem when I am going to register a new service
with the NameService.
Well, a server that wishes to register itself may make just the same
calls that a client would to look up that name so before trying to bind
you could look up the name you intend to bind to.

Alternatively you can decide to overwrite the currently bound object
reference using the "rebind" operation.

n
Martin Trappel
2008-08-05 17:38:28 UTC
Permalink
Post by R. P. Janaka
Hi all,
Do I have a way to check the NameService for already existing services
before registering a new service.
Because I am having a problem when I am going to register a new service
with the NameService.
I have one Server where the inital registration with the NamingService
works as outlined in this pseudocode:

*) CosNaming::NamingContext -> bind(name, server_object)
*) catch(CosNaming::NamingContext::AlreadyBound Exception) =>
*) test_object = CosNaming::NamingContext -> resolve(name)
*) try {
*) bool does_not_exist = test_object->_non_existant();
*) } catch(CORBA::Exception&) {
*) bool does_not_exist = true;
*) }
*) if(does_not_exist) =>
*) CosNaming::NamingContext -> rebind(name, server_object)


br,
Martin

Loading...