[omniORB] Resetting delegate - good idea or bad?

Andrew Parkin AndrewP@eigroup.com
Tue, 20 Feb 2001 17:04:37 -0000


Hi,

I have written a CORBA server that needs to serialize & transmit an object
passed in from a client, then retrieve that object later and execute
callbacks on it.  However, I get an error "The delegate has not been set!".

I have managed to save the delegate object before serializing the object
using the following code:

Delegate thisDlg = ((ObjectImpl)listener)._get_delegate();

I can then reset the delegate later on like this, and the callback works.

((ObjectImpl)listener)._set_delegate(thisDlg);

However, I am worried that this is not a good idea, since I don't know
whether the Delegate object is unique to each object or whether my code is
fine since there is only one Delegate object in the ORB that all objects can
share.

Can anyone please tell me whether this is ok or whether I should forget such
a stupid idea?

Thanks in advance,
Andrew Parkin