Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » How to get Bundle dependencies ?(BundleDescription)
How to get Bundle dependencies ? [message #537715] Thu, 03 June 2010 13:06 Go to next message
Rustam  is currently offline Rustam Friend
Messages: 20
Registered: January 2010
Junior Member
Hi,

How can I get bundle dependencies ? As I understand there is interface BundleDescription for this purpose.. or not ? Smile How can I use it ?

Could you please explain us how can we get list of bundle dependencies.. for example I tried to install and start bundle:

Bundle bundle = bundleContext.installBundle( path );
bundle.start() // Ooops.. exceptions. because not all dependencies resolved

let's imagine I want to insert following code:
BundleXXX[] depends = bundle.getDependencies();
if( depens == null ) bundle.start(): // Smile)

I hope I explain my request very clearly Wink

Thanks a lot for your answer and your work !

Re: How to get Bundle dependencies ? [message #537845 is a reply to message #537715] Thu, 03 June 2010 19:38 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Use PlatformAdmin#getState() to get the State for the running system.
State#getBundle( bundle.getBundleId() ) gives you a BundleDescription
corresponding to your bundle.

BundleDescription has methods to get dependencies. Also, StateHelper
contains methods that might be interesting.

To go backwards from a BundleDescription to a Bundle you would also need the
BundleContext#getBundle() with BundleDescription#getBundleId()

-Andrew

Rustam wrote:

> Hi,
>
> How can I get bundle dependencies ? As I understand there is interface
> BundleDescription for this purpose.. or not ? :) How can I use it ?
>
> Could you please explain us how can we get list of bundle dependencies..
> for example I tried to install and start bundle:
>
> Bundle bundle = bundleContext.installBundle( path );
> bundle.start() // Ooops.. exceptions. because not all dependencies
> resolved
>
> let's imagine I want to insert following code:
> BundleXXX[] depends = bundle.getDependencies();
> if( depens == null ) bundle.start(): // :))
>
> I hope I explain my request very clearly ;)
>
> Thanks a lot for your answer and your work !
Re: How to get Bundle dependencies ? [message #537946 is a reply to message #537845] Fri, 04 June 2010 09:54 Go to previous messageGo to next message
Rustam  is currently offline Rustam Friend
Messages: 20
Registered: January 2010
Junior Member
Hi,

Thanks ! But it's not working with bundles which are not installed.

Another words, how does system generate list of unresolved bundles when unresolved bundle exception occurs ?

Thanks.

/Rustam

Re: How to get Bundle dependencies ? [message #537954 is a reply to message #537946] Fri, 04 June 2010 10:08 Go to previous messageGo to next message
Rustam  is currently offline Rustam Friend
Messages: 20
Registered: January 2010
Junior Member
aha, ok, I found out method getRquiredBudles which return BundleSpecification array of dependencies bundles
Re: How to get Bundle dependencies ? [message #537999 is a reply to message #537954] Fri, 04 June 2010 13:14 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
You should also consider using a provisioning system to do this work for you. In Equinox we have p2 which does this kind of analysis and ensures that you install bundles that will resolve.

Tom.
Previous Topic:Galileo Software Repository doesn't work
Next Topic:How to export other (separate) projects with another plug-in project?
Goto Forum:
  


Current Time: Fri Apr 26 05:51:27 GMT 2024

Powered by FUDForum. Page generated in 0.02522 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top