2 Replies Latest reply on Jul 1, 2003 6:54 AM by solo

    transient and deserialization

    solo

      Hi, I'm new to AOP. To try it out I've written a simple VersionableInstance (and it's interface) with a VersionableInterceptor. Basic idea was to test Interceptor, Introductor and metadata. The functionality is to persist the whole instance (stupid I know! :-)) when a configured member field on a particular class where written. So far soo good - it persist correctly and I can cast and check the version etc.

      While deserializing the older versions from disk the transient field of the mixin class is not instantiated (correct behaviour) but since the field is private I canno't initialize it when deserialize it from disk. The hack I've done so far (is ugly!) is to set the field

      "_se$solo$aop$persistor$VersionableInstance$aop$mixin"
      Accessible and instantiated a VersionableInstance and put it there by reflection by later set it Accessible(false).

      This is not a good solution. Is there any other good way of doing this?

      Many Regards
      Mario

        • 1. Re: transient and deserialization
          bill.burke

          All introduced fields in JBoss AOP are transient. This was done on purpose so that an object serialized to a non-JBoss-AOP VM can still be unserialized. We're still debating on whether this is a good or bad idea. Maybe the correct approach is to make it configurable.

          • 2. Re: transient and deserialization
            solo

            Yes I think a configuration entry would be great since my approach is not wery feasable (sidestepping private access modifier). Also in my case AOP will execute on each environment the object will be serialized/deserialized.

            /Mario