[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.rcp] class loader problem: bi-directional (between 2 plugins) instantiation of classes
|
Hello!
I've a problem with the class loader philosophy of Eclipse RCP, which occurs in
many parts of our system. I'll describe it with the example of our XML based
configuration:
We use a shared instance of /Config/ that manages instances of /ConfigModule/.
The /Config/ is in a shared base plugin. Every plugin (I don't know them at
development time - it's an open system) may use one or more /ConfigModule/s. The
/Config/ uses XML (de)serialisation to read and write ConfigModules. This means:
If it needs to load a certain /ConfigModule/, it must execute a Class.forName()
by the name of the module. But as the dependency of my user plugin (which brings
the module) is only unidirectional, the central /Config/ has no chance to
succeed in loading the /Class/.
The same kind of problem occurs in our exception handling mechanism and other
centralized engines that need to load and instantiate other plugin's classes
(which they do not yet know at deployment time).
Putting all of our plugins into the main classpath is NOT a solution (I read
this advice somewhere else in this group). I guess, Eclipse has a mechanism to
solve the problem, because the extension points obviously need that same feature
as well: The eclipse editor framework loads editor classes and instantiates
them. This is basically the same situation and it works. Thus: What do I need to
declare in my /plugin.xml/s to make a user plugin deploy the necessary classes
(e.g. a ConfigModule) to my base plugin (e.g. the Config)?
Thanks a lot for your help!
Best regards, Marco ;-)