2 Replies Latest reply on May 14, 2008 1:40 PM by Brian Stansberry

    Serialization of ProxiedStatefulBeanContext

    Brian Stansberry Master

      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.