[omniORB] omniINSPOA and bidir connections (omniORB4)

baileyk@schneider.com baileyk@schneider.com
Fri Sep 6 17:42:01 2002


I've just looked over the omniMapper source.  It doesn't use a servant
manager.  It has a dedicated servant for each id -> ref mapping.  Probably
for good reason, so you may want to duplicate this.  As a result it uses
the omniORB::LOCATION_FORWARD exception which is non-standard.  However,
the omniINSPOA is non-standard too, so you might as well use it.  This all
assumes the children of omniINSPOA don't inherit the magic property that
the omniINSPOA has.

Embedding omniMapper functionality in a server should satisfy Yashik's need
for combined specialized POA and INS functionality at the same time too.

Kendall



                                                                                                                       
                    "Rob Eger"                                                                                         
                    <reger@txcorp.com>                 To:     "omniORB" <omniorb-list@omniorb-support.com>            
                    Sent by:                           cc:                                                             
                    omniorb-list-admin@omniorb-s       Fax to:                                                         
                    upport.com                         Subject:     [omniORB] omniINSPOA and bidir connections         
                                                        (omniORB4)                                                     
                                                                                                                       
                    09/06/2002 10:41 AM                                                                                
                                                                                                                       
                                                                                                                       




I've gotten a simple hello app working with omniINSPOA in order to use
corbaloc from the client, but now I want to make it work
bidirectionally.  I started with the bidir example code from omniORB4
and tried to alter it to use omniINSPOA as shown in the code below.


      CORBA::Object_var obj =
orb->resolve_initial_references("omniINSPOA");
      PortableServer::POA_var insPOA =
PortableServer::POA::_narrow(obj);
      PortableServer::POAManager_var pman = insPOA->the_POAManager();
      pman->activate();

     // Create a POA with the Bidirectional policy
      CORBA::PolicyList pl;
      pl.length(1);
      CORBA::Any a;
      a <<= BiDirPolicy::BOTH;
      pl[0] = orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE,
a);

      PortableServer::POA_var bidirPOA = insPOA->create_POA("BiDirPOA",
pman, pl);

      PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId("bidirHello");

      server_i* myserver = new server_i();

      bidirPOA->activate_object_with_id(oid.in(), myserver);


It throws a BAD_PARAM (InvalidSystemId) exception on the last line.  If
I change the last line to:

           insPOA->activate_object_with_id(oid.in(), myserver);

it works, but not bidirectionally obviously.  I can get the same app to
work bidirectionally if I change it to use the IOR and RootPOA, but we'd
prefer to not make the client use IOR, and we'd like to avoid using the
NameService (one less service needing to run).

Ideas?

Thanks for your help,
Rob.


------------------------------------------------------
 Rob Eger           | email: reger@txcorp.com
 Tech-X Corporation | voice: 303.444.2451
 Boulder, CO        |   fax: 303.448.7756
                    |   www: http://www.techxhome.com
------------------------------------------------------


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