![Page 1: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/1.jpg)
©2014 IBM Corporation
Making everything better with OSGi
a happy case study in building a really nice runtime
Holly Cummins [email protected]
@holly_cummins
![Page 2: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/2.jpg)
©2014 IBM Corporation
Let’s talk about WebSphere.
![Page 3: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/3.jpg)
©2014 IBM Corporation
Let’s talk about WebSphere.
Awesome capabilities…
![Page 4: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/4.jpg)
©2014 IBM Corporation
Let’s talk about WebSphere.
Awesome capabilities…
![Page 5: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/5.jpg)
©2014 IBM Corporation
Let’s talk about WebSphere.
Awesome capabilities…
… for production.
![Page 6: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/6.jpg)
©2014 IBM Corporation
Let’s talk about WebSphere.
Awesome capabilities…
… for production.
For development, historically not so well-suited.
![Page 7: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/7.jpg)
©2014 IBM Corporation
History
![Page 8: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/8.jpg)
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
History
![Page 9: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/9.jpg)
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
History
forever
![Page 10: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/10.jpg)
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
History
forever
![Page 11: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/11.jpg)
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
History
forever
![Page 12: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/12.jpg)
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
Big workloads
History
forever
![Page 13: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/13.jpg)
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
Big workloads
… Big inhibitors to massive change
History
forever
![Page 14: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/14.jpg)
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
Big workloads
… Big inhibitors to massive change
History
This is not a complaint.
This is a problem we arehappy to have.
forever
![Page 15: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/15.jpg)
©2014 IBM Corporation
WebSphere Application Server (the full profile) has been around since 1998
Big codebase
Big customer base
Big workloads
… Big inhibitors to massive change
History
This is not a complaint.
This is a problem we arehappy to have.
But it is still a problem.
forever
![Page 16: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/16.jpg)
©2014 IBM Corporation
![Page 17: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/17.jpg)
©2014 IBM Corporation
Code that has been around forever…
![Page 18: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/18.jpg)
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
![Page 19: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/19.jpg)
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
If your code lives long enough, and is used enough, it ends up looking like…
![Page 20: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/20.jpg)
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
If your code lives long enough, and is used enough, it ends up looking like…
?!
![Page 21: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/21.jpg)
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
If your code lives long enough, and is used enough, it ends up looking like…
dragons
?!
![Page 22: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/22.jpg)
©2014 IBM Corporation
Code that has been around forever…
No matter how good you are, or how smart you are
If your code lives long enough, and is used enough, it ends up looking like…
dragons
?!
Especially code that has roots
going back to late ‘90s…
![Page 23: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/23.jpg)
©2014 IBM Corporation
By Steve Collis from Melbourne, Australia [CC-BY-2.0 (http://
creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
How do you manage dragons?
![Page 24: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/24.jpg)
©2014 IBM Corporation
By Steve Collis from Melbourne, Australia [CC-BY-2.0 (http://
creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
Clever WebSphere architects
How do you manage dragons?
![Page 25: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/25.jpg)
©2014 IBM Corporation
By Steve Collis from Melbourne, Australia [CC-BY-2.0 (http://
creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
Clever WebSphere architects OSGi
How do you manage dragons?
![Page 26: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/26.jpg)
©2014 IBM Corporation
OSGi and WAS: The first pass…
OSGi was included in WAS v6.1, in 2006
Went from lots of arbitrary jars to a few bundles
Achieved some modularity enforced by OSGi
We did not use or expose OSGi services
Compatibility constraints: WAS is the bottom of the stack
Assumptions about resource initialization and availability
Entrenched dependencies between some core elements
![Page 27: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/27.jpg)
©2014 IBM Corporation
Did that fix everything?
![Page 28: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/28.jpg)
©2014 IBM Corporation
Not quite.
Did that fix everything?
By Steve Collis from Melbourne, Australia [CC-
BY-2.0 (http://creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
![Page 29: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/29.jpg)
©2014 IBM Corporation
What if… If we could start over, what would we want?
![Page 30: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/30.jpg)
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
![Page 31: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/31.jpg)
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
![Page 32: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/32.jpg)
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
![Page 33: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/33.jpg)
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
Light-weight
![Page 34: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/34.jpg)
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
Light-weight
Composable / Flexible
![Page 35: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/35.jpg)
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
Light-weight
Composable / Flexible
Extensible
![Page 36: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/36.jpg)
©2014 IBM Corporation
What if… If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
Light-weight
Composable / Flexible
Extensible
selectable content
clear API/SPI runtime/app
isolation
human usable configuration
![Page 37: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/37.jpg)
©2014 IBM Corporation
runtimeonly
some combination oftechnologies
!app-centered
everything
What if…
grokable config
provisioning
![Page 38: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/38.jpg)
©2014 IBM Corporation
What if…
grokable config
provisioning
runtimeonly
some combination oftechnologies
!app-centered
everything
How do we do this?
![Page 39: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/39.jpg)
©2014 IBM Corporation
What if… runtime
only
some combination oftechnologies
!app-centeredeverything
And yet allow this?
no restarts
![Page 40: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/40.jpg)
©2014 IBM Corporation
What if…
And for crying out loud, can we prevent THIS?!
runtime3rd party
bundleB
systembundle
A
![Page 41: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/41.jpg)
©2014 IBM Corporation
What if…
And for crying out loud, can we prevent THIS?!
runtime3rd party
bundleB
systembundle
A
Application
![Page 42: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/42.jpg)
©2014 IBM Corporation
What if…
And for crying out loud, can we prevent THIS?!
runtime3rd party
bundleB
systembundle
A
Application
![Page 43: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/43.jpg)
©2014 IBM Corporation
What if…
And for crying out loud, can we prevent THIS?!
runtime3rd party
bundleB
systembundle
A
Application
X
![Page 44: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/44.jpg)
©2014 IBM Corporation
The egg problem
“Create a light-weight profile of WebSphere that starts in under 2 seconds… Don’t break any eggs”
— Ian Robinson (cleverest WebSphere architect)
![Page 45: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/45.jpg)
©2014 IBM Corporation
The egg problem
“Create a light-weight profile of WebSphere that starts in under 2 seconds… Don’t break any eggs”
— Ian Robinson (cleverest WebSphere architect)
By miya (miya's own file) [CC-BY-3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons
![Page 46: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/46.jpg)
©2014 IBM Corporation
OSGi maturity model
![Page 47: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/47.jpg)
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
![Page 48: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/48.jpg)
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
![Page 49: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/49.jpg)
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
![Page 50: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/50.jpg)
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
![Page 51: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/51.jpg)
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
![Page 52: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/52.jpg)
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
Level 6: Dynamism
![Page 53: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/53.jpg)
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
Level 6: Dynamism
Level 7: Peter Kriens
![Page 54: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/54.jpg)
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
Level 6: Dynamism
Level 7: Peter Kriens
Websphere Full Profile
![Page 55: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/55.jpg)
©2014 IBM Corporation
OSGi maturity modelLevel 1: Ad Hoc
Level 2: Modules
Level 3: Modularity
Level 4: Loose coupling
Level 5: Devolution
Level 6: Dynamism
Level 7: Peter Kriens
Websphere Liberty Profile
![Page 56: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/56.jpg)
©2014 IBM Corporation
Dealing with our legacy
We needed a new kernel
Used the new base to re-group…
Lots of code still common with full profile
Wrap/Shim: New face on old code
Patch: tweak and replace bits where necessary
![Page 57: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/57.jpg)
©2014 IBM Corporation
Building a kernel from scratch
OSGi-based for all the reasons
First-class use of OSGi services
Must react to configuration changes
Runtime composition on-the-fly
![Page 58: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/58.jpg)
©2014 IBM Corporation
Bundle manifests
![Page 59: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/59.jpg)
©2014 IBM Corporation
Bundle manifests? What manifests?We use Eclipse .classpath to
Determine project build order
Generate ant classpath
Bnd takes care of the rest
Declare services using annotations
Bnd makes overrides really easy
Useful when integrating legacy code
![Page 60: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/60.jpg)
©2014 IBM Corporation
Bundle manifests? What manifests?We use Eclipse .classpath to
Determine project build order
Generate ant classpath
Bnd takes care of the rest
Declare services using annotations
Bnd makes overrides really easy
Useful when integrating legacy code
New developers need to have almost no awareness we’re
![Page 61: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/61.jpg)
©2014 IBM Corporation
ConfigurationSettled on XML for configuration format
Ubiquitous
Expressive
BUT, for simplicity:
single file
usable defaults
<server description=“simple”> <featureManager> <feature>jsp-2.2</feature> </featureManager> ! <httpEndpoint id=“defaultHttpEndpoint” httpPort=“9080” httpsPort=“9443” /> </server>
![Page 62: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/62.jpg)
©2014 IBM Corporation
ConfigurationComposable system requires composable configuration:
Individual components own their config
No centralized repository
No externally defined global config model
![Page 63: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/63.jpg)
©2014 IBM Corporation
ConfigurationComposable system requires composable configuration:
Individual components own their config
No centralized repository
No externally defined global config modelConfiguration Admin and Metatype
- job done
![Page 64: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/64.jpg)
©2014 IBM Corporation
ConfigurationComposable system requires composable configuration:
Individual components own their config
No centralized repository
No externally defined global config modelConfiguration Admin and Metatype
- job mostly done
![Page 65: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/65.jpg)
©2014 IBM Corporation
Metatype Equinox impl + extensions
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
![Page 66: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/66.jpg)
©2014 IBM Corporation
Metatype Equinox impl + extensions
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
human readable: 1h30m converted to unit of
choice
![Page 67: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/67.jpg)
©2014 IBM Corporation
Metatype Equinox impl + extensions
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
human readable: 1h30m converted to unit of
choiceused by developer tools to help prompt for the right kind of
path: file vs. url
![Page 68: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/68.jpg)
©2014 IBM Corporation
Metatype Equinox impl + extensions
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
human readable: 1h30m converted to unit of
choiceused by developer tools to help prompt for the right kind of
path: file vs. url
type=“String” ibm:type=“password”
The value is a “SerializedProtectedString”,
which is not a String.
![Page 69: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/69.jpg)
©2014 IBM Corporation
Using OSGi Services…
?
BlueprintDeclarative Services
yes, there are others. We focused on these two.
![Page 70: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/70.jpg)
©2014 IBM Corporation
Using OSGi Services… Who in their right mind wants to manage OSGi services themselves??
?
BlueprintDeclarative Services
yes, there are others. We focused on these two.
![Page 71: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/71.jpg)
©2014 IBM Corporation
Using OSGi Services… Who in their right mind wants to manage OSGi services themselves??
Exactly. NOBODY.?
BlueprintDeclarative Services
yes, there are others. We focused on these two.
![Page 72: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/72.jpg)
©2014 IBM Corporation
Declarative ServicesWe chose DS for two main reasons:
Timing: Blueprint and Aries were just getting started
Integration with Configuration Admin and Metatype!
Config injected as one unit
activate/modified/updated methods
Service instance creation based on metatype-declared factory pid
DS target filters can be set via configuration
![Page 73: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/73.jpg)
©2014 IBM Corporation
DS is AWESOME!
DS is a central part of the Liberty runtime
CA + M + DS = “magic”We do insane things with config-derived target filters
Our runtime would not be what it is without DS in the middle of it
![Page 74: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/74.jpg)
©2014 IBM Corporation
But …
![Page 75: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/75.jpg)
©2014 IBM Corporation
Remember this?We need to prevent
THIS
runtime3rd party
bundleB system
bundleA
Application
X
![Page 76: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/76.jpg)
©2014 IBM Corporation
Package privacy
![Page 77: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/77.jpg)
©2014 IBM Corporation
Package privacy
OSGi lets you keep your internals private.
![Page 78: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/78.jpg)
©2014 IBM Corporation
Package privacy
OSGi lets you keep your internals private.
Your externals are public.
![Page 79: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/79.jpg)
©2014 IBM Corporation
Package privacy
OSGi lets you keep your internals private.
Your externals are public.
PublicPrivate
![Page 80: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/80.jpg)
©2014 IBM Corporation
Package privacy
OSGi lets you keep your internals private.
Your externals are public.
PublicPrivate
![Page 81: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/81.jpg)
©2014 IBM Corporation
Granularity
bundle C
bundle Abundle B
![Page 82: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/82.jpg)
©2014 IBM Corporation
Granularitybundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
![Page 83: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/83.jpg)
©2014 IBM Corporation
Granularitybundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
Wait a minute, it wasn’t supposed to be that
public …
![Page 84: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/84.jpg)
©2014 IBM Corporation
Granularitybundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
Wait a minute, it wasn’t supposed to be that
public …
![Page 85: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/85.jpg)
©2014 IBM Corporation
Granularitybundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
![Page 86: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/86.jpg)
©2014 IBM Corporation
Granularitybundle D
bund
le F
bund
le E
bundle G
bundle M
bund
le N
bund
le I
bundle K
bund
le Jbu
ndle O
bund
le P
bund
le N
bund
le L
bundle M
bund
le Q
bundle C
bund
le A
bund
le B
![Page 87: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/87.jpg)
©2014 IBM Corporation
Granularitybundle D
bund
le F
bund
le E
bundle G
bundle M
bund
le N
bund
le I
bundle K
bund
le Jbu
ndle O
bund
le P
bund
le N
bund
le L
bundle M
bund
le Q
bundle C
bund
le A
bund
le BWhat bundles do I
actually need?
![Page 88: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/88.jpg)
©2014 IBM Corporation
Granularitybundle D
bund
le F
bund
le E
bundle G
bundle M
bund
le N
bund
le I
bundle K
bund
le Jbu
ndle O
bund
le P
bund
le N
bund
le L
bundle M
bund
le Q
bundle C
bund
le A
bund
le BWhat bundles do I
actually need?
Could I just have an archive, please?
![Page 89: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/89.jpg)
©2014 IBM Corporation
Granularitybundle D
bund
le F
bund
le E
bundle G
bundle M
bund
le N
bund
le I
bundle K
bund
le Jbu
ndle O
bund
le P
bund
le N
bund
le L
bundle M
bund
le Q
bundle C
bund
le A
bund
le BWhat bundles do I
actually need?
Could I just have an archive, please?
![Page 90: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/90.jpg)
©2014 IBM Corporation
This is not a new requirement
![Page 91: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/91.jpg)
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
![Page 92: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/92.jpg)
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
Eclipse features
![Page 93: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/93.jpg)
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
Eclipse features
Equinox composite bundles
![Page 94: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/94.jpg)
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
Eclipse features
Equinox composite bundles
Apache Aries Enterprise Bundle Archives (.ebas)
![Page 95: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/95.jpg)
©2014 IBM Corporation
This is not a new requirement
Lots of attempts to solve this problem
Eclipse features
Equinox composite bundles
Apache Aries Enterprise Bundle Archives (.ebas)
Liberty features (mark 1)
![Page 96: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/96.jpg)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
![Page 97: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/97.jpg)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
![Page 98: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/98.jpg)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
![Page 99: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/99.jpg)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
![Page 100: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/100.jpg)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
![Page 101: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/101.jpg)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
Packaging
![Page 102: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/102.jpg)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
Packaging
![Page 103: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/103.jpg)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
Packaging
![Page 104: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/104.jpg)
©2014 IBM Corporation
OSGi Subsystems are AWESOME
A new(ish) OSGi standard
Liberty uses the Apache Aries implementation
Granularity
Package isolation
Packaging
![Page 105: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/105.jpg)
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
![Page 106: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/106.jpg)
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
bundle M
![Page 107: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/107.jpg)
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
bundle M
![Page 108: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/108.jpg)
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
bundle M Extension
![Page 109: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/109.jpg)
©2014 IBM Corporation
When better boxes is not enoughbundle D
bundle F
bundle E
bundle G
bundle H
bundle M
bundle N
bundle I
bundle K
bundle Jbundle O bundle P
bundle N
bundle L bundle M
bundle Q
bundle C
bundle Abundle B
Resolver hook
bundle M Extension
![Page 110: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/110.jpg)
©2014 IBM Corporation
Sophisticated package visibility
Features explicitly declare API and SPI packages (IBM-* metadata in the feature manifest)
Isolation between API/SPI, apps/extensions/runtime is enforced in a few ways:
Subsystems (the Aries impl) for OSGi Applications (API)
Resolver hooks and/or Eclipse Regions for isolation between runtime, extensions (SPI), and containers (API).
![Page 111: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/111.jpg)
©2014 IBM Corporation
Provisioning
![Page 112: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/112.jpg)
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
![Page 113: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/113.jpg)
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
![Page 114: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/114.jpg)
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
installs or uninstalls bundles…
![Page 115: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/115.jpg)
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
installs or uninstalls bundles…
which adds or removes configurations…
![Page 116: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/116.jpg)
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
installs or uninstalls bundles…
which adds or removes configurations…
which triggers the creation or removal of services!
![Page 117: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/117.jpg)
©2014 IBM Corporation
Provisioning
Dynamically install features (subsystems) based on configuration
Adding or removing features …
installs or uninstalls bundles…
which adds or removes configurations…
which triggers the creation or removal of services!
No restart needed. !
#really
![Page 118: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/118.jpg)
©2014 IBM Corporation
Did we get rid of all the dragons?
![Page 119: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/119.jpg)
©2014 IBM Corporation
Did we get rid of all the dragons?
By Abraham (Own work) CC-BY-3.0 via Wikimedia Commons
![Page 120: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/120.jpg)
©2014 IBM Corporation
Did we get rid of all the dragons?
The OSGi dragon
By Abraham (Own work) CC-BY-3.0 via Wikimedia Commons
![Page 121: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/121.jpg)
©2014 IBM Corporation
Did we get rid of all the dragons?
The OSGi dragon
By Abraham (Own work) CC-BY-3.0 via Wikimedia Commons
![Page 122: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/122.jpg)
©2014 IBM Corporation
What version should this be?
![Page 123: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/123.jpg)
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
![Page 124: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/124.jpg)
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
![Page 125: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/125.jpg)
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
![Page 126: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/126.jpg)
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
Beautiful
![Page 127: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/127.jpg)
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
Beautiful
Insufficient
![Page 128: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/128.jpg)
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
Beautiful
Insufficient
Our developers never touch versions
![Page 129: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/129.jpg)
©2014 IBM Corporation
What version should this be?This is ALWAYS a hard problem in any non-trivial evolving system
OSGi just makes the problem more obvious
Semantic versioning is …
Beautiful
Insufficient
Our developers never touch versions
That’s what a release team is for :)
![Page 130: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/130.jpg)
©2014 IBM Corporation
How do I interact with X?Let DS do it. Really.
DS is excellent at managing non-trivial service dependencies
It is very unlikely that you will be able to do better— just let DS do it. That means:
Don’t register services inside a component
Don’t manage references inside a component
![Page 131: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/131.jpg)
©2014 IBM Corporation
Why is my test failing intermittently ?
![Page 132: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/132.jpg)
©2014 IBM Corporation
Why is my test failing intermittently ?
Because something hasn’t happened yet.
![Page 133: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/133.jpg)
©2014 IBM Corporation
Service dynamics can hurt!
![Page 134: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/134.jpg)
©2014 IBM Corporation
Service dynamics can hurt!
Service dynamics are a huge hurdle for “new” developers
![Page 135: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/135.jpg)
©2014 IBM Corporation
Service dynamics can hurt!
Service dynamics are a huge hurdle for “new” developers
DI and IoC can turn even experienced brains inside out if they aren’t prepared. Thankfully, they do seem to recover.
![Page 136: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/136.jpg)
©2014 IBM Corporation
Service dynamics can hurt!
Service dynamics are a huge hurdle for “new” developers
DI and IoC can turn even experienced brains inside out if they aren’t prepared. Thankfully, they do seem to recover.
DS helps a LOT
![Page 137: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/137.jpg)
©2014 IBM Corporation
Service dynamics can hurt!
Service dynamics are a huge hurdle for “new” developers
DI and IoC can turn even experienced brains inside out if they aren’t prepared. Thankfully, they do seem to recover.
DS helps a LOT
But …
![Page 138: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/138.jpg)
©2014 IBM Corporation
Service dynamics can still hurt.
![Page 139: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/139.jpg)
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
![Page 140: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/140.jpg)
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
Easy to make assumptions
![Page 141: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/141.jpg)
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
Easy to make assumptions
Service availability
![Page 142: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/142.jpg)
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
Easy to make assumptions
Service availability
Event ordering
![Page 143: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/143.jpg)
©2014 IBM Corporation
Service dynamics can still hurt.
Being really lazy is hard work!
Easy to make assumptions
Service availability
Event ordering
Especially in our tests
![Page 144: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/144.jpg)
©2014 IBM Corporation
Is the server started?
![Page 145: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/145.jpg)
©2014 IBM Corporation
Is the server started?
The server
![Page 146: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/146.jpg)
©2014 IBM Corporation
Is the server started?
The server
![Page 147: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/147.jpg)
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
The server
![Page 148: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/148.jpg)
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
The server
![Page 149: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/149.jpg)
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
The server
![Page 150: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/150.jpg)
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
The server
![Page 151: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/151.jpg)
©2014 IBM Corporation
Is the server started?What does this boundary even mean
in an extensible system?
Care about the services
you care about
![Page 152: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/152.jpg)
©2014 IBM Corporation
What’s the schema for the configuration?
![Page 153: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/153.jpg)
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
![Page 154: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/154.jpg)
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
![Page 155: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/155.jpg)
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
It’s not so good when your config is wrong.
![Page 156: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/156.jpg)
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
It’s not so good when your config is wrong.
Aggregated documentation is good for users.
![Page 157: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/157.jpg)
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
It’s not so good when your config is wrong.
Aggregated documentation is good for users.
Aggregated documentation is (sort of) needed for tooling
![Page 158: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/158.jpg)
©2014 IBM Corporation
What’s the schema for the configuration?
Devolved configuration is great. But ..
Tolerating unrecognised elements is great when your config is correct.
It’s not so good when your config is wrong.
Aggregated documentation is good for users.
Aggregated documentation is (sort of) needed for tooling
We generate an xsd at build-time so tooling can validate user config
![Page 159: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/159.jpg)
©2014 IBM Corporation
Is it worth it?
![Page 160: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/160.jpg)
©2014 IBM Corporation
Is it worth it?OH YES.
![Page 161: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/161.jpg)
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
![Page 162: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/162.jpg)
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
Starts in 3s …
![Page 163: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/163.jpg)
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
Starts in 3s …
… which we never have to do anyway…
![Page 164: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/164.jpg)
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
Starts in 3s …
… which we never have to do anyway…
… because it’s fully dynamic
![Page 165: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/165.jpg)
©2014 IBM Corporation
Is it worth it?OH YES.
Our server is GREAT.
Starts in 3s …
… which we never have to do anyway…
… because it’s fully dynamic
Concise, shareable configuration
![Page 166: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/166.jpg)
©2014 IBM Corporation
Did it all turn out the way we expected?
A funny thing happened while we were developing for developers …
![Page 167: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/167.jpg)
©2014 IBM Corporation
OSGi was designed for …
![Page 168: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/168.jpg)
©2014 IBM Corporation
OSGi was designed for …
Small embedded system
![Page 169: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/169.jpg)
©2014 IBM Corporation
… but turned out to be perfect for …
![Page 170: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/170.jpg)
©2014 IBM Corporation
… but turned out to be perfect for …
![Page 171: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/171.jpg)
©2014 IBM Corporation
Liberty was designed for …
![Page 172: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/172.jpg)
©2014 IBM Corporation
Liberty was designed for …
Developer-scale
![Page 173: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/173.jpg)
©2014 IBM Corporation
… but turned out to be perfect for…
![Page 174: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/174.jpg)
©2014 IBM Corporation
… but turned out to be perfect for…
BIG scale
![Page 175: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/175.jpg)
©2014 IBM Corporation
BlueMix server farm
… but turned out to be perfect for…
BIG scale
![Page 176: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/176.jpg)
©2014 IBM Corporation
BlueMix server farm
… but turned out to be perfect for…
BIG scale
Lots of Liberty instances
![Page 178: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/178.jpg)
©2014 IBM Corporation
Thank you!
Questions?
Oh, and I have a book!
@holly_cummins www.wasdev.net
![Page 179: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/179.jpg)
©2014 IBM Corporation
Backup
![Page 180: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/180.jpg)
©2014 IBM Corporation
</cleanSlate>Of course, we didn’t really get a clean
slate.Application compatibility had to be
preserved. !
![Page 181: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/181.jpg)
©2014 IBM Corporation
Configuration Admin We rolled our own (sorry)
Parse and merge user configuration and bundle-provided defaults
Resolve variables
Provide configuration to consumers as required by the spec (mostly)
![Page 182: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/182.jpg)
©2014 IBM Corporation
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
unique, final, variable, etc.
Metatype Equinox impl + extensions
http://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_extensions_osgi_metatype.html
human readable: 1h30m converted to unit of used by developer tools to
help prompt for the right kind of path: file vs. url
![Page 183: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/183.jpg)
©2014 IBM Corporation
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
unique, final, variable, etc.
Metatype Equinox impl + extensions
http://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_extensions_osgi_metatype.html
type=“String”ibm:type=“password”
The value is a “SerializedProtectedString”,
which is not a String.
![Page 184: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/184.jpg)
©2014 IBM Corporation
Uniform validation of user input
Define configuration and constraints in one place, it gets used everywhere else.
We favor metatype.xml for this reason
Custom namespace for additional types and validators
ibm:type — duration, location, password
pid/reference
unique, final, variable, etc.
Metatype Equinox impl + extensions
http://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_extensions_osgi_metatype.html
This is some crazy stuff.
ibm:type=“pid” ibm:reference=“specific.service.pid”
Allows nested configuration elements
to define service relationships
![Page 185: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/185.jpg)
©2014 IBM Corporation
IsolationWe mean this in a good way.
Liberty runtime serves two masters:
Typical Application Server paradigm(apps strictly separated from runtime) — API
Platform extender paradigm(the “app” is the runtime) — SPI
Persistent problem:how to allow apps or extensions to use their own versions of libraries that don't conflict with the runtime!?
![Page 186: Making everything better with OSGi - a happy case study in building a really nice runtime - H Cummins](https://reader033.vdocuments.site/reader033/viewer/2022060123/559796421a28ab7d538b45aa/html5/thumbnails/186.jpg)
©2014 IBM Corporation
Private-package declarations pull in redundant classes
Split packages never end well