Discussion:
[omniORB] programmitcally start-stop naming server
Kent Gibson
2007-09-27 18:33:52 UTC
Permalink
Is there any way that I can start and stop the naming
service (omniNames) programmatically?

Or can I somehow do without the naming service? and if
so how?

What I want to do is start everything up in one
windows dll. And then hopefully also shut everything
down in one dll.

This is what I am doing now:

orb = CORBA::ORB_init(x, &test);
CORBA::Object_var obj =
orb->resolve_initial_references("RootPOA");
PortableServer::POA_var poa =
PortableServer::POA::_narrow(obj);
Echo_i* myecho = new Echo_i();
PortableServer::ObjectId_var myechoid =
poa->activate_object(myecho);
// Obtain a reference to the object, and register it
in
// the naming service.
obj = myecho->_this();
CORBA::String_var x;
x = orb->object_to_string(obj);
cout << x << endl;
if( !bindObjectToName(orb, obj) )
{
return "unable to bind";
}

myecho->_remove_ref();
PortableServer::POAManager_var pman =
poa->the_POAManager();
pman->activate();
orb->run();

Any help would be grand.

thanks.




____________________________________________________________________________________
Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
http://tv.yahoo.com/
Tahar Ouhrouche
2007-09-27 18:40:07 UTC
Permalink
Kent,
I believe you can do that by running the omninames service programmatically
by running it in a process that you create and destroy when your work is
done.


Best Regards,


Tahar.
Post by Kent Gibson
Is there any way that I can start and stop the naming
service (omniNames) programmatically?
Or can I somehow do without the naming service? and if
so how?
What I want to do is start everything up in one
windows dll. And then hopefully also shut everything
down in one dll.
orb = CORBA::ORB_init(x, &test);
CORBA::Object_var obj =
orb->resolve_initial_references("RootPOA");
PortableServer::POA_var poa =
PortableServer::POA::_narrow(obj);
Echo_i* myecho = new Echo_i();
PortableServer::ObjectId_var myechoid =
poa->activate_object(myecho);
// Obtain a reference to the object, and register it
in
// the naming service.
obj = myecho->_this();
CORBA::String_var x;
x = orb->object_to_string(obj);
cout << x << endl;
if( !bindObjectToName(orb, obj) )
{
return "unable to bind";
}
myecho->_remove_ref();
PortableServer::POAManager_var pman =
poa->the_POAManager();
pman->activate();
orb->run();
Any help would be grand.
thanks.
____________________________________________________________________________________
Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
http://tv.yahoo.com/
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
--
Tahar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070927/2fc44d89/attachment.htm
renny.koshy at rubixinfotech.com ()
2007-09-27 20:51:14 UTC
Permalink
Kent -

We use a distributed architecture for our software... but the components
are themselves pretty static (i.e. once they're installed, they don't move
around much)... so, we use the INSPOA in our code to provide a specific
PORT/IP and name under which the server objects will respond. Then the
corbaloc URI is stored in each client module's ".ini" or properties file.

Regards,

Renny Koshy
President & CEO

--------------------------------------------
RUBIX Information Technologies, Inc.
www.rubixinfotech.com



Kent Gibson <***@yahoo.com>
Sent by: omniorb-list-***@omniorb-support.com
09/27/2007 08:33 AM

To
omniorb-***@omniorb-support.com
cc

Subject
[omniORB] programmitcally start-stop naming server






Is there any way that I can start and stop the naming
service (omniNames) programmatically?

Or can I somehow do without the naming service? and if
so how?

What I want to do is start everything up in one
windows dll. And then hopefully also shut everything
down in one dll.

This is what I am doing now:

orb = CORBA::ORB_init(x, &test);
CORBA::Object_var obj =
orb->resolve_initial_references("RootPOA");
PortableServer::POA_var poa =
PortableServer::POA::_narrow(obj);
Echo_i* myecho = new Echo_i();
PortableServer::ObjectId_var myechoid =
poa->activate_object(myecho);
// Obtain a reference to the object, and register it
in
// the naming service.
obj = myecho->_this();
CORBA::String_var x;
x = orb->object_to_string(obj);
cout << x << endl;
if( !bindObjectToName(orb, obj) )
{
return "unable to bind";
}

myecho->_remove_ref();
PortableServer::POAManager_var pman =
poa->the_POAManager();
pman->activate();
orb->run();

Any help would be grand.

thanks.





____________________________________________________________________________________
Tonight's top picks. What will you watch tonight? Preview the hottest
shows on Yahoo! TV.
http://tv.yahoo.com/


_______________________________________________
omniORB-list mailing list
omniORB-***@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070927/21ac5945/attachment.htm
Loading...