Exposing an API defined in a plugin to a normal non-OSGi based program [message #108124] |
Tue, 15 April 2008 07:41 |
Francis Upton IV Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
I have an RCP application that defines some API classes through the
normal Eclipse plugin mechanism.
I would like also to expose some of these classes to a non-OSGi
application as part of the normal API for the product.
I have a factory class to create the root object from which everything
else is done (RuntimeFactory.createRuntime()). My thinking was that in
the case were Eclipse is running, the factory would just to do a normal
new RuntimeEngineImpl(), and in the case where it was not running to
start it using EclipseStarter.run(), and then return the application
object (which is the RuntimeEngineImpl()).
The difficulty is that the RuntimeEngineImpl object returned from the
Eclipse environment is of course different than the one expected by the
application, because even though the Jars are the same, the classloaders
are different.
So then, I tried removing the Eclipse plugin A entirely and setting the
various osgi class loader properties to refer to the "app" classloader
and thus get those classes in the plugin from the application's
classpath. This was looking very promising until the application
classloader tried to load a superclass of RuntimeEngineImpl from Eclipse
plugin B, which plugin B is defined normally using the Eclipse mechanism
(and is not in the app's classpath).
This is the point where I realized I need some help.
There must be an easy way to expose an API from an Eclipse app that I'm
missing here.
Got any ideas?
Thanks,
Francis
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
Re: Exposing an API defined in a plugin to a normal non-OSGi based program [message #108139 is a reply to message #108124] |
Tue, 15 April 2008 09:52 |
Eclipse User |
|
|
|
Originally posted by: pillii.gmx.de
Francis Upton schrieb:
> I have an RCP application that defines some API classes through the
> normal Eclipse plugin mechanism.
>
> I would like also to expose some of these classes to a non-OSGi
> application as part of the normal API for the product.
>
> I have a factory class to create the root object from which everything
> else is done (RuntimeFactory.createRuntime()). My thinking was that in
> the case were Eclipse is running, the factory would just to do a normal
> new RuntimeEngineImpl(), and in the case where it was not running to
> start it using EclipseStarter.run(), and then return the application
> object (which is the RuntimeEngineImpl()).
>
> The difficulty is that the RuntimeEngineImpl object returned from the
> Eclipse environment is of course different than the one expected by the
> application, because even though the Jars are the same, the classloaders
> are different.
>
> So then, I tried removing the Eclipse plugin A entirely and setting the
> various osgi class loader properties to refer to the "app" classloader
> and thus get those classes in the plugin from the application's
> classpath. This was looking very promising until the application
> classloader tried to load a superclass of RuntimeEngineImpl from Eclipse
> plugin B, which plugin B is defined normally using the Eclipse mechanism
> (and is not in the app's classpath).
>
> This is the point where I realized I need some help.
>
> There must be an easy way to expose an API from an Eclipse app that I'm
> missing here.
>
> Got any ideas?
>
> Thanks,
>
> Francis
Hello,
i think i had the same problem some days ago. Look at this thread
"ClassCastException when using BundleContext.getService()" from 07.
april 2008 05:09.
Its inside this mailinglist.
Regards,
Gordian
|
|
|
Powered by
FUDForum. Page generated in 0.03049 seconds