Ngupta
Ngupta

Reputation: 349

What Happens to dependencies of a OSGI bundle of a bundle once its resolved

I have an OSGI Bundle A and Bundle B. Bundle B is dependent on Bundle A.

Both Bundle B and Bundle A are in active state.

Now I need to understand the impact of below scenarios on Bundle B

1) I have stopped Bundle A, what would happen to Bundle B.

2) I have uninstalled Bundle A. What would happen to Bundle B.

3) I have stopped Bundle A, Then I stopped Bundle B and now I am trying to resolve B from installed state.

4) I have uninstalled Bundle A, Then I stopped Bundle B and now I am trying to resolve B from installed state.

Could anyone please answer this?

I have tried this with apache Felix console and I do not see any impact on B in any of the above scenario.

Could anyone help me with this?

Upvotes: 1

Views: 510

Answers (1)

Neil Bartlett
Neil Bartlett

Reputation: 23948

The impact should be as follows:

  1. Nothing (stopping has nothing to do with resolution)
  2. Nothing (B still uses the packages exported by A until you do a refresh)
  3. Nothing (stopping has nothing to do with resolution)
  4. B should not resolve -- unless another bundle is able to provide the packages that B depends on.

UPDATE

In the comments, @Ngupta asks "please share some explanation on why B is always resolved even if the bundle it requires is not longer there".

My response: B will remain in the resolved state even if you uninstall its dependency. However B will not transition to the resolved state if it is missing dependencies.

You can force B to re-resolve (and this re-resolve should fail) by doing a refresh, which is an operation you can execute from the Gogo shell. In fact you should always do a refresh after performing a series of install, update or remove operations.

Upvotes: 2

Related Questions