[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Looking for a way to verify that all bundles are resolved, from the command line

If this is part of a build, do you really need to run the configuration? It seems to me that what you care about is predicting the state of the configuratoin you are buildling, in which case what you want is "the State".
The state (provided by the equinox impl of OSGi) allows to reason about a set of bundles that are not necessarily the ones running in the current instance. It allows to know which bundle resolve or not in a given configuration and get causes in case of problems. As you can imagine one of the main user of this state is PDE (build and UI).
The main entry point for creating a State is of course a StateObjectFactory :-) This StateObjectFactory can be obtained from the PlatformAdmin service with the method getFactory() (if you were to use getState(), you would get the state of the running OSGi instance). Once you have a state you can add a description of a manifest in the form of a BundleDescription. All of this API is pretty "low level" and requires you to find and read the manifest but it is pretty powerfull. If you don't want to find and read the manifest yourself (which you probably want), I recommend you to look at the PDEState class from PDE build that takes care of the details mentionned previously



"Philippe Ombredanne" <pombredanne@xxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

07/04/2006 06:46 PM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

"'Equinox development mailing list'" <equinox-dev@xxxxxxxxxxx>
[equinox-dev] Looking for a way to verify that all bundles are        resolved, from the command  line

I am looking for a way to make a dynamic configuration verifications on
a bunch of bundles. (That is a distro)
Ideally I want to have a simple command-line scriptable way to resolve
all bundles in an eclipse install, and get back the output, so we can
make that part of our build.
I played with the console which can start bundles but is not scriptable
from the command line.
Is there an available way?

If not, what would be the right approach?
Would there be a way to get just the resolution going without the start?
Would a snippet like that be all that is need, or is there a better way?

Bundle[] bundles =
for (int i = 0; i < bundles.length; i++)

This would of course be wrapped to handle thrown exceptions and error
reporting, and made in an application or an ant task.

Thanks for some feedback.

philippe ombredanne | 1 650 799 0949 | pombredanne at nexb.com
nexB - Open by Design (tm) - http://www.nexb.com
http://EasyEclipse.org  -  irc://irc.freenode.net/easyeclipse

equinox-dev mailing list