"manik.surtani(a)jboss.com" wrote : Scott is right, this does apply to JBC as
well. Currently what I do is I have a concept of cache regions, and users register class
loaders per region. Any calls that are then sent over the wire contain the following:
|
| [version id: short][region id: serialized Fqn][payload]
|
| my unmarshalling code currently:
|
| 1. reads the version id and delegates to the appropriate unmarshaller
| 2. unmarshaller reads the region id and sets the TCL appropriate to that region
| 3. continues unmarshalling payload, etc
|
I would continue to do it exactly this way personally. The stream header mechanism should
not be used to solve this problem (as designed today) - its purpose is just for verifying
e.g. the stream's magic number (if there is one) and version number (if any).
Assuming your region ID is a string, you can just use DataInput.readUTF to read it in (and
DataOutput.writeUTF to write it out); should be fairly straightforward.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169301#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...