[aspectwerkz-dev] [jira] Deleted: (AW-73) Make introduction target objects implement Externalizable

"[email protected] (JIRA)" <jira-yCVjj/[email protected]> Fri, 3 Aug 2007 07:08:53 +1000 (EST)
Newsgroups gmane.comp.java.aspectwerkz.devel
Message-ID <[email protected]>
     [ http://jira.codehaus.org/browse/AW-73?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

[email protected] deleted AW-73:
--------------------------------


> Make introduction target objects implement Externalizable
> ---------------------------------------------------------
>
>                 Key: AW-73
>                 URL: http://jira.codehaus.org/browse/AW-73
>             Project: AspectWerkz
>          Issue Type: New Feature
>            Reporter: Carlos Villela
>
> Currently, there is a big problem when serializing introduced objects with AspectWerkz, as the target object doesnt contain any references to the mixins. Thus, mixin instance data is not serialized together with the object, rendering serialization a bit useless.
> Jonas, Chris and I chatted a lot about this, and one of the best solutions so far was to create a special introduction that implements Externalizable for all objects. This introduction needs to implement two metods, readExternal and writeExternal, and here's a little sketch of what they might look like:
> public void writeExternal(ObjectOutput out) {
>   // get the target object for this introduction
>   Object target = getTargetObject();
>   // serialize the object normally
>   out.writeObject(target);
>   // get a collection of instances of advices and introductions
>   // applied to this object
>   Collection mixins = AspectWerkz.getIntroductionsFor(
>                          ((Identifiable)target).getUuid());
>   Collection advices = AspectWerkz.getAdvicesFor(
>                          ((Identifiable)target).getUuid());
>   out.writeObject(mixins);
>   out.writeObject(advices);
> }
> public void readExternal(ObjectInput in) {
>   // unserialize the target object normally
>   Object target = in.readObject();
>   // unserialize mixins and advice collections
>   Collection mixins = (Collection) readObject();
>   Collection advices = (Collection) readObject();
>   // get the UUID of this object - look inside the just-unserialized
>   // introductions, get the Identifiable instance, and get its UUID?
>   String uuid = getUuid(advices);
>   // reconfigure AspectWerkz with the advices and mixin instances
>   AspectWerkz.setIntroductionsFor(uuid, mixins);
>   AspectWerkz.setAdvicesFor(uuid, advices);
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

    http://xircles.codehaus.org/manage_email