[omniORB] Multiple Inheritence and threading.Thread

Thomas A. Moulton tmoulton at eoir.com
Fri Feb 20 22:59:18 GMT 2004


I am using omniORBpy2.3.  I am writing a class that inherits from both 
an IDL generated class and threading.Thread.  I am encountering a 
situation in which I receive an exception when I try to get the object 
reference from an instance of this class.  If I don't inherit from 
threading.Thread I don't encounter this exception.  The definition of 
the class is showcased through the following code excerpt...

> class SeamsClient(SEAMS__POA.SeamsClient, threading.Thread, 
> Net.NetClient):
>     """
>     Class that implements a SEAMS Client.
>     """
>     def __init__(self, ORBargs=['-ORBInitRef', 
> 'NameService=corbaname::localhost:9999'], timeout=TIME_OUT,
>                  group=None, target=None, name='SeamsClient', args=(), 
> kwargs={}):
>         """
>         Initialize the SEAMSClient thread.
>         """
>         threading.Thread.__init__(self, group, target, name, args, kwargs)
>          # Initialize the ORB and find the root POA
>         self.orb = CORBA.ORB_init(self.ORBargs, CORBA.ORB_ID)
>         self.poa = self.orb.resolve_initial_references("RootPOA")


Code except that uses this class:

> >>> from DSIF import SEAMSClient
> >>> sci = SEAMSClient.SeamsClient()
> >>> scio = sci._this()
>
> Traceback (most recent call last):
>   File "<pyshell#9>", line 1, in -toplevel-
>     scio = sci._this()
>   File 
> "C:\Python23\Lib\site-packages\omniORBpy-2.3\lib\python\omniORB\PortableServer.py", 
> line 95, in _this
>     return _omnipy.poa_func.servantThis(self)
> BAD_PARAM: Minor: BAD_PARAM_WrongPythonType, COMPLETED_NO.

Again, if I remove threading.Thread from the inheritance list for 
SeamsClient I don't encounter an exception.  I do notice that when I do 
a repr on both instances of the SeamsClient class (i.e., the instance 
that is derived from threading.Thread and the instance not derived from 
threading.Thread) I get very different results.

Instance derived from threading.Thread:

> >>> `sci`
> '<SeamsClient(SeamsClient, initial daemon)>'


Instance not derived from threading.Thread:

> >>> `sci`
> <DSIF.SEAMSClient.SeamsClient instance at 0x00D18FA8>


Is there anyway for me to write an IDL derived class that inherits from 
threading.Thread as well?

Thanks,

Tom

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmoulton.vcf
Type: text/x-vcard
Size: 358 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20040220/992a18c6/tmoulton.vcf


More information about the omniORB-list mailing list