[omniORB] omniEvents - eventc.cc vs eventc.py

Duncan Grisby dgrisby@uk.research.att.com
Tue, 12 Feb 2002 10:20:12 +0000


On Tuesday 12 February, Chris McClimans wrote:

> criteria = [CosLifeCycle.NameValuePair('PullRetryPeriod',1),
>             CosLifeCycle.NameValuePair('MaxEventsPerConsumer',0),
>             CosLifeCycle.NameValuePair('MaxQueueLength',0)]
> 
> channel = EventChannelFactory.create_object(key,criteria) ##### This
>  Generates a BAD_PARAM

NameValuePair is a pair containing a string and an Any. You aren't
giving it Anys. You need to use something like

  NVP = CosLifeCycle.NameValuePair # Just to shorten the lines

  criteria = [NVP('PullRetryPeriod',     CORBA.Any(CORBA.TC_boolean, 1)),
	      NVP('MaxEventsPerConsumer',CORBA.Any(CORBA.TC_boolean, 0)),
	      NVP('MaxQueueLength',      CORBA.Any(CORBA.TC_boolean, 0))]

This assumes that the event channel factory wants booleans. I don't
know what it actually wants.

Cheers,

Duncan.

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