[jboss-dev-forums] [Design of EJB 3.0] - Serialization of ProxiedStatefulBeanContext

bstansberry@jboss.com do-not-reply at jboss.com
Tue May 13 16:35:44 EDT 2008


Discussion of http://jira.jboss.com/jira/browse/EJBTHREE-1355

Basic question here is how much effort we want to put into this, since all this code is meant to be replaced by EJBTHREE-1026 in 5.1.

Problem here is ProxiedStatefulBeanContext is a subclass of StatefulBeanContext, but really doesn't function as one, i.e doesn't actually use any of the fields of superclasses and overrides all methods.  Carlo added some invariant checks to the StatefulBeanContext class hierarchy and eliminated the no-arg constructors that allowed violation of those invariants.  Quite appropriate for StatefulBeanContext. But the invariants aren't quite applicable to ProxiedStatefulBeanContext, and eliminating the no-arg constructors in the class hierarchy prevents proper serialization/externalization.

A correct class design here would be to have StatefulBeanContext and ProxiedStatefulBeanContext both be unrelated impls of some common interface. But that's a lot of work.  Better IMHO to just go with the EJBTHREE-1026 solution in 5.0 before making that much effort!

I suggest for 5.0 we just restore the (protected) no arg constructors to StatefulBeanContext and superclasses, mark them as deprecated and document them as only for use by ProxiedStatefulBeanContext.  I've done that on my local checkout and most of the clustered sfsb tests now pass.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150521#4150521

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150521



More information about the jboss-dev-forums mailing list