| Computers Forum Index » Computer - Object (Corba) » [Q] detecting that server is dead and removing from... |
|
Page 1 of 1 |
|
| Author |
Message |
| VSP... |
Posted: Wed Apr 22, 2009 4:34 pm |
|
|
|
Guest
|
Hello,
two questions more about how things are 'supposed' to work
a) If I have naming hierarchy such as
nm="TopLevel" kind="cluster"
|
|
nm="SecondLevel" kind="servers"
|
|
nm="MyObject" kind="servant"
Should the below code correctly get to MyObject
(in other words, is using kind="servant" necesarry).
In my tests it looks necessary -- otherwise I get NotFound.
But wanted to verify.
CORBA::Object_var obj = orb->resolve_initial_references
("NameService");
assert (!CORBA::is_nil(obj.in()));
CosNaming::NamingContext_var namingServer=
CosNaming::NamingContext::_narrow(obj);
assert (!CORBA::is_nil(namingServer));
CosNaming::Name _corbaCosName;
_corbaCosName.length(3);
_corbaCosName[0].id=CORBA::string_dup("TopLevel");
_corbaCosName[0].kind=(const char*) "cluster";
_corbaCosName[1].id=CORBA::string_dup("SecondLevel");
_corbaCosName[1].kind=CORBA::string_dup( "services");
_corbaCosName[2].id=CORBA::string_dup("MyObject");
//IS THIS Necessary?
_corbaCosName[2].kind=CORBA::string_dup("servant");
server = namingServer->resolve(_corbaCosName);
assert(!CORBA::is_nil(server.in()));
b) Second question, if I Have
properly initialized
CORBA::Object_var
can I get from it its naming context?
and with what call (in C++)
thank you in advance,
VSP
VSP |
|
|
| Back to top |
|
|
|
|