Warum OSGi?

1,388 views
1,269 views

Published on

Slides form the Java Forum Stuttgart "Warum OSGi?". More Details see http://www.java-forum-stuttgart.de/abstracts.html#D7

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,388
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Warum OSGi?

  1. 1. Warum OSGi Christian Baranowski
  2. 2. Willkommen• Christian Baranowski• Software Qualitätssicherung @ SEITENBAU Gmbh Konstanz (DE) • Custom Software Solutions • E-Government Solutions • Identity Management and SSO Solutions • www.seitenbau.de• Vorstand OSGi Users Forum Germany • Co-lead (mit Jochen Hiller) German Enterprise Working Group. • OSGi Code Camp
  3. 3. OSGi
  4. 4. OSGiModularity Modules
  5. 5. OSGiModularity Modules Lifecycle
  6. 6. OSGi A Service BModularity Modules Lifecycle Services
  7. 7. OSGi A Service BModularity Modules Lifecycle Services Security
  8. 8. OSGi ist
  9. 9.  ein
  10. 10.  offener
  11. 11.  Standard
  12. 12.  der
  13. 13.   A Service BModularity Modules Lifecycle Services Security
  14. 14. Warum OSGi?
  15. 15. Erweiterbarkeit / Plugins
  16. 16. Erweiterbarkeit / PluginsFirefox Eclipse Maven Spring Roo Jenkins
  17. 17. Bundle JAR
  18. 18. BundlePrivate
  19. 19.  Packages JAR
  20. 20. BundlePrivate
  21. 21.  Packages Exported
  22. 22.   Packages JAR
  23. 23. Bundle Private
  24. 24.  PackagesImported
  25. 25.   Exported
  26. 26.  Packages Packages JAR
  27. 27. Modul LevelFunktionen Klassen Packages
  28. 28. Modul LevelFunktionen Klassen Packages Bundles
  29. 29. Bundles
  30. 30. Bundles AProvider
  31. 31.  Bundle
  32. 32. Bundles A Provider
  33. 33.  BundleManifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: ABundle-Version: 1.0.1Export-Package: echo.api;version=1.0.0, echo.sysout;version=1.0.0
  34. 34. Bundles A B Provider
  35. 35.  Bundle Consumer
  36. 36.  BundleManifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: ABundle-Version: 1.0.1Export-Package: echo.api;version=1.0.0, echo.sysout;version=1.0.0
  37. 37. Bundles A B Provider
  38. 38.  Bundle Consumer
  39. 39.  BundleManifest-Version: 1.0 Manifest-Version: 1.0Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2Bundle-SymbolicName: A Bundle-SymbolicName: BBundle-Version: 1.0.1 Bundle-Version: 1.0.0Export-Package: Import-Package: echo.api;version=1.0.0, echo.api;version=[1.0,2), echo.sysout;version=1.0.0 echo.sysout;version=[1.0,2)
  40. 40. Demo Modularity / Lifecycle Extender World Desktop Box API Arch Provisioning
  41. 41. OSGi Services
  42. 42. OSGi Services API
  43. 43.  Bundle Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: api Bundle-Version: 2.0.0 Export-Package: echo.api;version=1.0.0
  44. 44. OSGi Services Provider
  45. 45.  Bundle ServiceManifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: ABundle-Version: 1.0.1 API
  46. 46.  BundleImport-Package: echo.api;version=[1.0,2)Service-Component: OSGI-INF/EchoProvider.xml Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: api Bundle-Version: 2.0.0 Export-Package: echo.api;version=1.0.0
  47. 47. OSGi Services Provider
  48. 48.  Bundle Consumer
  49. 49.  Bundle ServiceManifest-Version: 1.0 Manifest-Version: 1.0Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2Bundle-SymbolicName: A Bundle-SymbolicName: BBundle-Version: 1.0.1 Bundle-Version: 1.0.0 API
  50. 50.  Bundle Import-Package:Import-Package: echo.api;version=[1.0,2) echo.api;version=[1.0,2)Service-Component: Service-Component: OSGI-INF/EchoProvider.xml OSGI-INF/EchoClient.xml Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: api Bundle-Version: 2.0.0 Export-Package: echo.api;version=1.0.0
  51. 51. OSGi Services Provider
  52. 52.  Bundle Consumer
  53. 53.  Bundle Service Instance
  54. 54.  CouplingManifest-Version: 1.0 Manifest-Version: 1.0Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2Bundle-SymbolicName: A Bundle-SymbolicName: BBundle-Version: 1.0.1 Bundle-Version: 1.0.0 API
  55. 55.  Bundle Import-Package:Import-Package: echo.api;version=[1.0,2) echo.api;version=[1.0,2)Service-Component: Service-Component: OSGI-INF/EchoProvider.xml OSGI-INF/EchoClient.xml Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: api Bundle-Version: 2.0.0 Export-Package: echo.api;version=1.0.0
  56. 56. Service Registry Provider Name Value type api.Echo - register availavility 5 - unregister Consumer Name Value - get - listen type api.Echoavailavility 5 Service Registry ... ...
  57. 57. OSGi Services Demo World Desktop API Wall Sensor Robot devices
  58. 58. OSGi Declarative Services API
  59. 59.  Bundle
  60. 60. OSGi Declarative Services Provider
  61. 61.  Bundle Service API
  62. 62.  Bundlescr:component name=echo.sysout.EchoProvider implementation class=echo.sysout.EchoProvider/ service provide interface=echo.api.Echo / /service/scr:component
  63. 63. OSGi Declarative Services Provider
  64. 64.  Bundle Consumer
  65. 65.  Bundle Service API
  66. 66.  Bundle scr:component name=echo.consumer.EchoClientscr:component name=echo.sysout.EchoProvider implementation class=echo.consumer.EchoClient/ implementation class=echo.sysout.EchoProvider/ reference name=Echo service interface=echo.api.Echo provide interface=echo.api.Echo / bind=setEcho unbind=unsetEcho / /service /scr:component/scr:component
  67. 67. DS Annotation Provider
  68. 68.  Bundle Consumer
  69. 69.  Bundle Service import org.osgi...annotations.*; import echo.api.Echo; @Component public class EchoClient { API
  70. 70.  Bundle Echo echo;import org.osgi.service.component.annotations.*; import echo.api.Echo; @Reference public void setEcho(Echo echo){@Component this.echo = echo;public class EchoProvider implements Echo { } @Activate public void unsetEcho(Echo echo){ public void activate() { this.echo = null; } } }}
  71. 71. Blueprint Services API
  72. 72.  Bundle
  73. 73. Blueprint Services Consumer
  74. 74.  Bundle core-context.xml blueprint bean class=echo.consumer.EchoClient API
  75. 75.  Bundle property name=echo ref=echo / /bean /blueprint
  76. 76. Blueprint Services Service Consumer
  77. 77.  Bundle core-context.xml blueprint bean class=echo.consumer.EchoClient API
  78. 78.  Bundle property name=echo ref=echo / /bean /blueprint osgi-context.xml blueprint reference id=echo interface=echo.api.Echo/ /blueprint
  79. 79. Blueprint Services Provider
  80. 80.  Bundle Consumer
  81. 81.  Bundle Service core-context.xml core-context.xml blueprint beans context:component-scan bean class=echo.consumer.EchoClient base-package=echo.sysout / API
  82. 82.  Bundle property name=echo ref=echo /Spring
  83. 83.  Proprietär /beans /bean /blueprint @Component(echo) public class EchoProvider implements Echo { @PostConstruct osgi-context.xml public void init() { blueprint } } reference id=echo interface=echo.api.Echo/ /blueprint
  84. 84. Blueprint Services Provider
  85. 85.  Bundle Consumer
  86. 86.  Bundle Service core-context.xml core-context.xml blueprint beans context:component-scan bean class=echo.consumer.EchoClient base-package=echo.sysout / API
  87. 87.  Bundle property name=echo ref=echo /Spring
  88. 88.  Proprietär /beans /bean /blueprint @Component(echo) public class EchoProvider implements Echo { @PostConstruct osgi-context.xml public void init() { blueprint } } reference id=echo interface=echo.api.Echo/ osgi-context.xml /blueprint blueprint service ref=echo interface=echo.api.Echo / /blueprint
  89. 89. Demo Dynamik mit OSGi Services
  90. 90. Provider Name Value type api.Echo - register availavility 5 - unregister Consumer Name Value - get - listen type api.Echo availavility 5 Service Registry ... ...PojoSRPojo Service Registry
  91. 91. Remote Services Host
  92. 92.  AAPI
  93. 93.  Bundle Provider
  94. 94.  Bundle
  95. 95. Remote Services Host
  96. 96.  AAPI
  97. 97.  Bundle Provider
  98. 98.  Bundle service.exported.interfaces=*
  99. 99. Remote Services Host
  100. 100.  AAPI
  101. 101.  Bundle Provider
  102. 102.  Bundle service.exported.interfaces=* Distribution Provider Impl. (ECF)
  103. 103. Remote Services Host
  104. 104.  AAPI
  105. 105.  Bundle Provider
  106. 106.  Bundle service.exported.interfaces=* listen Distribution Provider Impl. (ECF)
  107. 107. Remote Services Host
  108. 108.  AAPI
  109. 109.  Bundle Provider
  110. 110.  Bundle service.exported.interfaces=* listen get Distribution Provider Impl. (ECF)
  111. 111. Remote Services Host
  112. 112.  A API
  113. 113.  Bundle Provider
  114. 114.  Bundle service.exported.interfaces=*endpoint listen get Distribution Provider Impl. (ECF)
  115. 115. Remote Services Host
  116. 116.  A API
  117. 117.  Bundle Provider
  118. 118.  Bundle exported
  119. 119.   service.exported.interfaces=*endpoint service listen get Distribution Provider Impl. (ECF)
  120. 120. Remote Services Host
  121. 121.  A Host
  122. 122.  B API
  123. 123.  Bundle Provider
  124. 124.  Bundle Consumer
  125. 125.  Bundle API
  126. 126.  Bundle exported
  127. 127.   service.exported.interfaces=*endpoint service listen get Distribution Provider Impl. (ECF)
  128. 128. Remote Services Host
  129. 129.  A Host
  130. 130.  B API
  131. 131.  Bundle Provider
  132. 132.  Bundle Consumer
  133. 133.  Bundle API
  134. 134.  Bundle exported
  135. 135.   service.exported.interfaces=*endpoint service listen get Distribution Provider Impl. (ECF)
  136. 136. Remote Services Host
  137. 137.  A Host
  138. 138.  B API
  139. 139.  Bundle Provider
  140. 140.  Bundle Consumer
  141. 141.  Bundle API
  142. 142.  Bundle exported
  143. 143.   service.exported.interfaces=*endpoint service listen register get Distribution Provider Impl. (ECF)
  144. 144. Remote Services Host
  145. 145.  A Host
  146. 146.  B API
  147. 147.  Bundle Provider
  148. 148.  Bundle Consumer
  149. 149.  Bundle API
  150. 150.  Bundle exported
  151. 151.   service.exported.interfaces=*endpoint service to
  152. 152.  endpoint listen register get Distribution Provider Impl. (ECF)
  153. 153. Remote Services Host
  154. 154.  A Host
  155. 155.  B API
  156. 156.  Bundle Provider
  157. 157.  Bundle Consumer
  158. 158.  Bundle API
  159. 159.  Bundle exported
  160. 160.   imported
  161. 161.   service.exported.interfaces=* serviceendpoint service to
  162. 162.  endpoint listen register get Distribution Provider Impl. (ECF)
  163. 163. Remote Services Demo
  164. 164. OSGi Tooling...
  165. 165. BndtoolsImport Analysis Repositories OBR ResolvingInstant Builder Semantic Versioning Integrated Testing
  166. 166. Warum OSGi?1. Modules, Extension, Plug-ins, Plattformen2. Services, Service Registry, Dynamik Instance Coupling3. Einfachere Entwicklung keine Restarts
  167. 167. “Warum OSGi? ... because it is a better way to develop software ... “ - BJ Hargrave, IBM Peter Kriens, aQute
  168. 168. QATwitter @tux2323
  169. 169. Ressourcen• OSGi Alliance http://www.osgi.org/• OSGi in Action (ISBN 1933988916) Richard S. Hall, Karl Pauls, Stuart McCulloch, and David Savage• Why OSGi? BJ Hargrave (IBM), Peter Kriens (aQute) http://www.slideshare.net/bjhargrave/why-osgi• OSGi: Not Easy Enough to Use. Not as Productive as it Should Be, Rod Johnson http://www.theserverside.com/news/2240037102/OSGi-Not-Easy-Enough- to-Use-Not-as-Productive-as-it-Should-Be• Bndtools http://bndtools.org/• OSGi Demo Mars Robot Project http://code.google.com/a/eclipselabs.org/p/occ/• PojoSR http://code.google.com/p/pojosr/

×