How would you do that exactly?

Lets just make an simple example:

MyObjectFromOscar object = new MyObjectFromOscar();
httpSession.setAttribute(object)

How does this get properly deserialized when the session is read back in from disk.

creating a base class, that can be found by the web app classloader, and extend that one with
classes that can only be found by the oscar loader will not help i think.
Because i think it first needs to have the real class and then it loads the base classes
(because this is specified in the real class)

But i don't know exactly how ObjectInputStream resolves classes, how it gets its classloaders.
Does it uses its callers class classloader?

johan


You need to be able to take control of the deserialization process somehow. Perhaps creating a base class that implements writeReplace() and readResolve() would work. If so, that could be the location where you could implement Richard's idea below:

Is it possible to somehow make serialization/deserialization a process
control through a bundle/service, so that everything occurs inside of
Oscar as opposed to the mix and match approach currently being used?

The deserialization code could check the framework for a (factory) service that can create the required object.

Greetings, Marcel

Reply via email to