[omniORB] distant object destruction
David Riddoch
djr@uk.research.att.com
Thu, 12 Oct 2000 10:32:33 +0100 (BST)
On Thu, 12 Oct 2000, Jean-Francois Tilman wrote:
> Our object uses implicit activation and we don't know its POA. Must we
> use the RootPOA ? to deactivate this object ? Or what must we do to know
> the used POA ? How to obtain the ObjectID to call deactivate_object()
> method ?
The ORB decides which POA to use for implicit activation by calling the
_default_POA() method on the servant. This is a virtual method, and if
you do not override the default, it will be the RootPOA.
I assume you have a pointer to the servant, so the following should work:
PortableServer::POA_var poa = servant->_default_POA();
PortableServer::ObjectId_var id = poa->servant_to_id(servant);
poa->deactivate_object(id);
Hope that helps,
David
PS. I think I've said before on this list that I think that implicit
activation is a very bad idea. Using it is a great way to make your
programs hard to follow, and to introduce bugs.