[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Re: Adding to the framework exported libraries?

Kabe wrote:
> Hi Tom, thanks for the suggestion. Only reason i don't think this will
> work (and maybe i'm wrong?) is that i need my host application to expose
> instances (services) to the bundles, so for example my host application
> creates in instance of FooService, and then registers it with the root
> BundleContext of the Equinox framework. However, unless i somehow tell
> Equinox that the package is available from the host (parent classloader)
> it won't let any bundle load that depends on this package. So far i'm
> not seeing how Fragment Bundles can solve this problem, because they
> seem like they need to be full bundles and not just passed in, but there
> could be some API or technique i'm not familiar with?

The system bundle is "org.eclipse.osgi". It exports the system packages.

Fragments contribute to the classpath of their bundle host. Thus, if you
create a fragment to "org.eclipse.osgi" you can add the packages from
your application to the set of exported packages of the system bundle,
which makes them available to all bundles.

For registering your services from the host application I suggest
creating a bundle that is started when the framework is started. This
bundle can register any OSGi services, etc. It could be also the
fragment you created above.

Cu, Gunnar

-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EclipseCon 2007!
http://wagenknecht.org/eclipsecon2007/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Gunnar Wagenknecht
gunnar@xxxxxxxxxxxxxxx
http://wagenknecht.org/