Warum OSGi?
-
Upload
christian-baranowski -
Category
Technology
-
view
1.012 -
download
0
description
Transcript of Warum OSGi?
![Page 1: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/1.jpg)
Warum OSGiChristian Baranowski
![Page 2: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/2.jpg)
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
![Page 3: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/3.jpg)
OSGi
![Page 4: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/4.jpg)
OSGi
ModularityModules
![Page 5: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/5.jpg)
OSGi
ModularityModules Lifecycle
![Page 6: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/6.jpg)
OSGi
ModularityModules Lifecycle Services
B
A
Service
![Page 7: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/7.jpg)
OSGi
ModularityModules Lifecycle Services
Security
B
A
Service
![Page 8: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/8.jpg)
OSGi
ModularityModules Lifecycle Services
Security
B
A
Serviceist����������� ������������������ ein����������� ������������������ offener����������� ������������������ Standard����������� ������������������ der����������� ������������������
![Page 9: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/9.jpg)
Warum OSGi?
![Page 10: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/10.jpg)
Erweiterbarkeit / Plugins
![Page 11: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/11.jpg)
Erweiterbarkeit / Plugins
Firefox Eclipse Maven
JenkinsSpring Roo
![Page 12: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/12.jpg)
Bundle
JAR
![Page 13: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/13.jpg)
Bundle
JAR
Private����������� ������������������ Packages
![Page 14: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/14.jpg)
Bundle
JAR
Private����������� ������������������ Packages
Exported����������� ������������������ Packages
![Page 15: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/15.jpg)
Bundle
JAR
Private����������� ������������������ Packages
Exported����������� ������������������ Packages
Imported����������� ������������������ Packages
![Page 16: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/16.jpg)
Funktionen Klassen Packages
Modul Level
![Page 17: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/17.jpg)
Funktionen Klassen Packages Bundles
Modul Level
![Page 18: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/18.jpg)
Bundles
![Page 19: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/19.jpg)
BundlesA
Provider����������� ������������������ Bundle
![Page 20: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/20.jpg)
BundlesA
Provider����������� ������������������ Bundle
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: ABundle-Version: 1.0.1Export-Package: echo.api;version="1.0.0", echo.sysout;version="1.0.0"
![Page 21: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/21.jpg)
BundlesA B
Consumer����������� ������������������ BundleProvider����������� ������������������ Bundle
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: ABundle-Version: 1.0.1Export-Package: echo.api;version="1.0.0", echo.sysout;version="1.0.0"
![Page 22: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/22.jpg)
BundlesA B
Consumer����������� ������������������ BundleProvider����������� ������������������ Bundle
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: BBundle-Version: 1.0.0Import-Package: echo.api;version="[1.0,2)", echo.sysout;version="[1.0,2)"
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: ABundle-Version: 1.0.1Export-Package: echo.api;version="1.0.0", echo.sysout;version="1.0.0"
![Page 23: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/23.jpg)
Demo Modularity / Lifecycle
API
World
Box
Provisioning
Extender
Arch
Desktop
![Page 24: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/24.jpg)
OSGi Services
![Page 25: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/25.jpg)
OSGi Services
API����������� ������������������ Bundle
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: apiBundle-Version: 2.0.0Export-Package: echo.api;version="1.0.0"
![Page 26: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/26.jpg)
OSGi ServicesProvider����������� ������������������ Bundle
API����������� ������������������ Bundle
Service
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: apiBundle-Version: 2.0.0Export-Package: echo.api;version="1.0.0"
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: ABundle-Version: 1.0.1Import-Package: echo.api;version="[1.0,2)"Service-Component: OSGI-INF/EchoProvider.xml
![Page 27: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/27.jpg)
OSGi ServicesConsumer����������� ������������������ BundleProvider����������� ������������������ Bundle
API����������� ������������������ Bundle
Service
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: apiBundle-Version: 2.0.0Export-Package: echo.api;version="1.0.0"
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: BBundle-Version: 1.0.0Import-Package: echo.api;version="[1.0,2)"Service-Component: OSGI-INF/EchoClient.xml
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: ABundle-Version: 1.0.1Import-Package: echo.api;version="[1.0,2)"Service-Component: OSGI-INF/EchoProvider.xml
![Page 28: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/28.jpg)
OSGi ServicesConsumer����������� ������������������ BundleProvider����������� ������������������ Bundle
API����������� ������������������ Bundle
Service
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: apiBundle-Version: 2.0.0Export-Package: echo.api;version="1.0.0"
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: BBundle-Version: 1.0.0Import-Package: echo.api;version="[1.0,2)"Service-Component: OSGI-INF/EchoClient.xml
Manifest-Version: 1.0Bundle-ManifestVersion: 2Bundle-SymbolicName: ABundle-Version: 1.0.1Import-Package: echo.api;version="[1.0,2)"Service-Component: OSGI-INF/EchoProvider.xml
Instance����������� ������������������ Coupling
![Page 29: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/29.jpg)
Service Registry
Provider
Consumer
Service Registry
- register- unregister
- get- listen
Name Valuetype api.Echo
availavility 5
Name Valuetype api.Echo
availavility 5... ...
![Page 30: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/30.jpg)
OSGi Services Demo
API
World
Robot Sensordevices
Desktop
Wall
![Page 31: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/31.jpg)
OSGi Declarative Services
API����������� ������������������ Bundle
![Page 32: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/32.jpg)
OSGi Declarative Services Provider����������� ������������������ Bundle
API����������� ������������������ Bundle
Service
<scr:component name="echo.sysout.EchoProvider"> <implementation class="echo.sysout.EchoProvider"/> <service> <provide interface="echo.api.Echo" /> </service></scr:component>
![Page 33: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/33.jpg)
OSGi Declarative Services Consumer����������� ������������������ BundleProvider����������� ������������������ Bundle
API����������� ������������������ Bundle
Service
<scr:component name="echo.consumer.EchoClient"> <implementation class="echo.consumer.EchoClient"/> <reference name="Echo" interface="echo.api.Echo" bind="setEcho" unbind="unsetEcho" /></scr:component>
<scr:component name="echo.sysout.EchoProvider"> <implementation class="echo.sysout.EchoProvider"/> <service> <provide interface="echo.api.Echo" /> </service></scr:component>
![Page 34: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/34.jpg)
DS AnnotationConsumer����������� ������������������ BundleProvider����������� ������������������ Bundle
API����������� ������������������ Bundle
Service
import org.osgi...annotations.*;import echo.api.Echo;
@Componentpublic class EchoClient {
Echo echo; @Reference public void setEcho(Echo echo){ this.echo = echo; } public void unsetEcho(Echo echo){ this.echo = null; }}
import org.osgi.service.component.annotations.*;import echo.api.Echo;
@Componentpublic class EchoProvider implements Echo { @Activate public void activate() { }
}
![Page 35: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/35.jpg)
Blueprint Services
API����������� ������������������ Bundle
![Page 36: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/36.jpg)
Blueprint ServicesConsumer����������� ������������������ Bundle
API����������� ������������������ Bundle
<blueprint> <bean class="echo.consumer.EchoClient"> <property name="echo" ref="echo" /> </bean></blueprint>
core-context.xml
![Page 37: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/37.jpg)
Blueprint ServicesConsumer����������� ������������������ Bundle
API����������� ������������������ Bundle
Service
<blueprint> <bean class="echo.consumer.EchoClient"> <property name="echo" ref="echo" /> </bean></blueprint>
<blueprint>
<reference id="echo" interface="echo.api.Echo"/></blueprint>
core-context.xml
osgi-context.xml
![Page 38: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/38.jpg)
Blueprint ServicesConsumer����������� ������������������ BundleProvider����������� ������������������ Bundle
API����������� ������������������ Bundle
Service
<beans> <context:component-scan
base-package="echo.sysout" /></beans>
core-context.xml
@Component("echo")public class EchoProvider implements Echo { @PostConstruct public void init() { }}
Spring����������� ������������������ Proprietär
<blueprint> <bean class="echo.consumer.EchoClient"> <property name="echo" ref="echo" /> </bean></blueprint>
<blueprint>
<reference id="echo" interface="echo.api.Echo"/></blueprint>
core-context.xml
osgi-context.xml
![Page 39: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/39.jpg)
Blueprint ServicesConsumer����������� ������������������ BundleProvider����������� ������������������ Bundle
API����������� ������������������ Bundle
Service
<beans> <context:component-scan
base-package="echo.sysout" /></beans>
core-context.xml
<blueprint> <service ref="echo"
interface="echo.api.Echo" /></blueprint>
@Component("echo")public class EchoProvider implements Echo { @PostConstruct public void init() { }}
osgi-context.xml
Spring����������� ������������������ Proprietär
<blueprint> <bean class="echo.consumer.EchoClient"> <property name="echo" ref="echo" /> </bean></blueprint>
<blueprint>
<reference id="echo" interface="echo.api.Echo"/></blueprint>
core-context.xml
osgi-context.xml
![Page 40: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/40.jpg)
Demo Dynamik mit OSGi Services
![Page 41: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/41.jpg)
PojoSRPojo Service Registry
Provider
Consumer
Service Registry
- register- unregister
- get- listen
Name Valuetype api.Echo
availavility 5
Name Valuetype api.Echo
availavility 5... ...
![Page 42: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/42.jpg)
Remote ServicesProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
Host����������� ������������������ A
![Page 43: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/43.jpg)
Remote ServicesProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
service.exported.interfaces=*
Host����������� ������������������ A
![Page 44: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/44.jpg)
Remote ServicesProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
service.exported.interfaces=*
Distribution Provider Impl. (ECF)
Host����������� ������������������ A
![Page 45: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/45.jpg)
Remote ServicesProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
listen
service.exported.interfaces=*
Distribution Provider Impl. (ECF)
Host����������� ������������������ A
![Page 46: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/46.jpg)
Remote ServicesProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
listen
get
service.exported.interfaces=*
Distribution Provider Impl. (ECF)
Host����������� ������������������ A
![Page 47: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/47.jpg)
Remote ServicesProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
listen
get
service.exported.interfaces=*
Distribution Provider Impl. (ECF)
endpoint
Host����������� ������������������ A
![Page 48: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/48.jpg)
Remote ServicesProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
exported����������� ������������������ service
listen
get
service.exported.interfaces=*
Distribution Provider Impl. (ECF)
endpoint
Host����������� ������������������ A
![Page 49: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/49.jpg)
Remote ServicesConsumer����������� ������������������ BundleProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
exported����������� ������������������ service
listen
get
service.exported.interfaces=*
API����������� ������������������ Bundle
Distribution Provider Impl. (ECF)
endpoint
Host����������� ������������������ A Host����������� ������������������ B
![Page 50: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/50.jpg)
Remote ServicesConsumer����������� ������������������ BundleProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
exported����������� ������������������ service
listen
get
service.exported.interfaces=*
API����������� ������������������ Bundle
Distribution Provider Impl. (ECF)
endpoint
Host����������� ������������������ A Host����������� ������������������ B
![Page 51: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/51.jpg)
Remote ServicesConsumer����������� ������������������ BundleProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
exported����������� ������������������ service
listen
get
service.exported.interfaces=*
API����������� ������������������ Bundle
Distribution Provider Impl. (ECF)
endpoint
register
Host����������� ������������������ A Host����������� ������������������ B
![Page 52: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/52.jpg)
Remote ServicesConsumer����������� ������������������ BundleProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
exported����������� ������������������ service
listen
get
service.exported.interfaces=*
API����������� ������������������ Bundle
Distribution Provider Impl. (ECF)
endpoint
register
to����������� ������������������ endpoint
Host����������� ������������������ A Host����������� ������������������ B
![Page 53: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/53.jpg)
Remote ServicesConsumer����������� ������������������ BundleProvider����������� ������������������ BundleAPI����������� ������������������ Bundle
exported����������� ������������������ service
listen
get
service.exported.interfaces=*
API����������� ������������������ Bundle
imported����������� ������������������ service
Distribution Provider Impl. (ECF)
endpoint
register
to����������� ������������������ endpoint
Host����������� ������������������ A Host����������� ������������������ B
![Page 54: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/54.jpg)
Remote Services Demo
![Page 55: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/55.jpg)
OSGi Tooling...
![Page 56: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/56.jpg)
Bndtools
Semantic VersioningInstant Builder Integrated Testing
OBR ResolvingRepositoriesImport Analysis
![Page 57: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/57.jpg)
Warum OSGi?1. Modules, Extension, Plug-ins, Plattformen
2. Services, Service Registry, Dynamik Instance Coupling
3. Einfachere Entwicklung keine Restarts
![Page 58: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/58.jpg)
“Warum OSGi?
- BJ Hargrave, IBM Peter Kriens, aQute
... because it is a better way to develop
software ...“
![Page 59: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/59.jpg)
Q&A
Twitter @tux2323
![Page 60: Warum OSGi?](https://reader034.fdokument.com/reader034/viewer/2022050906/554f504ab4c905524c8b4df6/html5/thumbnails/60.jpg)
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 Johnsonhttp://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 Projecthttp://code.google.com/a/eclipselabs.org/p/occ/
• PojoSRhttp://code.google.com/p/pojosr/