I am currently looking at JBoss Serialization as a way to improve our performance with regards to serialization. However currently we store information about the classloader by overriding the annotateClass method. And retrieving that information using the resolveClass where we can ensure the correct class loader is used. However I have noticed that the JBoss serialization does not make the calls to annotateClass so we cannot store the information about the class loader. Do you have any ideas how to solve this problem? or will a future version of JBoss serialization make calls to the annotateClass method?

I had a few hours today to have a look at this so was examining your code to see how I would solve my problem. Please correct me if I'm wrong!

I can't see how you could ever call annotateClass as class information is persisted on the stream seperately to the objects. You are using the ClassMetaData class to describe a class, and you persisting that information using the StreamingClass class.

I'm guessing that to change jboss serialization such that different class loaders can be used for different serialized objects, I would have to include the relevant information within the ClassMetaData... and change StreamingClass such that it can store the classloader information in saveStream and read the class loader information at the beginning of the readStream method. Does this make sense?

We write a container and as such have different classloaders throughout the system for the various the applications. To perform HA we sometimes replicate state across many applications... this is done by serializing the object hierarchy... but different objects in this hierarchy can have come from different applications and thus may have different ClassLoaders.We currently annote information about the classloader in the annotateClass and annotateProxyClass methods by writing the classloader information as a String on the stream... thus when resolveClass or resolveProxyClass is called we can read the classloader information from the stream and use it to lookup the relevant class loader to load the class.