[JBoss-user] [JBoss jBPM] - Re: Changes in serialized Objects
Good starting point. Thanks a lot Rainer... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3917606#3917606 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917606 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: Changes in serialized Objects
Hi Bernd, isn't your current approach the solution? Java implements various classes that use readResolve() or readObject() to achieve deserialization of various implementations. This would have to be on a per class basis, i.e. every class that you change you have to know how to deserialize different versions but the specifc class would be the right place to put this knowledge anyway, wouldn't it? Greetings Rainer -- Working on Sundays is a major cause for disfunctional marriages. :-) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3917513#3917513 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917513 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: Changes in serialized Objects
Just to elaborate on the subject, you don't need to subclass ObjectInputStream, just implement one of the special methods for custom deserialization as described in the javadoc for Serializable. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3917534#3917534 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917534 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: Changes in serialized Objects
RAlfoeldi wrote : Working on Sundays is a major cause for disfunctional marriages That's why I'm not getting married, ever. Viva la vie boheme! View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3917535#3917535 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917535 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: Changes in serialized Objects
See we're all here on Sunday... gotta change my life! @Bernd: java.util.Calendar is a good example of an implementation. The serialization pattern changed between JVMs but Sun had to make the backward compaitable. The answer was a standard writeObject() method and a readObject() method that decide if the old version was coming or a new one, which is basically the problem you want to solve. /** | * Reconstitutes this object from a stream (i.e., deserialize it). | */ | private void readObject(ObjectInputStream stream) | throws IOException, ClassNotFoundException | { | final ObjectInputStream input = stream; | input.defaultReadObject(); | | stamp = new int[FIELD_COUNT]; | | // Starting with version 2 (not implemented yet), we expect that | // fields[], isSet[], isTimeSet, and areFieldsSet may not be | // streamed out anymore. We expect 'time' to be correct. | if (serialVersionOnStream = 2) | { | isTimeSet = true; | if (fields == null) fields = new int[FIELD_COUNT]; | if (isSet == null) isSet = new boolean[FIELD_COUNT]; | } | else if (serialVersionOnStream = 0) | { | for (int i=0; iFIELD_COUNT; ++i) | stamp = isSet ? COMPUTED : UNSET; | } | | serialVersionOnStream = currentSerialVersion; | | // If there's a ZoneInfo object, use it for zone. | try { | ZoneInfo zi = (ZoneInfo) AccessController.doPrivileged( | new PrivilegedExceptionAction() { | public Object run() throws Exception { | return input.readObject(); | } | }); | if (zi != null) { | zone = zi; | } | } catch (Exception e) { | } | | // If the deserialized object has a SimpleTimeZone, try to | // replace it with a ZoneInfo equivalent (as of 1.4) in order | // to be compatible with the SimpleTimeZone-based | // implementation as much as possible. | if (zone instanceof SimpleTimeZone) { | String id = zone.getID(); | TimeZone zi = TimeZone.getTimeZone(id); | if (zi != null zi.hasSameRules(zone) zi.getID().equals(id)) { | zone = zi; | } | } | } View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3917536#3917536 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917536 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user