Discussion of Classloaders for (de) serialization [message #46201] |
Thu, 16 December 2004 03:11 |
Eclipse User |
|
|
|
Originally posted by: slewis.composent.com
Hello,
I have a plugin that uses object serialization to serialize object
instances, send them over the wire and deserialize object instances from
remote Eclipse sessions using the same plugin. What I would like to do
is to allow other plugins (clients) to serialize/deserialize instances
of their classes via my plugin.
The problem with this is deserialization and the OSGI classloader
structure. When my plugin tries to deserialize an object serialized by
some remote process it needs to load the class of the target
object...and won't be able to because the class was loaded by a
classloader other than the one from my plugin. That is, the receiving
side won't be able to find the class of the object received, because the
classloader used will only have my plugin's classes available.
I could write an extension point for my plugin so that client plugins
could specify packages/classes...and then have my plugin use the
client's classloader for loading appropriate classes (by extending
ObjectInputStream and overriding appropriate methods). Is this the most
natural way to accomplish this? Is there some discussion of handling
object serialization/deserialization with Equinox that presents other
alternatives?
Thanksinadvance for any pointers and/or discussion.
Scott
|
|
|
Powered by
FUDForum. Page generated in 0.06790 seconds