Garima
Garima

Reputation: 11

Loading of an OSGI bundle into another bundle and use its services

I want to use one bundle or more into other bundle dynamically by selecting from a UI in java fx . On selecting a bundle name I'm able to install it using

Bundle b = Cntxt.installBundle(file.toURI().toString());

when I run the application and give ss it shows it has been installed but how can I change the state from installed to resolved and then to active hence use the other bundle???

Upvotes: 1

Views: 158

Answers (1)

Marcel Offermans
Marcel Offermans

Reputation: 3323

You need to start it so it becomes active:

b.start();

That will work unless the bundle has dependencies that cannot be resolved, in which case it will throw an exception and refuse to start.

Upvotes: 3

Related Questions