[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Re: Adding to the framework exported libraries?
- From: David Kemper <djk@xxxxxxxxx>
- Date: Tue, 13 Feb 2007 16:28:40 -0800
- Delivered-to: email@example.com
I bring it up for a couple reasons:
1) From time to time I see suggestions to supplement plugin behavior
in a fragment that registers services, as was done in the original
post, so I assume that I'm missing something in how it *could* be done.
2) I've seen the use case for fragments as a) localized resources, b)
native code shared library for a specific os configuration, and c)
extending the functionality of a given bundle such that, depending on
what fragment is installed in the framework, you get modified/adapted
In the cases of 1) and 2c), consider an extension of the system
bundle that wishes to provide an implementation of the Log Service.
How to do this?
This is just one example. The bottom line: if you need a bundle
context to do anything "useful" in a running framework, and a
fragment doesn't get one because it can't have a bundle activator,
what is it realistically possible to do in a fragment beyond
resources and native code?
On Feb 13, 2007, at 9:28 AM, Peter Kriens wrote:
Fragments are supposed to be subservient to its host, for example,
Why do you need fragments if you need to actively provide services?
DK> I've been wondering how to register services from a fragment.
DK> As far as I know, a fragment *cannot* have a bundle activator.
DK> Without a bundle activator, how does a fragment get access to its
DK> bundle context through which it can register services?
DK> What am I missing?
>> Message: 4
>> Date: Mon, 12 Feb 2007 07:44:35 +0100
>> From: Gunnar Wagenknecht <gunnar@xxxxxxxxxxxxxxx>
>> Subject: [equinox-dev] Re: Adding to the framework exported
>> To: equinox-dev@xxxxxxxxxxx
>> Message-ID: <eqp2ci$9e1$1@xxxxxxxxxxxxx>
>> Content-Type: text/plain; charset=ISO-8859-1
>> Kabe wrote:
>> > Hi Tom, thanks for the suggestion. Only reason i don't think this
>> > work (and maybe i'm wrong?) is that i need my host application to
>> > instances (services) to the bundles, so for example my host
>> > creates in instance of FooService, and then registers it with the
>> > BundleContext of the Equinox framework. However, unless i somehow
>> > Equinox that the package is available from the host (parent
>> > it won't let any bundle load that depends on this package. So far
>> > not seeing how Fragment Bundles can solve this problem,
>> > 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
>> Fragments contribute to the classpath of their bundle host. Thus,
>> if you
>> create a fragment to "org.eclipse.osgi" you can add the packages
>> your application to the set of exported packages of the system
>> 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.
>> bundle can register any OSGi services, etc. It could be also the
>> fragment you created above.
>> Cu, Gunnar
DK> equinox-dev mailing list
Peter Kriens Tel +33467542167
9C, Avenue St. Drézéry AOL,Yahoo: pkriens
34160 Beaulieu, France ICQ 255570717
Skype pkriens Fax +1 8153772599