[omniORB] omniEvents pushsupp.cc vs pushsupp.py CORBA.BAD_PARAM

Duncan Grisby dgrisby@uk.research.att.com
Wed, 13 Feb 2002 09:55:26 +0000


On Tuesday 12 February, Chris McClimans wrote:

> # Make a PushSupplier Class and instance
> class Supplier_i(CosEventComm.PushSupplier):
>     def __init__(self):
>         pass
>     def disconnect_push_supplier(self):
>         print "EventSupplier: disconnectied."
> 
> supplier = Supplier_i()
[...]
> # here is where we get a CORBA.BAD_PARAM
> proxy_consumer.connect_push_supplier(supplier)

supplier is a _servant_, i.e. a programming language object. It is not
a CORBA object. You must activate the object in a POA, and use the
resulting object reference instead. Use something like

  # Get the root POA
  poa = orb.resolve_initial_references("RootPOA")

  # Activate the POA so it services incoming requests
  poa._get_the_POAManager().activate()

  # Activate our servant in the POA
  poa.activate_object(supplier)
  
  # Get the resulting object reference
  supplier_obj = supplier._this()

  # Use the objref
  proxy_consumer.connect_push_supplier(supplier_obj)


Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --