rogue bundles

Download Rogue bundles

Post on 22-Jun-2015

502 views

Category:

Technology

2 download

Embed Size (px)

DESCRIPTION

Slides for www.eclipsecon.org/europe2011/sessions/rogue-bundles-go-jail

TRANSCRIPT

  • 1. Rogue Bundles: Go to JailIsolating bundles in OSGI 4.3 / eclipseequinox 3.7 Eclipseconeurope2011 1

2. Who we are Tobias Jenkner, edmPRO Matthias Pickel, Piterion GmbH Eclipse RCP Integration project at Daimler AGEclipseconeurope20112 3. Integrating existing osgi bundles Plugin A1 Plugin B1 Plugin A2 Plugin B2 Plugin B3 Integration Plugin C Version 1.1.1 Sideeffects ? Plugin C Version 2.0.1 Eclipse ApplicationEclipseconeurope2011 3 4. Demo Eclipseconeurope2011 4 5. Integrating existing osgi bundlesdefaulthttpparams.a defaulthttpparams.bProvide:Provide:DefaultHttpConn DefaultHttpConnectionFactory ectionFactory ? ConflictingRequirementshttpclient.a& httpclient.bRequire: capabilities Require:http-connection-http-connection-timeout = 100 timeout = 5000 Integrated Eclipse Application A & B Application BEclipse Application AEclipse Eclipseconeurope2011 5 6. Conflicting capabilities Conflicting requirements Multiple instances of OSGI Different implementations services of an OSGI service Multiple instances of Multiple instances of static Singleton-Bundlesvariables (e.g. for Multiple exports of acontaining different packageconfiguration data) Incomplete versioningmetadata 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.3runtimeEclipseconeurope20117 8. OSGI Runtime isolation defaulthttpparams.a defaulthttpparams.b Provide:Provide: DefaultHttpConn DefaultHttpConn ectionFactory ectionFactory httpclient.ahttpclient.b Require:Require: http-connection-http-connection- timeout = 100 timeout = 5000Eclipse Framework core componentsIntegrated Eclipse Application A & BEclipseconeurope2011 8 9. Demo Eclipseconeurope2011 9 10. OSGI 4.3 Framework HooksEclipseconeurope2011 10 11. ResolverHookCreate a newResolverHook instance forevery resolve processDecide if more than oneinstance of a singletonbundle may be installed Decide how bundles may be wired. Eclipseconeurope2011 11 12. ResolverHookorg.osgi.framework.hooks.resolver.ResolverHook void filterSingletonCollisions( BundleCapability singleton, Collection collisionCandidates):Allow one instance of singleton-bundles to be installed in every Bundle-Jail-Cell. void filterMatches( BundleRequirement requirement, Collection candidates):Do not allow to wire bundles between different Bundle-Jail-Cells. void filterResolvable(Collection candidates);:not important for bundle jails void end():lifecycle method not important for bundle jailsEclipseconeurope201112 13. Find & Event Hooks BundleContext.getService -> Service FindHook BundleContext.getBundles()-> Bundle FindHook ServiceEvents -> Service EventListenerHook BundleEvents -> Bundle EventHook Eclipseconeurope2011 13 14. BundleJail implementationImplementation of the Hook-Interfaces Plugin A1Plugin B1How do the HookProvide XProvide Xinterfaces know whichPlugin A2 Require XPlugin B2Require Xbundle-jail-cell a bundlebelongs to?Eclipse Frameworkcore 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 intodifferent jail-cells The install URL is available in the hooksEclipseconeurope201114 15. Open questionsP2 integration: Install bundles into jails Specify query part of the URL in Config.ini /bundles.info P2 installation: Specify BundleJailCell / regionin P2-Metadata ? Eclipseconeurope201115 16. Open questions Eclipse extension registry: mulitple singletons-> multiple instances of the same extensions? Could be implemented with equinox transformsxslt Install location is shared between regions No PDE tooling support for custom URLs Eclipseconeurope201116 17. Look around: Equinox Regions Isolation Hooks implementations from theequinox team. Originally developed for eclipse virgo Directed Graph of bundle regions Eclipseconeurope201117 18. Look around Google chrome: Separate process for everytab-> Isolation through separate JVM instances ?-> JSR 121: JVM Isolation API-> Not yet implemented in Oracle JVM Eclipseconeurope2011 18 19. Thank you ! Questions ? Democode: https://github.com/tobias-jenkner/org.eclipse.ece2011.roguebundlesEclipseconeurope2011 19