Skip to main content

[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


I understand your will to do both a run and build time check, and in both cases I recommend you to use the State approach which will give you the ability to only have one codebase.
In the "static" case (pde build like): you create the state yourself and reason on it.
In the "dynamic" case (try to diagnose a running system): you get the state of the running system and reason on it.

Both approaches would not complement each others since ultimatly everything is based on the state :-)

PaScaL




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

07/04/2006 09:05 PM

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

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





Thanks...
So I could see the following alternative:
-- gather all my manifests (which I am comfy with), craft
BundleDeescription and get and reason on a State. This does not impact
the instance I am validating, and is similar to the PDE approach. This
could run as a standalone OSGi app off-container tested. This would be
akin to a static analysis.
-- craft a bundle which has to be in the tested container, (something
like an Eclipse app), and use PackageAdmin to get resolution and
bundle.start() to get activation. This would be akin to dynamic
in-container analysis.

I think I would do both: better safe than sorry.
Static as part of the build, and dynamic as part of a test/validation
phase.
I am correct or smoking too much?
Would both complement each other?
Or is the State good doing all what the resolveBundle and bundle.start
would do?




--
Cheers
Philippe

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


-----Original Message-----
From: equinox-dev-bounces@xxxxxxxxxxx
[mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of Pascal Rapicault
Sent: Tuesday, July 04, 2006 4:53 PM
To: Equinox development mailing list
Cc: 'Equinox development mailing list'; equinox-dev-bounces@xxxxxxxxxxx
Subject: Re: [equinox-dev] Looking for a way to verify that all
bundlesare 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

HTH,

PaScaL



"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>

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







Hi,
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 =
MyPlugin.getDefault().getPluginContext().getBundles();
for (int i = 0; i < bundles.length; i++)
               bundles[i].start();

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.
--
Cheers
Philippe

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
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

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


Back to the top