SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
1
Benefits of OSGi in Practice
David Bosschaert
Principal Engineer
JBoss/Red Hat
OSGi EEG co-chair
October 2012
JavaOne Slide Template Title
About me
● Background in AI / Computer Science,
University of Amsterdam (1996)
● Developing software since mid-1980s,
working with Java since 1997
● Joined IONA Technologies, Ireland, 1999
● Involvement with OSGi specs from 2007
● EEG co-chair 2009
● At JBoss/Red Hat since 2010
● Involved in Apache, JBoss, Eclipse
and some github-based opensource projects
JavaOne Slide Template Title
Agenda
● Introduction to OSGi
● OSGi Modularity
● OSGi Services
● Specifications
● Demo
JavaOne Slide Template Title
OSGi
a brief introduction
OSGi – a brief intro
● Dynamic Module and Services platform for Java
● Started 1999
● Specifications created in the OSGi Alliance
● a non-profit Standards Development Organization
● members include: IBM, Oracle, Red Hat, Adobe,
Siemens, TIBCO, France Telecom, Deutsche
Telekom, Technicolor, NTT, Hitachi & many more
● www.osgi.org
OSGi – areas
Core: the OSGi Framework
● Modularity
● Services
● Lifecycle and Dynamicity
● Security
Enterprise: services & component on top of Core Framework
● Addressing Enterprise use-cases, such as:
● Service Distribution
● Component models and IoC
● Configuration and Management
● JavaEE integration
● Cloud Computing
Residential and embedded services/components
OSGi Framework implementations
● The most popular OSGi implementations are
open source:
● Eclipse Equinox
● Apache Felix
● JBoss AS 7
● Knopflerfish
● Commercial implementations also exist
OSGi Enterprise implementations
Also available in open source, in projects such as:
● Commercial implementations exist
● For the full list go to:
http://en.wikipedia.org/wiki/OSGi_Specification_Implementations
Apache Aries Eclipse Gemini
Apache CXF Ops4J Pax
Apache Felix Oracle GlassFish
Eclipse ECF JBoss
Eclipse Equinox KnowHowLab.org
JavaOne Slide Template Title
OSGi – Modularity
Modularity
Non-modular components often keep growing
● blurring their responsibility
● increasing complexity
● making maintenance harder over time
● scope creep
●
in the end: a Big Ball of Mud[1]
OSGi:
● instead of an ever growing component:
● many separate modules
● each with a clear function (and clear API)
[1] http://en.wikipedia.org/wiki/Big_ball_of_mud
“I struggle to maintain this application
because I don't fully understand
what it does”
OSGi Modularity
● In OSGi Modules are called Bundles
● With OSGi Modularity you must declare what a
module provides and what it needs.
● Typically Java packages
● Can be other capabilities
● Everything not explicitly declared as provided is
internal à not accessible to other modules
Bundle ABundle A
org.foo.api
org.foo.impl
Bundle BBundle B
org.bar.impl
OSGi Modularity (2)
● Improves maintainability
● as module boundaries and function must be made
clear
● tends to improve cohesion
● and reduce coupling
● Non-monolithic
● allow for fine-grained
updates of the system
● Concurrent versions
● multiple versions of the same module can co-exist
● allows for gradual upgrades
JavaOne Slide Template Title
OSGi Modularity in Practice
● From a Java point of view. Just use classes as normal:
package org.acme.package1;
import org.acme.package2.MyClass;
...
MyClass ax = new MyClass();
ax.foo()
● OSGi Module Metadata in MANIFEST.MF
Export-Package: org.acme.package1; version=1.2
Import-Package: org.acme.package2; version=[1.1, 2)
Compiler support by some, e.g Eclipse javac
Runtime enforcement by OSGi Framework
JavaOne Slide Template Title
OSGi – Services
Brief intro to
OSGi Services
● Services are Java Objects (POJOs)
● registered by Bundles
● consumed by Bundles
● “SOA inside the JVM”
● Services looked up by type and/or custom filter
● “I want a service that implements org.acme.Payment where
location=US”
● One or many
● Dynamic! Services can be updated without taking down
the consumers
● OSGi Service Consumers react to dynamism
Bundle YBundle YBundle XBundle X
OSGi Services
How can we increase software reuse?
● With OSGi Services there is no direct link between the service
consumer and provider
● not even a text or XML file somewhere
● they communicate through a predefined API
● improves re-usability
● In OSGi software reuse is visibly much higher than elsewhere
● Given clear APIs implementations can be swapped
● even at runtime
● OSGi standardizes some Service APIs
● organizations sometimes do the same
“We have many different
components that perform a
similar task”
JavaOne Slide Template Title
OSGi Services
How can I tailor my services more effectively?
● Customizations are needed for
● Premium customers vs community users
● Customers who bought specific functionality
● Government vs commercial customers
è Services can be used to swap in/out customizations
● To tailor a service, just provide an alternative for a given
API
● Services can be selected based on API and Properties
● Properties can be used to find the right set
of services for a given customer
“We have many customizations that
are labour intensive to support”
JavaOne Slide Template Title
Dynamic Service Selection
The triangle represents an OSGi service
Bundle XBundle X
objectClass=org.api.MySvc
myType=regular
Bundle A (consumer)Bundle A (consumer)
myFilter=(&(objectClass=org.api.MySvc)
(myType=premium))
MySvc svc=getService(myFilter)
svc.doSomething()
Bundle YBundle Y
objectClass=org.api.MySvc
myType=premium
Service selected based on filter
JavaOne Slide Template Title
OSGi Services and Consolidation
I need to replace a Service with an alternative technology
● If the API of the new technology can be mapped to the
existing service
● Create an OSGi Service that wraps the alternative
● Replace the bundle providing the existing service with another
bundle providing the wrapped technology
● If no mapping can take place
● OSGi can still help through multiple concurrent versions
● Gradual migration
“Business consolidation brings many
integration challenges”
JavaOne Slide Template Title
OSGi Services and Bugfixes
● OSGi Service-based development can help a lot here
● Let's say Service A1 contains a bug
● Service A1 has many active clients
● We don't want to kill the clients
● But new clients should use the fixed service
● Service A2 is a fixed version of the service
● Implementation has changed, API hasn't
● Install bundle with Service A2
● Service A1 and A2 exist concurrently
● Uninstall bundle with Service A1
● Old clients can still finish using the service
● Will not be handed out to new clients
“We need to minimize downtime
needed to apply bugfixes”
Bundle X 1.0Bundle X 1.0
service A
OSGi Services and Bugfixes
consumer
consumer
consumer
Apply service bugfixes without downtime
“We need to minimize downtime
needed to apply bugfixes”
Bundle X 1.0Bundle X 1.0
service A
OSGi Services and Bugfixes
consumer
consumer
consumer
Apply service bugfixes without downtime
“We need to minimize downtime
needed to apply bugfixes”
Bundle X 1.0Bundle X 1.0
service A
OSGi Services and Bugfixes
consumer
consumer
consumer
Bundle X 1.1Bundle X 1.1
service A'
Apply service bugfixes without downtime
“We need to minimize downtime
needed to apply bugfixes”
service A
OSGi Services and Bugfixes
consumer
consumer
consumer
Bundle X 1.1Bundle X 1.1
service A'
Apply service bugfixes without downtime
“We need to minimize downtime
needed to apply bugfixes”
service A
OSGi Services and Bugfixes
consumer
consumer
consumer
Bundle X 1.1Bundle X 1.1
service A'
consumer
consumer
Apply service bugfixes without downtime
“We need to minimize downtime
needed to apply bugfixes”
OSGi Services and Bugfixes
Bundle X 1.1Bundle X 1.1
service A'
consumer
consumer
Apply service bugfixes without downtime
“We need to minimize downtime
needed to apply bugfixes”
OSGi Services Summary
● SOA within the Java VM
● Multiple services can provide the same API
● Dynamic (can come and go at runtime)
● and OSGi Service Consumers know how to deal with this
● Lookup based on LDAP-style filters
● look up one or many
● OSGi Services are normally within the Java VM
● also: Distributed OSGi Services
● OSGi Remote Services specifications
JavaOne Slide Template Title
OSGi migration challenges
Challenges – modularity
Migrating existing applications to modular environment is challenging
● Applies to any modular system, not just OSGi
● Requires some planning
● I would suggest a gradual approach
● start with a large bundle containing much of the existing
functionality
● splitting off smaller modules over time
Prevalent modularity anti-patterns
● Class.forName()
● java.util.ServiceLoader
● Thread context classloader
● Solutions exist for each, but requires some attention
Challenges – tooling
● Using OSGi works best when using the right tools
● Generally a combination of tools should be selected, for
● Development (IDE)
● Command-line build
● Testing
● Deployment
● etc...
● New documentation on toolchains:
● http://wiki.osgi.org/wiki/ToolChains
● Great new book: Enterprise OSGi in Action, Cummins et al
JavaOne Slide Template Title
OSGi – Specifications
JavaOne Slide Template Title
OSGi Core Specification (R5)
● Modularity layer and Bundle specification
● Services layer
● Service Registry
● Life Cycle layer
● Everything dynamic!
add, remove, start, stop,
update bundles
● Security layer
● Generic capabilities and requirements model
● … and some low-level
building blocks …
OSGi Enterprise Specification (R5)
● Addresses Enterprise use-cases
● Standard Service APIs
● Configuration
Config Admin / MetaType specs
● Component models (IoC)
Blueprint and Declarative Services
● Eventing
Event Admin spec
● Service Distribution
● Remote Services and Remote Service Admin
● Repository specification
● Subsystems (multi-bundle deployment entities)
● JavaEE integration (JTA, JNDI, JPA, JDBC, ...)
● … and more …
OSGi Applied
JavaOne Slide Template Title
Demo and Questions
● Online version:
http://www.youtube.com/watch?v=S8AI3TqiVk4
JavaOne Slide Template Title
References
Specs: http://www.osgi.org/Specifications
Semantic Versioning
White Paper:
http://www.osgi.org/wiki/uploads/Links/
SemanticVersioning.pdf
Books: Enterprise OSGi in Action (Holly Cummins / Tim Ward)
ISBN: 9781617290138 (Nov 2012)
early access download:
http://www.manning.com/cummins/
OSGi in Action (Richard Hall et al)
ISBN: 9781933988917
OSGi in Depth (Alex Alves)
ISBN: 9781935182177
Java Application Architecture: Modularity Patterns with
Examples using OSGi (Kirk Knoernschild)
ISBN: 9780321247131
JavaOne Slide Template Title
Image credits
● Images from openclipart.org
Cockroach – TrnsltLife
Merge Arrow – spongman
Buildings – jean_victor_balin
Mr Happy – shokunin
Boy, Girl, Man – dcatcherex
Jigsaw puzzle – Benjamin Pavie
Toolkit – bogdanco
JavaOne Slide Template Title
Click to add title
● Click to add an outline

