[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: WebStart/JMX use cases (was RE: [equinox-dev] April 8th meeting minutes)
- From: "Martin Buechi" <Martin.Buechi@xxxxxxxxxxxxxxx>
- Date: Thu, 17 Apr 2003 12:46:56 -0400
- Delivered-to: email@example.com
- Importance: Normal
- Organization: ChoiceMaker Technologies
> > 4. Standalone server applications with CORBA or RMI interface. Usage of
> > Eclipse plugin framework is straightforward in this case.
> We have implemented something like this and observed a number of problems.
> most problematic one, I think, is the usage of the Java serialization
> for RMI parameter objects, because the serialization mechanism does not
> from which plugin a specific class came from (that is used for an object
> the stream). There are several workarounds for this (e.g. a special
> class loader for the thread that does an overall class search) but I don't
> a real clean solution for this.
> One solution might be to extend the ObjectInput/OutputStreams to store
> additional information for each class into the stream (plugin_id, for
> but I don't know of any possibility to substitude the object streams that
> used for RMI.
> Any idea?
Assuming that the defining classes of all objects that need to be
deserialized can be found in the parent, self, or the prerequisites of the
code that deserializes the data, I think the following should work:
- ObjectInputStream: Create a subclass of ObjectInputStream and override
ObjectInputStream.resolveClass() to use the P-S-P resolution of the plugin's
class loader (rather than the Java default P-S).
- RMI: Implement and register a RMIClassLoaderSpi (JDK 1.4) that uses the
P-S-P resolution of the plugin's class loader. We do that in our own plugin
framework and it works just fine.
If data from other plugins has to be deserialized, a global search through
all plugin class loaders should work, provided that each class is defined
only once (otherwise we get into a dilemma). This is not a requirement as of
now, presumably to allow alternative versions with P-S-P rather than P-P-S
class resolution and to allow the independence assumption between plugins
from different vendors. In our environment we can satisfy this assumption.
Yet another approach would be to use a class loader that has the classes of
all objects that need to be deserialized in its classpath and use this,
rather than the system boot class loader, as the parent for plugin class
loaders. Depending upon the setup, this may or may not be feasible.
Let me make an additional point that relates to this thread but is not a
direct response to the above: The need for custom class loaders to support
the P-S-P class loader model is the reason why an Eclipse plugin-based
application deployed via WebStart cannot run in an untrusted environment
(unless there are not duplicate class definition).
P.S. I forgot to mention that reloading of plugins in Eclipse is another
Equinox interest of mine. I doubt that I will have any resources to
contribute to this, but I would definitely like to have it.
FN:Martin Buechi, Ph.D.
TITLE:Chief Software Architect
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;41 East 11th Street=0D=0A11th floor;New York;NY;10003;United States of Ame=
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:41 East 11th Street=0D=0A11th floor=0D=0ANew York, NY 10003=0D=0AUnited Stat=
es of America