[omniORB] Using multiple ORBs with Python

baileyk@schneider.com baileyk@schneider.com
Mon Apr 28 16:45:03 2003


You don't need to create two orb instances (which omniORB can't do) to
interact with two naming services.  Just use string_to_object() on each
root context's URL or IOR and go:

import CORBA, sys, CosNaming

orb = CORBA.ORB_init(sys.argv)
nameserviceA = orb.string_to_object('corbaname::127.0.0.1:5555')
nameserviceB = orb.string_to_object('corbaname::10.66.18.28:5555')
nsa = nameserviceA._narrow( CosNaming.NamingContext )
nsb = nameserviceB._narrow( CosNaming.NamingContext )

[...]

Could you describe what the bridge is going to do besides contact two name
services?  Is that the only reason you wanted two orb instances?



Kendall




                                                                                                                                       
                      kilobug@freesurf.fr (Gaël                                                                                        
                      Le Mignot)                         To:       omniorb-list@omniorb-support.com                                    
                      Sent by:                           cc:                                                                           
                      omniorb-list-admin@omniorb-        Fax to:                                                                       
                      support.com                        Subject:  [omniORB] Using multiple ORBs with Python                           
                                                                                                                                       
                                                                                                                                       
                      04/28/2003 10:16 AM                                                                                              
                                                                                                                                       
                                                                                                                                       





Hello,

I'm trying to create a "bridge" between two sets of CORBA program.
Each set has a running naming service. I'm trying to do something
like:

class myorb:
      def __init__ (self, options):
          self.orb = CORBA.ORB_init(options, ORBA.ORB_ID)
          obj = self.orb.resolve_initial_references("NameService")
          self.root_context = obj._narrow(CosNaming.NamingContext)

myorb1 = myorb(['bridge', '-ORBInitRef',
'NameService=corbaname::127.0.0.1:5555'])
myorb2 = myorb(['bridge', '-ORBInitRef',
'NameService=corbaname::10.66.18.28:5555', '-ORBpoa_iiop_name_port',
'10.66.18.25' ] )

But  both   root  context  are   the  same  (the  naming   service  at
127.0.0.1). Is there a way to do what I try to do ?

Thank you for answering,

--
Gael Le Mignot "Kilobug" - kilobug@nerim.net - http://kilobug.free.fr
GSM         : 06.71.47.18.22 (in France)   ICQ UIN   : 7299959
Fingerprint : 1F2C 9804 7505 79DF 95E6 7323 B66B F67B 7103 C5DA

Member of HurdFr: http://hurdfr.org - The GNU Hurd: http://hurd.gnu.org
_______________________________________________
omniORB-list mailing list
omniORB-list@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list