Skip to main content



      Home
Home » Eclipse Projects » Equinox » How to get Bundle dependencies ?(BundleDescription)
How to get Bundle dependencies ? [message #537715] Thu, 03 June 2010 09:06 Go to next message
Eclipse UserFriend
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 15:38 Go to previous messageGo to next message
Eclipse UserFriend
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 05:54 Go to previous messageGo to next message
Eclipse UserFriend
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 06:08 Go to previous messageGo to next message
Eclipse UserFriend
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 09:14 Go to previous message
Eclipse UserFriend
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: Wed Jul 16 10:32:02 EDT 2025

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

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

Back to the top