Contenu connexe

Tendances

Apache, osgi and karaf par Guillaume Nodet
Apache, osgi and karaf par Guillaume NodetApache, osgi and karaf par Guillaume Nodet
Apache, osgi and karaf par Guillaume NodetNormandy JUG
 
Embrace Change - Embrace OSGi
Embrace Change - Embrace OSGiEmbrace Change - Embrace OSGi
Embrace Change - Embrace OSGiCarsten Ziegeler
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Azilen Technologies Pvt. Ltd.
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Martin Toshev
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Carsten Ziegeler
 
OSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishOSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishSanjeeb Sahoo
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OpenBlend society
 
Java SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionJava SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionStephen Colebourne
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneidermfrancis
 
CDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily JiangCDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily Jiangmfrancis
 

Tendances (20)

OSGi Blueprint Services
OSGi Blueprint ServicesOSGi Blueprint Services
OSGi Blueprint Services
 
Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012
 
Intro to OSGi
Intro to OSGiIntro to OSGi
Intro to OSGi
 
Modular Java
Modular JavaModular Java
Modular Java
 
Desiging for Modularity with Java 9
Desiging for Modularity with Java 9Desiging for Modularity with Java 9
Desiging for Modularity with Java 9
 
Apache, osgi and karaf par Guillaume Nodet
Apache, osgi and karaf par Guillaume NodetApache, osgi and karaf par Guillaume Nodet
Apache, osgi and karaf par Guillaume Nodet
 
