Rogue bundles: Go to jail!

Session Type: 
Standard [25 minutes]

Schedule info


Today we face an increasing number of bundles in our OSGI runtimes. Especially if we use a lot of third party bundles coming from different vendors there might be some "rogue bundles" included.
Bundles are rogues because they may have some special conflicting requirements towards other bundles in our runtime or they bring unwanted side effects to other bundles.
For example
- a bundle may require to set or set itself some global state in an other bundle, such as some static java variables wich conflicts with other bundles.
- a bundle may export an already existing package.
- a set of bundles has its dependencies defined in an inconsistent way.

How can we handle these shortcomings and conflicts in our OSGI runtime? With last years session "Runtime surgery" we looked at the possibilities to change the behaviour of existing bundles we want to reuse. The examples from above show the need to also influence the resolution process of bundles. With OSGI 4.3 comes the org.osgi.framework.hooks.resolver.ResolverHook API that can be used to separate bundles from each other.
This talk shows how to create compartments in the OSGI runtime that can be resolved independently from the rest of the runtime, using the new ResolverHook API.