Discussion:
[omniORB] Problems registering names in omniORB
José Felix
2007-01-11 19:04:49 UTC
Permalink
Hi, everbody
I neeed some instruction about the implementation of omniORB 4.0. In
this project we use Windows and Visual Studio C++ Express.
If the server where omniNames.exe is running gets down, the
application must not stop. We have to find a way of having the server
replicated locally in each machine, or to make the components
registered in the environment that stop be able to register in a local
environment.
OmniORB doesn't seen to let this happen. Once we bind the object to a
certain name in the CORBA environment, even changing the server name
in the windows registry doesn't work to change the server while the
application is running. We have to restart the application for this
strategy to work.
Alternatively, I have read somewhere that IMR could help me doing
similar stuff, but I don't find much information about it. Can
somebody help me?

Thanks in advance,

F?lix Ladeia Rodrigues - Electric engineer
University of S?o Paulo
Escola Polit?cnica de S?o Paulo

Digital Television Laboratory

S?o Paulo - Brasil
Tuyen Chau
2007-01-12 21:53:56 UTC
Permalink
Post by José Felix
Hi, everbody
I neeed some instruction about the implementation of omniORB 4.0. In
this project we use Windows and Visual Studio C++ Express.
If the server where omniNames.exe is running gets down, the
application must not stop. We have to find a way of having the server
replicated locally in each machine, or to make the components
registered in the environment that stop be able to register in a local
environment.
OmniORB doesn't seen to let this happen. Once we bind the object to a
certain name in the CORBA environment, even changing the server name
in the windows registry doesn't work to change the server while the
application is running. We have to restart the application for this
strategy to work.
Alternatively, I have read somewhere that IMR could help me doing
similar stuff, but I don't find much information about it. Can
somebody help me?
Thanks in advance,
I may have misunderstood your requirements but if you want to
dynamically change the DefaultInitRef parameter in order to connect to a
different omniNames, you can use the internal function setFromFile().
Here's how we use it to talk to differerent omniNames. We don't even
need to specify DefaultInitRef in the registry or the omniORB config file.

// Set up the name to find the NameService. This is actually an
// internal call we discovered from looking around the omniORB code.
sprintf(corbaName, "corbaname::%s", hostName);
omni::omniInitialReferences::setFromFile("NameService", corbaName);

// Obtain a reference to the root context of the Name service
obj = orb->resolve_initial_references("NameService");

// Narrow the reference returned.
rootContext = CosNaming::NamingContext::_narrow(obj);

Hope this helps,
Tuyen
Duncan Grisby
2007-01-14 20:12:58 UTC
Permalink
Post by José Felix
I neeed some instruction about the implementation of omniORB 4.0. In
this project we use Windows and Visual Studio C++ Express.
If the server where omniNames.exe is running gets down, the
application must not stop. We have to find a way of having the server
replicated locally in each machine, or to make the components
registered in the environment that stop be able to register in a local
environment.
OmniORB doesn't seen to let this happen. Once we bind the object to a
certain name in the CORBA environment, even changing the server name
in the windows registry doesn't work to change the server while the
application is running. We have to restart the application for this
strategy to work.
Alternatively, I have read somewhere that IMR could help me doing
similar stuff, but I don't find much information about it. Can
somebody help me?
I'm afraid I don't understand what you are asking. What precisely do you
want to happen? omniNames is just a simple CORBA server, just like any
other CORBA server you might write. It is not a fundamental part of
running a CORBA system.

Perhaps you could explain the structure of your application so we can
understand what you want to achieve.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Duncan Grisby
2007-01-14 20:16:04 UTC
Permalink
Post by Tuyen Chau
I may have misunderstood your requirements but if you want to
dynamically change the DefaultInitRef parameter in order to connect to
a different omniNames, you can use the internal function
setFromFile(). Here's how we use it to talk to differerent omniNames.
We don't even need to specify DefaultInitRef in the registry or the
omniORB config file.
// Set up the name to find the NameService. This is actually an
// internal call we discovered from looking around the omniORB code.
sprintf(corbaName, "corbaname::%s", hostName);
omni::omniInitialReferences::setFromFile("NameService", corbaName);
// Obtain a reference to the root context of the Name service
obj = orb->resolve_initial_references("NameService");
// Narrow the reference returned.
rootContext = CosNaming::NamingContext::_narrow(obj);
If you just want to contact a different naming service to the one set in
the registry or configuration file, you don't need to use any internal
omniORB functions. Just give the corbaname URI to string_to_object:

sprintf(corbaName, "corbaname::%s", hostName);
obj = orb->string_to_object(corbaName);
rootContext = CosNaming::NamingContext::_narrow(obj);

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...