[omniORB] omniINSPOA and bidir connections (omniORB4)

baileyk@schneider.com baileyk@schneider.com
Fri Sep 6 17:30:02 2002


My guess is that you will have to implement the same redirection mechanism
that omniMapper has in your server, except your servant manager will
redirect certain object ids to corba references in the same process (but in
a bidir POA) rather than to a possible third process.  To do this, just
create a servant activator/locator which always throws ForwardRequest
exception with the IOR of the object in the bidirPOA.

I could be wrong.  Child POAs don't inherit parent POA policies, so you may
simply need to create the bidirPOA with a PortableServer::USER_ID policy in
addition to the BiDirPolicy::BOTH.  However, since policies are not
inherited, I am guessing the special nature of the omniINSPOA that allows
corbaloc URIs is not inherited either.

The source of your BAD_PARAM is definitely the lack of USER_ID policy.
Whether your approach works after fixing this up, I'm not sure.


good luck,
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