Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Exposing an API defined in a plugin to a normal non-OSGi based program
Exposing an API defined in a plugin to a normal non-OSGi based program [message #108124] Tue, 15 April 2008 07:41 Go to next message
Francis Upton IV is currently offline Francis Upton IVFriend
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


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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Dropins folder and installed features
Next Topic:Equinos OSGI Web-GUI
Goto Forum:
  


Current Time: Wed Apr 24 18:03:40 GMT 2024

Powered by FUDForum. Page generated in 0.02900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top