You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Christopher Oliver <re...@verizon.net> on 2003/10/25 03:38:39 UTC
Re: Serializing Rhino continuations?
Hi Steve,
I don't think that approach will work very well. Although it is possible
to serialize continuations, I think it is unlikely to work in most
cases. The continuation brings in all variables accessible in its scope
- many such objects will likely not be serializable. In addition, you
must exclude built-in Rhino objects. You can accomplish this by
overriding the resolveObject() and replaceObject() methods of
ObjectInputStream and ObjectOutputStream to not serialize such objects
in the source VM and to bind them to their equivalent versions in the
target VM's instance of Rhino (see the org.mozilla.javascript.serialize
package for an example of how to do this).
Finally, serializing entire continuations is likely to very expensive.
A proper replication architecture would only propagate state changes
between servers, not an entire copy of a state.
Regards,
Chris
Steve K wrote:
> Hi Christopher --
>
> I am currently attempting to implement a version of Cocoon's
> ContinuationsManager that will replicate the continuations among a web
> cluster using JavaGroups. In order for this to work, I need to be
> able to serialize the Continuation objects across machines. However,
> even though Continuation extends a Serializable class, and its only
> member variable implements Serializable as well, I am getting
> NotSerializableExceptions when I try to serialize the object.
>
> I am not an expert on these things and I was wondering if you had any
> idea how to do this, and more importantly, if this is even possible.
>
> Thank you for help help!
>
> cheers,
> -steve
>
>
>