SlideShare a Scribd company logo
©2014 IBM Corporation
Building a right-sized,
do-anything runtime
using OSGi technologies
a case study 

(sort of)
Erin Schnabel
schnabel@us.ibm.com
@ebullientworks
©2014 IBM Corporation
<background>
©2014 IBM Corporation
Some notes on motivation
The full profile of WebSphere application server is awesome in
its capabilities
It is also well-known that the full profile is not well-suited
for development
We did and do listen… and were presented with a challenge: 

“Create a light-weight profile of WebSphere that starts in
under 2 seconds… [but] Don’t break any eggs” — Ian Robinson
©2014 IBM Corporation
History
WebSphere Application Server (the full profile) has been around
forever.
Big codebase
Big customer base
Big workloads
… Big inhibitors to massive change

©2014 IBM Corporation
History
WebSphere Application Server (the full profile) has been around
forever.
Big codebase
Big customer base
Big workloads
… Big inhibitors to massive change

This is not a complaint.
This is a problem we are

happy to have.
©2014 IBM Corporation
History
WebSphere Application Server (the full profile) has been around
forever.
Big codebase
Big customer base
Big workloads
… Big inhibitors to massive change

This is not a complaint.
This is a problem we are

happy to have.
But it is still a problem.
©2014 IBM Corporation
Code that has been around
forever…
Doesn’t matter how good you are, 

or how smart you are













©2014 IBM Corporation
Code that has been around
forever…
Doesn’t 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… 





©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
?!
©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…
©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
©2014 IBM Corporation
</background>
©2014 IBM Corporation
<cleanSlate>
This is the version of the story you won’t have
heard before…
©2014 IBM Corporation
What if…
If we could start over, what would we want?
Developer-friendly
Simple
Dynamic
Light-weight
Composable / Flexible
Extensible
©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
©2014 IBM Corporation
runtime

only
some combination of

technologies

!
app-centered
everything
What if…
grokable
config
provisioning
©2014 IBM Corporation
What if…
grokable
config
provisioning
runtime

only
some combination of

technologies

!
app-centered
everything
How do we do this?
©2014 IBM Corporation
What if…
runtime

only
some combination of

technologies

!
app-centeredeverything
And yet allow this?
no restarts
©2014 IBM Corporation
What if…
And for crying out loud,
can we prevent THIS?!
runtime3rd party

bundle

B
system

bundle

A
Application
X
©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





©2014 IBM Corporation
Configuration
Settled 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>
©2014 IBM Corporation
Configuration
Composable system requires composable configuration:
Individual components own their config

No centralized repository
No externally defined global config model
©2014 IBM Corporation
Configuration
Composable system requires composable configuration:
Individual components own their config

No centralized repository
No externally defined global config model
Configuration Admin and Metatype #FTW!
©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)











©2014 IBM Corporation
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
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.
©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 choice used by developer tools to help
prompt for the right kind of path:
file vs. url
©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.


Developer tools display encoding options: xor or aes, etc.
©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



#awesome
©2014 IBM Corporation
Provisioning
Two phases of provisioning:
Bootstrap the kernel to get configuration
Add or remove features based on configuration update
Features as in Subsystem features 

(*.esa files, metadata, etc.)
Adding or removing features 

installs or uninstalls bundles, which 

adds or removes configurations, which

triggers the creation or removal of services!
©2014 IBM Corporation
Provisioning
Two phases of provisioning:
Bootstrap the kernel to get configuration
Add or remove features based on configuration update
Features as in Subsystem features 

(*.esa files, metadata, etc.)
Adding or removing features 

installs or uninstalls bundles, which 

adds or removes configurations, which

triggers the creation or removal of services!
Dynamically respond to
configuration changes at any time
without requiring a restart.
!
#really
©2014 IBM Corporation
Using OSGi Services…
But who in their right mind wants to manage OSGi
services themselves??
©2014 IBM Corporation
Using OSGi Services…
But who in their right mind wants to manage OSGi
services themselves??
Exactly. NOBODY.
©2014 IBM Corporation
Using OSGi Services…
But who in their right mind wants to manage OSGi
services themselves??
Exactly. NOBODY.
?
BlueprintDeclarative Services
yes, there are others. 

