Hi,

Another separate topic after work at weekend.

I need my objects to be serialized. I also need to introduce Identificable 
implementation to every of them, to give them OID. I did this by introducing 
IdentificableMixin:

  | public class IdentificableMixin...
  | {
  |     private Long oid;
  |     private void setOID(...
  |     private Long getOID(...
  | }

After logging few lost hours it happened that (by checking decompiled class) JBossAOP 
introduces this mixin to the class as a field and makes it transient. Decompiled 
sample:

  |    private transient IdentificableMixin 
_my$demo$getOID$IdentificableStringMixin$aop$mixin;
  |  

Unfortunately for me it happend to be _transient_ which doesn't serialize. So my app 
magically didn't work :/.

For my app I need mixin fields to be normal - not transient.

I found 2 places in JBossAOP code which I think are responsible for that:

jboss.aop.instrument.Instrumentor:
  | 
  |     private CtField addProtectedField(...
  |     {....
  |     field.setModifiers(Modifier.PROTECTED | Modifier.TRANSIENT);
  | 
  |     private CtField addPrivateField(....
  |    {
  |     ....
  |     field.setModifiers(Modifier.PRIVATE | Modifier.TRANSIENT);

I've removed Modifier.TRANSIENT, and all the fields (I think) that JBossAOP introduces 
to classes are not transient.

So, I did this, but are there any reasons for them to be transient?

I know that you didn't realized that someone will use Mixins in that way. 
So you see now (or will see in some days :) ).

Comments?

Tomasz

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

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


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to