[jboss-dev-forums] [Design of JBossCache] - Re: Common marshalling infrastructure
manik.surtani@jboss.com
do-not-reply at jboss.com
Wed Aug 6 11:41:20 EDT 2008
Re: ref counting, I understand about class data, but as long as instance data is also only written once then that is fine.
Re: version headers, perhaps I could swap ObjectMarshallers midway?
e.g.,
| Map<Short, ObjectMarshaller> objectMarshallers = ... ;
| ByteInput in = new ByteBufferByteInputAdapter(byteBuffer);
| unmarshaller.start(in);
| short versionId = (Short) unmarshaller.readObjectUnshared();
| unmarshaller.setObjectMarshaller( objectMarshallers.get(versionId) );
| // ...
| // continue unmarshalling rest of my state
| // ...
|
|
And when marshalling how would object marshallers be selected? I'm guessing a preference for anything that uses magic numbers (how would you denote that an internal class - which *may* implement Externalizable as well - should be marshalled based on a magic number? Another marker interface, perhaps? Or a sub-interface to Externalizable - Marshallable? And if this is not present then test for Externalizable, and then Serializable, etc., and finally falling back to an Externalizer?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169086#4169086
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169086
More information about the jboss-dev-forums
mailing list