We focused on these two.
©2014 IBM Corporation
Declarative Services
We 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
©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
BUT..
©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.
Utilities created to “help” can have unintended consequences. 

Especially if cut and paste are involved.
There is definitely a “better way” to do things with DS..
©2014 IBM Corporation
Let DS do it. Really.
DS is excellent at managing service dynamics.
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
©2014 IBM Corporation
Isolation
We 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!?
©2014 IBM Corporation
Subsystems, Resolver Hooks, and
Regions… (oh my!)
Features must 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).
©2014 IBM Corporation
</cleanSlate>
Of course, we didn’t really get a clean slate.

Application compatibility had to be preserved.
!
But that still gave us a LOT of room…
©2014 IBM Corporation
Dealing with our legacy
We did start over with our 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
©2014 IBM Corporation
Thank you!
Questions?

More Related Content

PPTX
Taking the Application Server to Web Scale with Netflix Open Source Software
PDF
Making everything better with OSGi - a happy case study in building a really ...
PDF
Zero to Portlet in 20 minutes or less
PPT
IBM WebSphere Liberty and Docker Deep Dive
PDF
What's New in WebSphere Application Server
PDF
Why i - Common Europe 2012
PPT
IBM Impact Session 2351 hybrid apps
PDF
Server Day 2009: Spring dm Server by Alef Arendsen
Taking the Application Server to Web Scale with Netflix Open Source Software
Making everything better with OSGi - a happy case study in building a really ...
Zero to Portlet in 20 minutes or less
IBM WebSphere Liberty and Docker Deep Dive
What's New in WebSphere Application Server
Why i - Common Europe 2012
IBM Impact Session 2351 hybrid apps
Server Day 2009: Spring dm Server by Alef Arendsen

What's hot (19)

PDF
Workload Groups overview updates
PDF
Ibm webpshere
PDF
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
PDF
David Coletta Architecting A Shared Codebase For Browser And Desktop Final
PPTX
AWS DevDay Berlin - Automating building blocks choices you will face with con...
PDF
IBM Software Available In The Cloud With Amazon Web Services
PDF
JVM Multitenancy (JavaOne 2012)
PDF
Fremtidens platform til koncernsystemer (IBM System z)
PPTX
Session One Intro
PDF
PHP in the Cloud
PDF
Orange is v cops
PPTX
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
PDF
Angrybirds Magento Cloud Deployment
 
PDF
20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信
PDF
Paremus Cloud and OSGi Beyond the VM - OSGi Cloud Workshop March 2012
PPTX
Delivering Secure OpenStack IaaS for SaaS Products - OpenStack 2012.pptx
PPTX
Delivering Secure OpenStack IaaS for SaaS Products
PDF
De 03 Introduction To V Cloud Api V1
PDF
Presentation from physical to virtual to cloud emc
Workload Groups overview updates
Ibm webpshere
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
David Coletta Architecting A Shared Codebase For Browser And Desktop Final
AWS DevDay Berlin - Automating building blocks choices you will face with con...
IBM Software Available In The Cloud With Amazon Web Services
JVM Multitenancy (JavaOne 2012)
Fremtidens platform til koncernsystemer (IBM System z)
Session One Intro
PHP in the Cloud
Orange is v cops
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
Angrybirds Magento Cloud Deployment
 
20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信
Paremus Cloud and OSGi Beyond the VM - OSGi Cloud Workshop March 2012
Delivering Secure OpenStack IaaS for SaaS Products - OpenStack 2012.pptx
Delivering Secure OpenStack IaaS for SaaS Products
De 03 Introduction To V Cloud Api V1
Presentation from physical to virtual to cloud emc
Ad

Similar to Building a right sized, do-anything runtime using OSGi technologies: a case study - E Schnabel (20)

