Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Setting an Equinox-based Development Environment

Bundles can register and unregister services at any time using OSGi runtime
functionnalities, and use service trackers to get service
implementations. But doing so,
we hide the bundle dependencies inside the code. If I give a Jar file
(a bundle) to my OSGi framework, how can it discover what services are
necessary to make the bundle
work ? Package or even Bundle dependencies are not sufficent.

Declarative Service was introduced to be more powerful than
"Export/Import-Service".
Using the Declarative Service, one should be able to inspect the
bundle's manifest,
read the "serviceComponent" field, retrieve the xml component
description files, and finally
parse the xml files to know what services are associated with the bundle.

However, OSGi Declarative Service does not provide a public interface
to discover what
are the informations declared by a component. The only way to know what services
are available/required is to start a bundle and ask the framework for
the currently registered
services, which is not what I want. I consider that a component's
declaration contains static informations; these informations should be
visible from the framework whatever the bundle state is; and because
the informations are declared in an XML format, is is easy
for both human and machines to know what are the services that take
part to one bundle's
life-cycle.

Is there any way of getting the component declarations from Equinox framework,
or are they only handled on the private side of the software, when
starting and stopping a
bundle ?

Regards,

jc

2006/10/6, Niclas Hedhman <niclas@xxxxxxxxxxx>:
On Friday 06 October 2006 18:22, Piero Campanelli wrote:

> Question: is there a way to inspect what services does a bundle provide?
> (Ex. bundle xxx exports serviceA, serviceB, serviceC).

Export and Import of services was deprecated some time ago, and is no longer
recommended. So, which services are registered(!) and consumed can only be
obtained in runtime, and may in fact not be very static at all (up to the
bundle author).

Equinox provide that via the console interface. IIRC, "bundle <bundle-id>"
will list not only the services provided and consumed by the bundle, but also
the wiring information of packages.


Cheers
Niclas
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev



Back to the top