6. Conflicting capabilities Conflicting requirements
• Multiple instances of OSGI • Different implementations
services of an OSGI service
• Multiple instances of • Multiple instances of static
Singleton-Bundles variables (e.g. for
• Multiple exports of a containing different
package configuration data)
• Incomplete versioning
metadata
→ Write once …. break in integration scenario ?
Eclipseconeurope2011 6
7. Solutions ?
• Change the existing osgi bundles
– Not always possible (source code not available)
– Cost, time, ….
• Rogue bundles: Go to Jail!
– Create isolated regions (jailcells) in our OSGI 4.3
runtime
Eclipseconeurope2011 7
11. ResolverHook
Create a new
ResolverHook instance for
every resolve process
Decide if more than one
instance of a singleton
bundle may be installed
Decide how bundles may
be wired.
Eclipseconeurope2011 11
12. ResolverHook
org.osgi.framework.hooks.resolver.ResolverHook
• void filterSingletonCollisions(
BundleCapability singleton, Collection<BundleCapability>
collisionCandidates):
Allow one instance of singleton-bundles to be installed in every Bundle-Jail-
Cell.
• void filterMatches(
BundleRequirement requirement, Collection<BundleCapability>
candidates):
Do not allow to wire bundles between different Bundle-Jail-Cells.
• void filterResolvable(Collection<BundleRevision> candidates);:
not important for bundle jails
• void end():
lifecycle method not important for bundle jails
Eclipseconeurope2011 12
14. BundleJail implementation
Implementation of the Hook-Interfaces
Plugin A1 Plugin B1
How do the Hook Provide X Provide X
interfaces know which Plugin A2
Require X
Plugin B2
Require X
bundle-jail-cell a bundle
belongs to? Eclipse Framework
core components
Integrated Eclipse Application A & B
→ Use the query part of the bundle install URL
→ Allows a bundle to be installed multiple times from the same location into
different jail-cells
→ The install URL is available in the hooks
Eclipseconeurope2011 14
15. Open questions
P2 integration: Install bundles into jails
• Specify query part of the URL in Config.ini /
bundles.info
• P2 installation: Specify BundleJailCell / region
in P2-Metadata ?
Eclipseconeurope2011 15
16. Open questions
• Eclipse extension registry: mulitple singletons
-> multiple instances of the same extensions?
– Could be implemented with equinox transforms
xslt
• Install location is shared between regions
• No PDE tooling support for custom URLs
• …
Eclipseconeurope2011 16
17. Look around: Equinox Regions
• Isolation Hooks implementations from the
equinox team.
• Originally developed for eclipse virgo
• Directed Graph of bundle regions
Eclipseconeurope2011 17
18. Look around
• Google chrome: Separate process for every
tab
-> Isolation through separate JVM instances ?
-> JSR 121: JVM Isolation API
-> Not yet implemented in Oracle JVM
Eclipseconeurope2011 18