PDF
Microprofile at IBM with Liberty
PDF
IBM - Developing portlets using Script portlet in WP 8001
PPT
2109 mobile cloud integrating your mobile workloads with the enterprise
PDF
Java on zSystems zOS
PDF
Big SQL: Powerful SQL Optimization - Re-Imagined for open source
PPTX
AWS Jozi Meetup Developing Modern Applications in the Cloud
PPTX
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
PPTX
AWS Accra Meetup - Developing Modern Applications in the Cloud
PDF
Containerize, PaaS, or Go Serverless!?
PDF
Turning the Heat up on DevOps: Providing a web-based editing experience aroun...
PDF
PureSystems on the Public Cloud John Kaemmerer and Gerry Novan, 11th Sep 14
PDF
1812 icap-v1.3 0430
PDF
Meetup - Serverless
PDF
Platform as a Service - Cloud Foundry and IBM Bluemix
PDF
Continuous Application Delivery to WebSphere - Featuring IBM UrbanCode
PDF
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
PDF
Practical WebAssembly with Apex, wasmRS, and nanobus
PDF
Webcast urbancodemobiltomainframe
PDF
WSO2Con EU 2015: Keynote - The Containerization of the Developer Workspace
PPTX
Why is Infrastructure-as-Code essential in the Cloud Age?
Microprofile at IBM with Liberty
IBM - Developing portlets using Script portlet in WP 8001
2109 mobile cloud integrating your mobile workloads with the enterprise
Java on zSystems zOS
Big SQL: Powerful SQL Optimization - Re-Imagined for open source
AWS Jozi Meetup Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the Cloud
Containerize, PaaS, or Go Serverless!?
Turning the Heat up on DevOps: Providing a web-based editing experience aroun...
PureSystems on the Public Cloud John Kaemmerer and Gerry Novan, 11th Sep 14
1812 icap-v1.3 0430
Meetup - Serverless
Platform as a Service - Cloud Foundry and IBM Bluemix
Continuous Application Delivery to WebSphere - Featuring IBM UrbanCode
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
Practical WebAssembly with Apex, wasmRS, and nanobus
Webcast urbancodemobiltomainframe
WSO2Con EU 2015: Keynote - The Containerization of the Developer Workspace
Why is Infrastructure-as-Code essential in the Cloud Age?
Ad

More from mfrancis (20)

