it s time for the resolution
play

ITS TIME FOR THE RESOLUTION TIM VERBELEN Senior Researcher imec - PowerPoint PPT Presentation

ITS TIME FOR THE RESOLUTION TIM VERBELEN Senior Researcher imec Ghent University 1 PUBLIC ! could not resolve the bundles: [ that.awesome.library.i.found -1.0.0 org.osgi.framework.BundleException: Unable to resolve


  1. IT’S TIME FOR THE RESOLUTION TIM VERBELEN Senior Researcher imec – Ghent University 1 PUBLIC

  2. ! could not resolve the bundles: [ that.awesome.library.i.found -1.0.0 org.osgi.framework.BundleException: Unable to resolve that.awesome.library.i.found [1](R 1.0): missing requirement [ that.awesome.library.i.found [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package= some.exotic.package )(version>=1.0.0) (!(version>=2.0.0))) Unresolved requirements: [[ that.awesome.library.i.found [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package= some.exotic.package )(version>=1.0.0) (!(version>=2.0.0)))]] 2 PUBLIC

  3. WHEN DO YOU RESOLVE? PUBLIC

  4. WHEN DO YOU RESOLVE? AT RUNTIME? PUBLIC

  5. WHEN DO YOU RESOLVE? AT RUNTIME? AT LAUNCH TIME? PUBLIC

  6. WHEN DO YOU RESOLVE? AT RUNTIME? AT LAUNCH TIME? AT DEVELOPMENT TIME? PUBLIC

  7. OSGI BUNDLES AND PACKAGES RESOLVING IMPORT -PACKAGES foo.bar v1.0.0 Export-Package foo.bar.api; version=1.0.0 Private-Package foo.bar.impl Import-Package foo.bar.util; version= [1.0.0, 1.1.0) 7 PUBLIC

  8. OSGI BUNDLES AND PACKAGES RESOLVING IMPORT -PACKAGES foo.bar v1.0.0 Export-Package foo.bar.api; version=1.0.0 install Private-Package foo.bar.impl Import-Package foo.bar.util; version= [1.0.0, 1.1.0) OSGi framework Resolver 8 PUBLIC

  9. OSGI BUNDLES AND PACKAGES RESOLVING IMPORT -PACKAGES foo.bar v1.0.0 Export-Package foo.bar.api; version=1.0.0 install Private-Package foo.bar.impl foo.bar.util v1.0.0 Import-Package Export-Package foo.bar.util; version= [1.0.0, 1.1.0) foo.bar.util; version=1.0.0 OSGi framework Resolver 9 PUBLIC

  10. RESOLVING AGAINST A REPOSITORY Repository foo.bar v1.0.0 foo.bar.api; version=1.0.0 foo.bar.util; version= [1.0.0, 1.1.0) foo.bar.util v2.0.0 Resolver foo.bar.util; version=2.0.0 resolve com.car v1.0.0 foo.bar v1.0.0 com.car.api; version=1.0.0 foo.bar.util v1.0.0 foo.bar.util; version=1.0.0 … 10 PUBLIC

  11. RESOLVING AGAINST A REPOSITORY Repository foo.bar v1.0.0 foo.bar.api; version=1.0.0 foo.bar.util; version= [1.0.0, 1.1.0) foo.bar.util v2.0.0 Resolver foo.bar.util; version=2.0.0 resolve com.car v1.0.0 foo.bar v1.0.0 com.car.api; version=1.0.0 foo.bar.util v1.0.0 foo.bar.util; version=1.0.0 … 11 PUBLIC

  12. RESOLVING PACKAGES PUBLIC

  13. OSGI EXTENDERS DO STUFF ON BEHALF OF ANOTHER BUNDLE foo.bar v1.0.0 Service-Component: install OSGI-INF/foo.bar.BarImpl.xml felix.scr OSGi framework Resolver 13 PUBLIC

  14. OSGI EXTENDERS DO STUFF ON BEHALF OF ANOTHER BUNDLE foo.bar v1.0.0 OSGI-INF/configurator/config.json install felix.configurator OSGi framework Resolver 14 PUBLIC

  15. REQUIREMENTS AND CAPABILITIES Requirement Capability ▪ Something the bundle needs Something the bundle offers ▪ ▪ Namespace ▪ Namespace ▪ Directives (i.e. a filter) ▪ Attributes (i.e. key-value pairs) 15 PUBLIC

  16. REQUIREMENTS AND CAPABILITIES Requirement Capability Something the bundle offers ▪ ▪ Something the bundle needs ▪ Namespace ▪ Namespace ▪ Directives (i.e. a filter) ▪ Attributes (i.e. key-value pairs) osgi.wiring.package; osgi.wiring.package; filter:=“(&( osgi.wiring.package=foo.bar.util)(ve osgi.wiring.package =“ foo.bar.util ” rsion>=1.0.0)(!(version>=2.0.0)))” version=“1.0.0” osgi.extender; osgi.extender; filter:=“(&( osgi.extender=osgi.component)(ve rsion>=1.4.0)(!(version>=2.0.0)))” osgi.extender =“ osgi.component ” 16 PUBLIC

  17. RESOLVING CAPABILITIES AND REQUIREMENTS PUBLIC

  18. OSGI SERVICES REQUIRE AN OSGI SERVICE foo.bar.api v1.0.0 foo.bar.api; version=1.0.0 18 PUBLIC

  19. OSGI SERVICES REQUIRE AN OSGI SERVICE foo.bar.api v1.0.0 foo.bar.api; version=1.0.0 import foo.bar.impl v1.0.0 foo.bar.api.BarService 19 PUBLIC

  20. OSGI SERVICES REQUIRE AN OSGI SERVICE foo.bar.api v1.0.0 foo.bar.api; version=1.0.0 import import foo.bar.consumer v1.0.0 foo.bar.impl v1.0.0 foo.bar.api.BarService 20 PUBLIC

  21. OSGI SERVICES REQUIRE AN OSGI SERVICE foo.bar.api v1.0.0 foo.bar.api; version=1.0.0 import import foo.bar.consumer v1.0.0 foo.bar.impl v1.0.0 foo.bar.api.BarService Require-Capability Provide-Capability osgi.service; osgi.service; filter:="(objectClass=foo.bar.api.BarService)"; objectClass:List <String>=“ foo.bar.api.BarService" effective:=active 21 PUBLIC

  22. OSGI SERVICES REQUIRE AN OSGI SERVICE foo.bar.api v1.0.0 foo.bar.api; version=1.0.0 import import foo.bar.consumer v1.0.0 foo.bar.impl v1.0.0 foo.bar.api.BarService Require-Capability Provide-Capability osgi.service; osgi.service; filter:="(objectClass=foo.bar.api.BarService)"; objectClass:List <String>=“ foo.bar.api.BarService" effective:=active 22 PUBLIC

  23. RESOLVING SERVICES PUBLIC

  24. DECLARING REQUIREMENTS AND CAPABILITIES USE BUNDLE ANNOTATIONS @Capability (namespace =“ your.name.space ”, name=“foo”, version=“1.0.0”) @Requirement (namespace =“ your.name.space ”, filter=“(name=foo)”) PUBLIC

  25. DECLARING REQUIREMENTS AND CAPABILITIES WITH BUNDLE ANNOTATIONS PUBLIC

  26. SO WHAT ABOUT INSTALLING AT RUNTIME? USE THE REPOSITORY AND RESOLVER SERVICES Resolver OSGi framework Resolver PUBLIC

  27. SO WHAT ABOUT INSTALLING AT RUNTIME? USE THE REPOSITORY AND RESOLVER SERVICES Repository foo.bar v1.0.0 foo.bar.api; version=1.0.0 foo.bar.util; version= [1.0.0, 1.1.0) Repository foo.bar.util v2.0.0 foo.bar.util; version=2.0.0 Resolver com.car v1.0.0 com.car.api; version=1.0.0 OSGi framework Resolver foo.bar.util v1.0.0 foo.bar.util; version=1.0.0 … PUBLIC

  28. SO WHAT ABOUT INSTALLING AT RUNTIME? USE THE REPOSITORY AND RESOLVER SERVICES Repository foo.bar v1.0.0 Deployment foo.bar.api; version=1.0.0 Agent foo.bar.util; version= [1.0.0, 1.1.0) Repository foo.bar.util v2.0.0 foo.bar.util; version=2.0.0 Resolver com.car v1.0.0 com.car.api; version=1.0.0 OSGi framework Resolver foo.bar.util v1.0.0 foo.bar.util; version=1.0.0 … PUBLIC

  29. RESOLVER SERVICE Resolver ▪ Map<Resource, List<Wire>> resolve( ResolveContext context) throws ResolutionException ▪ ResolveContext Collection<Resource> getMandatoryResources() what to resolve? List<Capability> findProviders(Requirement requirement) where to find capabilities to resolve it? 29 PUBLIC

  30. RESOLVING AT RUNTIME PUBLIC

  31. CONCLUSION Resolving is a gain, not a pain ▪ Resolve early and often ▪ Curate your repositories ▪ Use the (BND) tooling ▪ PUBLIC

  32. PUBLIC

Recommend


More recommend