Embrace Change - Embrace OSGi
Embrace Change - Embrace OSGiEmbrace Change - Embrace OSGi
Embrace Change - Embrace OSGi
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)
 
OSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishOSGi & Java EE in GlassFish
OSGi & Java EE in GlassFish
 
Java modularization
Java modularizationJava modularization
Java modularization
 
Modular JavaScript
Modular JavaScriptModular JavaScript
Modular JavaScript
 
Modules or microservices?
Modules or microservices?Modules or microservices?
Modules or microservices?
 
Java modularity: life after Java 9
Java modularity: life after Java 9Java modularity: life after Java 9
Java modularity: life after Java 9
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
 
Java SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionJava SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introduction
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneider
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
CDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily JiangCDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily Jiang
 

Similaire à Benefits of OSGi in Practise

Best Practices for (Enterprise) OSGi applications - Tim Ward
Best Practices for (Enterprise) OSGi applications - Tim WardBest Practices for (Enterprise) OSGi applications - Tim Ward
Best Practices for (Enterprise) OSGi applications - Tim Wardmfrancis
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.Elian, I.
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Molieremfrancis
 
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...DevDay.org
 
OSGi on Google Android using Apache Felix
OSGi on Google Android using Apache FelixOSGi on Google Android using Apache Felix
OSGi on Google Android using Apache FelixMarcel Offermans
 