PDF
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
PDF
OSGi and Java 9+ - BJ Hargrave (IBM)
PDF
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
PDF
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
PDF
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
PDF
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
PDF
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
PDF
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
PDF
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
PDF
OSGi CDI Integration Specification - Ray Augé (Liferay)
PDF
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
PDF
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
PDF
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
PDF
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
PDF
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
PDF
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
PDF
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
PDF
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
PDF
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
PDF
How to connect your OSGi application - Dirk Fauth (Bosch)
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
OSGi and Java 9+ - BJ Hargrave (IBM)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
OSGi CDI Integration Specification - Ray Augé (Liferay)
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
How to connect your OSGi application - Dirk Fauth (Bosch)

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
Teaching material agriculture food technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation theory and applications.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Machine learning based COVID-19 study performance prediction
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Electronic commerce courselecture one. Pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Chapter 3 Spatial Domain Image Processing.pdf
Teaching material agriculture food technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Network Security Unit 5.pdf for BCA BBA.
Encapsulation theory and applications.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectroscopy.pptx food analysis technology
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
MYSQL Presentation for SQL database connectivity
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Dropbox Q2 2025 Financial Results & Investor Presentation
Electronic commerce courselecture one. Pdf
Building Integrated photovoltaic BIPV_UPV.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Building a right sized, do-anything runtime using OSGi technologies: a case study - E Schnabel

  • 1. ©2014 IBM Corporation Building a right-sized, do-anything runtime using OSGi technologies a case study 
 (sort of) Erin Schnabel schnabel@us.ibm.com @ebullientworks
  • 3. ©2014 IBM Corporation Some notes on motivation The full profile of WebSphere application server is awesome in its capabilities It is also well-known that the full profile is not well-suited for development We did and do listen… and were presented with a challenge: 
 “Create a light-weight profile of WebSphere that starts in under 2 seconds… [but] Don’t break any eggs” — Ian Robinson
  • 4. ©2014 IBM Corporation History WebSphere Application Server (the full profile) has been around forever. Big codebase Big customer base Big workloads … Big inhibitors to massive change

  • 5. ©2014 IBM Corporation History WebSphere Application Server (the full profile) has been around forever. Big codebase Big customer base Big workloads … Big inhibitors to massive change
 This is not a complaint. This is a problem we are
 happy to have.
  • 6. ©2014 IBM Corporation History WebSphere Application Server (the full profile) has been around forever. Big codebase Big customer base Big workloads … Big inhibitors to massive change
 This is not a complaint. This is a problem we are
 happy to have. But it is still a problem.
  • 7. ©2014 IBM Corporation Code that has been around forever… Doesn’t matter how good you are, 
 or how smart you are
 
 
 
 
 
 

  • 8. ©2014 IBM Corporation Code that has been around forever… Doesn’t 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… 
 
 

  • 9. ©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 ?!
  • 10. ©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…
  • 11. ©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
  • 13. ©2014 IBM Corporation <cleanSlate> This is the version of the story you won’t have heard before…
  • 14. ©2014 IBM Corporation What if… If we could start over, what would we want? Developer-friendly Simple Dynamic Light-weight Composable / Flexible Extensible
  • 15. ©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
  • 16. ©2014 IBM Corporation runtime
 only some combination of
 technologies
 ! app-centered everything What if… grokable config provisioning
  • 17. ©2014 IBM Corporation What if… grokable config provisioning runtime
 only some combination of
 technologies
 ! app-centered everything How do we do this?
  • 18. ©2014 IBM Corporation What if… runtime
 only some combination of
 technologies
 ! app-centeredeverything And yet allow this? no restarts
  • 19. ©2014 IBM Corporation What if… And for crying out loud, can we prevent THIS?! runtime3rd party
 bundle
 B system
 bundle
 A Application X
  • 20. ©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
 
 

  • 21. ©2014 IBM Corporation Configuration Settled 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>
  • 22. ©2014 IBM Corporation Configuration Composable system requires composable configuration: Individual components own their config
 No centralized repository No externally defined global config model
  • 23. ©2014 IBM Corporation Configuration Composable system requires composable configuration: Individual components own their config
 No centralized repository No externally defined global config model Configuration Admin and Metatype #FTW!
  • 24. ©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)
 
 
 
 
 

  • 25. ©2014 IBM Corporation 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 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.
  • 26. ©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 choice used by developer tools to help prompt for the right kind of path: file vs. url
  • 27. ©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. 
 Developer tools display encoding options: xor or aes, etc.
  • 28. ©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
 
 #awesome
  • 29. ©2014 IBM Corporation Provisioning Two phases of provisioning: Bootstrap the kernel to get configuration Add or remove features based on configuration update Features as in Subsystem features 
 (*.esa files, metadata, etc.) Adding or removing features 
 installs or uninstalls bundles, which 
 adds or removes configurations, which
 triggers the creation or removal of services!
  • 30. ©2014 IBM Corporation Provisioning Two phases of provisioning: Bootstrap the kernel to get configuration Add or remove features based on configuration update Features as in Subsystem features 
 (*.esa files, metadata, etc.) Adding or removing features 
 installs or uninstalls bundles, which 
 adds or removes configurations, which
 triggers the creation or removal of services! Dynamically respond to configuration changes at any time without requiring a restart. ! #really
  • 31. ©2014 IBM Corporation Using OSGi Services… But who in their right mind wants to manage OSGi services themselves??
  • 32. ©2014 IBM Corporation Using OSGi Services… But who in their right mind wants to manage OSGi services themselves?? Exactly. NOBODY.
  • 33. ©2014 IBM Corporation Using OSGi Services… But who in their right mind wants to manage OSGi services themselves?? Exactly. NOBODY. ? BlueprintDeclarative Services yes, there are others. 
 We focused on these two.
  • 34. ©2014 IBM Corporation Declarative Services We 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
  • 35. ©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 BUT..
  • 36. ©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. Utilities created to “help” can have unintended consequences. 
 Especially if cut and paste are involved. There is definitely a “better way” to do things with DS..
  • 37. ©2014 IBM Corporation Let DS do it. Really. DS is excellent at managing service dynamics. 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
  • 38. ©2014 IBM Corporation Isolation We 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!?
  • 39. ©2014 IBM Corporation Subsystems, Resolver Hooks, and Regions… (oh my!) Features must 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).
  • 40. ©2014 IBM Corporation </cleanSlate> Of course, we didn’t really get a clean slate.
 Application compatibility had to be preserved. ! But that still gave us a LOT of room…
  • 41. ©2014 IBM Corporation Dealing with our legacy We did start over with our 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
  • 42. ©2014 IBM Corporation Thank you! Questions?