[omniORB] Using the _this method on activated servants

Brenneis, Steve steve.brenneis@attws.com
Mon, 10 Dec 2001 14:47:24 -0500


Thanks for the response, Duncan. I agree on the problem with the standard.
OMG leaves gaping holes in the language mapping regarding the _this method.

Assuming we are discussing the case outside the context of an object request
and in the case where the servant is activated in a single child POA, but
the servant does not have an overridden _default_POA method, would omniORB
activate the servant in the root POA since the default activation policy for
the root is IMPLICIT_ACTIVATION?

Steve Brenneis
WebAXE Middleware Lead Developer
AT&T Wireless Services


> -----Original Message-----
> From: Duncan Grisby [mailto:dgrisby@uk.research.att.com]
> Sent: Monday, December 10, 2001 2:35 PM
> To: Brenneis, Steve
> Cc: 'omniorb-list@uk.research.att.com'
> Subject: Re: [omniORB] Using the _this method on activated servants 
> 
> 
> On Monday 10 December, "Brenneis, Steve" wrote:
> 
> > I am curious to know if anyone has tried using the 
> Servant::_this method on
> > a servant that has been activated in a child POA. What does 
> omniORB return?
> > Assume the child POA does not have an IMPLICIT_ACTIVATION 
> policy and that
> > the implementation has not overridden _default_POA. What 
> happens if the
> > servant is activated in multiple POA's? What does _this 
> return in that case?
> 
> If you call _this() in the context of an operation invocation, it
> should always return the object reference being used for the
> invocation, regardless of the POA policies. That requires support for
> PortableServer::Current, so omniORB 3 does not do that. omniORB 4
> does.
> 
> Outside the context of an operation invocation (or all the time in
> omniORB 3), if the servant has a single activation, the object for
> that activation is returned. If it has more than one activation, or it
> is not activated at all, the POA returned by _default_POA() is looked
> at. If the servant hasn't overridden _default_POA(), the Root POA is
> used.
> 
> If the servant is activated in the default POA, and the POA has the
> single id policy, the existing activation is returned. If the servant
> is not activated in the POA or the POA has the multiple id policy,
> _and_ the POA has the implicit activation policy, a new activation is
> made. Otherwise PortableServer::WrongPolicy is thrown.
> 
> The basic message is that _this() is a horrible mess, and you're best
> to avoid it. Don't blame omniORB -- it's all specified in the
> standard. :-)
> 
> Cheers,
> 
> Duncan.
> 
> -- 
>  -- Duncan Grisby  \  Research Engineer  --
>   -- AT&T Laboratories Cambridge          --
>    -- http://www.uk.research.att.com/~dpg1 --
>