[omniORB] How can I wait for object deactivation with deactivate_object() ?

Duncan Grisby duncan at grisby.org
Thu Jan 6 12:07:59 GMT 2011


On Mon, 2011-01-03 at 17:41 +0100, Martin B. wrote:

> I'm using the omniINSPOA to activate one CORBA object, but at the point 
> where I want to "destroy" the object I want only to deactivate this 
> object but keep the omniINSPOA running.
> 
> For objects in "normal" POA, I have always simply used
>    ...
>    PortableServer::POAManager_var pman ...
>    pman->deactivate(true, true);
>    ...
> to simply wait for all objects and destroy them (implicitly via 
> ServantBase::_remove_ref())
> 
> Now, if I do not want to destroy the POA (manager), I can only call 
> deactivate_object(..) for my omniINS object, but this does not allow for 
> waiting until all requests have terminated.

Do you really need to wait for deactivation?  If you're just waiting so
you can call _remove_ref at the right time, you can just call
_remove_ref at any point earlier, and then when the object is
deactivated the POA will call _remove_ref and trigger deletion of the
servant.

If you really want to know, the way to do it is to provide your own
_remove_ref implementation so you know when the POA calls it.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --





More information about the omniORB-list mailing list