In the code that I just submitted to Charlie, deserializing an object (or faulting it in from our object database) brings with it an incomplete copy of the object's metaclass. The metaclass reinitializes its methods, superclass, parent, dispatcher, marshal, and allocator lazily. So we end up having two equal metaclasses ... the one that instantiated the object before it was serialized, and the new one that gives the deserialized object access to its lookup chain. Ideally, we would reattach the object to its original and gc the serialized one. To do this from the new metaclass, we would need to get ahold of the sender in the metaclass's lazy initializers. As soon as we recognize that we are executing in a deserialized metaclass (there is a transient boolean 'loadedByRuntime' that tells us that), we would get the sender, use the runtime to look up the original metaclass, and hook them up. I know that there is no native support for getting the sender of a method in Java, but does JRuby have anything that will help?

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to