[omniORB] BOA -> POA questions

Stefan Seefeld seefelds@MAGELLAN.UMontreal.CA
Sun, 16 Jul 2000 22:40:13 -0400


I'm trying to port berlin's source code to the POA 
architecture. Now I'm looking for an equivalent of
the servant->_dispose() call. What I came up with looks so:

static void destroy(PortableServer::Servant servant)
{
  PortableServer::POA_var poa = servant->_default_POA();
  PortableServer::ObjectId_var oid = poa->servant_to_id(servant);
  poa->deactivate_object(oid);
}

I use the default POA, i.e. implicit activation. My servants
are derived from PortableServant::RefCountServantBase.
I would hope that the above code results in the object being
deactivated and the servant being deleted.
Could you please confirm this ?

Looking through your example code in
http://www.uk.research.att.com/omniORB/doc/3.0/omniORB/omniORB002.html#toc9

I find a call to myecho->_remove_ref() which I don't understand.
Given that the call to _this() increments the ref counter and sets it
to 1, I would think that a call to 'deactivate_object' sets it back to
0, resulting in the deletion.
Is the explicit call to _remove_ref() a replacement for the object deactivation ?
>From my understanding this call would result in the servant's destuction
*immediately* since the ref counter is zero. What am I missing ?

Thanks,	Stefan

PS: is the Servant::_PD_repoId member portable ? I couldn't find any
    mention of how to access the repoId from a given interface C++ 
    type...
_______________________________________________________              
              
Stefan Seefeld
Departement de Physique
Universite de Montreal
email: seefelds@magellan.umontreal.ca

_______________________________________________________

      ...ich hab' noch einen Koffer in Berlin...