[omniORB] How do you implement callbacks?

Morris, Steve (SW/FW - Rehovot) morris at hp.com
Mon Jan 7 11:53:49 GMT 2008


How do you implement callbacks?

The IDL has the following code:

module iPC_API {
    interface iPC_API_WatchDogObserver { boolean connectionAlive();};

    interface iPC_Connect : PropertyManager {
        exception UnableToConnect {wstring why;};
        iPC_Device connectToiPCDevice(in iPC_API_WatchDogObserver watchDogObserver)  raises (UnableToConnect);
    }
}

I derive a class from iPC_API_WatchDogObserver and define its method
class iPCWatchdogObserver(iPC_API__POA.iPC_API_WatchDogObserver):
    def connectionAlive(self):
        return True

I create an instance of iPCWatchdogObserver
    self.watchdogObserver = iPCWatchdogObserver()

I call connectToiPCDevice() with the
    iPCDevice = self.iPCConnect.connectToiPCDevice(self.watchdogObserver)

I get the following exception
'Traceback (most recent call last):
  File "C:\\projects\\JobPreview\\JobPreviewFrame.py", line 477, in LoadJobListFromiPC
    iPCDevice = self.iPCConnect.connectToiPCDevice(self.watchdogObserver)
  File "C:\\projects\\JobPreview\\iPC_Connect_idl.py", line 3124, in connectToiPCDevice
    return _omnipy.invoke(self, "connectToiPCDevice", _0_iPC_API.iPC_Connect._d_connectToiPCDevice, args)
BAD_PARAM: CORBA.BAD_PARAM(omniORB.BAD_PARAM_WrongPythonType, CORBA.COMPLETED_NO)\n'

What am I doing wrong?

Thanks,
Steve




More information about the omniORB-list mailing list