Android Modularization
Android ModularizationAndroid Modularization
Android ModularizationYoung-Hyuk Yoo
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Reviewnjbartlett
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Nuxeo
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionKnoldus Inc.
 
What is os gi and what does osgi
What is os gi and what does osgiWhat is os gi and what does osgi
What is os gi and what does osgiYunChang Lee
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applicationsJulien Dubois
 
DS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham ChartersDS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham Chartersmfrancis
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
Introduzione a junit + integrazione con archibus
Introduzione a junit + integrazione con archibusIntroduzione a junit + integrazione con archibus
Introduzione a junit + integrazione con archibusDavide Fella
 

Similaire à Benefits of OSGi in Practise (20)

GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
OSGi
OSGiOSGi
OSGi
 
Best Practices for (Enterprise) OSGi applications - Tim Ward
Best Practices for (Enterprise) OSGi applications - Tim WardBest Practices for (Enterprise) OSGi applications - Tim Ward
Best Practices for (Enterprise) OSGi applications - Tim Ward
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
 
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
 
Osgi platform
Osgi platformOsgi platform
Osgi platform
 
OSGi on Google Android using Apache Felix
OSGi on Google Android using Apache FelixOSGi on Google Android using Apache Felix
OSGi on Google Android using Apache Felix
 
Android Modularization
Android ModularizationAndroid Modularization
Android Modularization
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Review
 
Difference between-angular js-nodejs
Difference between-angular js-nodejsDifference between-angular js-nodejs
Difference between-angular js-nodejs
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
 
THE FUTURE OF ANGULAR JS
THE FUTURE OF ANGULAR JSTHE FUTURE OF ANGULAR JS
THE FUTURE OF ANGULAR JS
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
 
Carbon and OSGi Deep Dive
Carbon and OSGi Deep DiveCarbon and OSGi Deep Dive
Carbon and OSGi Deep Dive
 
What is os gi and what does osgi
What is os gi and what does osgiWhat is os gi and what does osgi
What is os gi and what does osgi
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
DS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham ChartersDS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham Charters
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Introduzione a junit + integrazione con archibus
Introduzione a junit + integrazione con archibusIntroduzione a junit + integrazione con archibus
Introduzione a junit + integrazione con archibus
 

Plus de David Bosschaert

Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGiDavid Bosschaert
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixDavid Bosschaert
 
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)David Bosschaert
 
What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)David Bosschaert
 
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)David Bosschaert
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)David Bosschaert
 
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)David Bosschaert
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)David Bosschaert
 
What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0David Bosschaert
 
