Hi!

Dan OConnor wrote:
> We know which protocol each client in the chain uses.  Why can't
> we substitute the correct EJBObject (based on the protocol) at
> each stage?  

It's not that simple. The mapping from an EJBObject with one protocol to
another one is non-trivial (impossible even without some API or
similar).

> For instance, we know that session A uses protocol
> Bar  to access session B, so we return a bar-protocol EJBObject
> to session A.  Now when session A returns this EJBObject to the
> client, we again know that the client uses protocol Foo, so we
> substitute the correct foo-protocol EJBObject as the returned
> object.  It seems to me that this would be possible to implement
> using, for instance, the serialization replacement mechanism.
> When we serialize an EJBObject we check the protocol that the
> destination uses and substitute the correct instance.  (Obviously
> this method wouldn't work with the pass-by-reference optimization,
> and the deployer would need to be aware of this and use
> consistent protocols for beans using this optimization.)

Yes, if things were fairly simple that would work. Problem is that the
state of one EJBObject cannot be easily transferred into the equivalent
state of another EJBObject. Impossible even.

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com

Reply via email to