Update on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert GroupUpdate on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert GroupDavid Bosschaert
 
What's new in the OSGi 4.2 Enterprise Release
What's new in the OSGi 4.2 Enterprise ReleaseWhat's new in the OSGi 4.2 Enterprise Release
What's new in the OSGi 4.2 Enterprise ReleaseDavid Bosschaert
 
Distributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancementsDistributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancementsDavid Bosschaert
 
Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009David Bosschaert
 

Plus de David Bosschaert (15)

Node MCU Fun
Node MCU FunNode MCU Fun
Node MCU Fun
 
Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGi
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
 
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
 
What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)
 
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
 
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
 
OSGi Cloud Ecosystems
OSGi Cloud EcosystemsOSGi Cloud Ecosystems
OSGi Cloud Ecosystems
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)
 
What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0
 
Update on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert GroupUpdate on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert Group
 
What's new in the OSGi 4.2 Enterprise Release
What's new in the OSGi 4.2 Enterprise ReleaseWhat's new in the OSGi 4.2 Enterprise Release
What's new in the OSGi 4.2 Enterprise Release
 
Distributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancementsDistributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancements
 
Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009
 

Dernier

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Benefits of OSGi in Practise

  • 1. 1 Benefits of OSGi in Practice David Bosschaert Principal Engineer JBoss/Red Hat OSGi EEG co-chair October 2012
  • 2. JavaOne Slide Template Title About me ● Background in AI / Computer Science, University of Amsterdam (1996) ● Developing software since mid-1980s, working with Java since 1997 ● Joined IONA Technologies, Ireland, 1999 ● Involvement with OSGi specs from 2007 ● EEG co-chair 2009 ● At JBoss/Red Hat since 2010 ● Involved in Apache, JBoss, Eclipse and some github-based opensource projects
  • 3. JavaOne Slide Template Title Agenda ● Introduction to OSGi ● OSGi Modularity ● OSGi Services ● Specifications ● Demo
  • 4. JavaOne Slide Template Title OSGi a brief introduction
  • 5. OSGi – a brief intro ● Dynamic Module and Services platform for Java ● Started 1999 ● Specifications created in the OSGi Alliance ● a non-profit Standards Development Organization ● members include: IBM, Oracle, Red Hat, Adobe, Siemens, TIBCO, France Telecom, Deutsche Telekom, Technicolor, NTT, Hitachi & many more ● www.osgi.org
  • 6. OSGi – areas Core: the OSGi Framework ● Modularity ● Services ● Lifecycle and Dynamicity ● Security Enterprise: services & component on top of Core Framework ● Addressing Enterprise use-cases, such as: ● Service Distribution ● Component models and IoC ● Configuration and Management ● JavaEE integration ● Cloud Computing Residential and embedded services/components
  • 7. OSGi Framework implementations ● The most popular OSGi implementations are open source: ● Eclipse Equinox ● Apache Felix ● JBoss AS 7 ● Knopflerfish ● Commercial implementations also exist
  • 8. OSGi Enterprise implementations Also available in open source, in projects such as: ● Commercial implementations exist ● For the full list go to: http://en.wikipedia.org/wiki/OSGi_Specification_Implementations Apache Aries Eclipse Gemini Apache CXF Ops4J Pax Apache Felix Oracle GlassFish Eclipse ECF JBoss Eclipse Equinox KnowHowLab.org
  • 9. JavaOne Slide Template Title OSGi – Modularity
  • 10. Modularity Non-modular components often keep growing ● blurring their responsibility ● increasing complexity ● making maintenance harder over time ● scope creep ● in the end: a Big Ball of Mud[1] OSGi: ● instead of an ever growing component: ● many separate modules ● each with a clear function (and clear API) [1] http://en.wikipedia.org/wiki/Big_ball_of_mud “I struggle to maintain this application because I don't fully understand what it does”
  • 11. OSGi Modularity ● In OSGi Modules are called Bundles ● With OSGi Modularity you must declare what a module provides and what it needs. ● Typically Java packages ● Can be other capabilities ● Everything not explicitly declared as provided is internal à not accessible to other modules Bundle ABundle A org.foo.api org.foo.impl Bundle BBundle B org.bar.impl
  • 12. OSGi Modularity (2) ● Improves maintainability ● as module boundaries and function must be made clear ● tends to improve cohesion ● and reduce coupling ● Non-monolithic ● allow for fine-grained updates of the system ● Concurrent versions ● multiple versions of the same module can co-exist ● allows for gradual upgrades
  • 13. JavaOne Slide Template Title OSGi Modularity in Practice ● From a Java point of view. Just use classes as normal: package org.acme.package1; import org.acme.package2.MyClass; ... MyClass ax = new MyClass(); ax.foo() ● OSGi Module Metadata in MANIFEST.MF Export-Package: org.acme.package1; version=1.2 Import-Package: org.acme.package2; version=[1.1, 2) Compiler support by some, e.g Eclipse javac Runtime enforcement by OSGi Framework
  • 14. JavaOne Slide Template Title OSGi – Services
  • 15. Brief intro to OSGi Services ● Services are Java Objects (POJOs) ● registered by Bundles ● consumed by Bundles ● “SOA inside the JVM” ● Services looked up by type and/or custom filter ● “I want a service that implements org.acme.Payment where location=US” ● One or many ● Dynamic! Services can be updated without taking down the consumers ● OSGi Service Consumers react to dynamism Bundle YBundle YBundle XBundle X
  • 16. OSGi Services How can we increase software reuse? ● With OSGi Services there is no direct link between the service consumer and provider ● not even a text or XML file somewhere ● they communicate through a predefined API ● improves re-usability ● In OSGi software reuse is visibly much higher than elsewhere ● Given clear APIs implementations can be swapped ● even at runtime ● OSGi standardizes some Service APIs ● organizations sometimes do the same “We have many different components that perform a similar task”
  • 17. JavaOne Slide Template Title OSGi Services How can I tailor my services more effectively? ● Customizations are needed for ● Premium customers vs community users ● Customers who bought specific functionality ● Government vs commercial customers è Services can be used to swap in/out customizations ● To tailor a service, just provide an alternative for a given API ● Services can be selected based on API and Properties ● Properties can be used to find the right set of services for a given customer “We have many customizations that are labour intensive to support”
  • 18. JavaOne Slide Template Title Dynamic Service Selection The triangle represents an OSGi service Bundle XBundle X objectClass=org.api.MySvc myType=regular Bundle A (consumer)Bundle A (consumer) myFilter=(&(objectClass=org.api.MySvc) (myType=premium)) MySvc svc=getService(myFilter) svc.doSomething() Bundle YBundle Y objectClass=org.api.MySvc myType=premium Service selected based on filter
  • 19. JavaOne Slide Template Title OSGi Services and Consolidation I need to replace a Service with an alternative technology ● If the API of the new technology can be mapped to the existing service ● Create an OSGi Service that wraps the alternative ● Replace the bundle providing the existing service with another bundle providing the wrapped technology ● If no mapping can take place ● OSGi can still help through multiple concurrent versions ● Gradual migration “Business consolidation brings many integration challenges”
  • 20. JavaOne Slide Template Title OSGi Services and Bugfixes ● OSGi Service-based development can help a lot here ● Let's say Service A1 contains a bug ● Service A1 has many active clients ● We don't want to kill the clients ● But new clients should use the fixed service ● Service A2 is a fixed version of the service ● Implementation has changed, API hasn't ● Install bundle with Service A2 ● Service A1 and A2 exist concurrently ● Uninstall bundle with Service A1 ● Old clients can still finish using the service ● Will not be handed out to new clients “We need to minimize downtime needed to apply bugfixes”
  • 21. Bundle X 1.0Bundle X 1.0 service A OSGi Services and Bugfixes consumer consumer consumer Apply service bugfixes without downtime “We need to minimize downtime needed to apply bugfixes”
  • 22. Bundle X 1.0Bundle X 1.0 service A OSGi Services and Bugfixes consumer consumer consumer Apply service bugfixes without downtime “We need to minimize downtime needed to apply bugfixes”
  • 23. Bundle X 1.0Bundle X 1.0 service A OSGi Services and Bugfixes consumer consumer consumer Bundle X 1.1Bundle X 1.1 service A' Apply service bugfixes without downtime “We need to minimize downtime needed to apply bugfixes”
  • 24. service A OSGi Services and Bugfixes consumer consumer consumer Bundle X 1.1Bundle X 1.1 service A' Apply service bugfixes without downtime “We need to minimize downtime needed to apply bugfixes”
  • 25. service A OSGi Services and Bugfixes consumer consumer consumer Bundle X 1.1Bundle X 1.1 service A' consumer consumer Apply service bugfixes without downtime “We need to minimize downtime needed to apply bugfixes”
  • 26. OSGi Services and Bugfixes Bundle X 1.1Bundle X 1.1 service A' consumer consumer Apply service bugfixes without downtime “We need to minimize downtime needed to apply bugfixes”
  • 27. OSGi Services Summary ● SOA within the Java VM ● Multiple services can provide the same API ● Dynamic (can come and go at runtime) ● and OSGi Service Consumers know how to deal with this ● Lookup based on LDAP-style filters ● look up one or many ● OSGi Services are normally within the Java VM ● also: Distributed OSGi Services ● OSGi Remote Services specifications
  • 28. JavaOne Slide Template Title OSGi migration challenges
  • 29. Challenges – modularity Migrating existing applications to modular environment is challenging ● Applies to any modular system, not just OSGi ● Requires some planning ● I would suggest a gradual approach ● start with a large bundle containing much of the existing functionality ● splitting off smaller modules over time Prevalent modularity anti-patterns ● Class.forName() ● java.util.ServiceLoader ● Thread context classloader ● Solutions exist for each, but requires some attention
  • 30. Challenges – tooling ● Using OSGi works best when using the right tools ● Generally a combination of tools should be selected, for ● Development (IDE) ● Command-line build ● Testing ● Deployment ● etc... ● New documentation on toolchains: ● http://wiki.osgi.org/wiki/ToolChains ● Great new book: Enterprise OSGi in Action, Cummins et al
  • 31. JavaOne Slide Template Title OSGi – Specifications
  • 32. JavaOne Slide Template Title OSGi Core Specification (R5) ● Modularity layer and Bundle specification ● Services layer ● Service Registry ● Life Cycle layer ● Everything dynamic! add, remove, start, stop, update bundles ● Security layer ● Generic capabilities and requirements model ● … and some low-level building blocks …
  • 33. OSGi Enterprise Specification (R5) ● Addresses Enterprise use-cases ● Standard Service APIs ● Configuration Config Admin / MetaType specs ● Component models (IoC) Blueprint and Declarative Services ● Eventing Event Admin spec ● Service Distribution ● Remote Services and Remote Service Admin ● Repository specification ● Subsystems (multi-bundle deployment entities) ● JavaEE integration (JTA, JNDI, JPA, JDBC, ...) ● … and more …
  • 35. JavaOne Slide Template Title Demo and Questions ● Online version: http://www.youtube.com/watch?v=S8AI3TqiVk4
  • 36. JavaOne Slide Template Title References Specs: http://www.osgi.org/Specifications Semantic Versioning White Paper: http://www.osgi.org/wiki/uploads/Links/ SemanticVersioning.pdf Books: Enterprise OSGi in Action (Holly Cummins / Tim Ward) ISBN: 9781617290138 (Nov 2012) early access download: http://www.manning.com/cummins/ OSGi in Action (Richard Hall et al) ISBN: 9781933988917 OSGi in Depth (Alex Alves) ISBN: 9781935182177 Java Application Architecture: Modularity Patterns with Examples using OSGi (Kirk Knoernschild) ISBN: 9780321247131
  • 37. JavaOne Slide Template Title Image credits ● Images from openclipart.org Cockroach – TrnsltLife Merge Arrow – spongman Buildings – jean_victor_balin Mr Happy – shokunin Boy, Girl, Man – dcatcherex Jigsaw puzzle – Benjamin Pavie Toolkit – bogdanco
  • 38. JavaOne Slide Template Title Click to add title ● Click to add an outline