OSGi
The Dynamic Module System for JavaTM
OSGi Motivation
 Growing complexity requires not only highly modular
code, but also systems that are dynamically extensible
 Because there should be simpler way to construct software
systems than writing , writing, and writing …
 No matter which problem domain is your area of concern
◦ Embedded systems need to adapt to changing requirements even
though they are deployed out in the field
◦ Server applications must be configurable and manageable
without down time
◦ Client applications must respond to user desires for new
functionality instantaneously
OSGi Problems to Adders
 Lack of Portability
 Stale Devices
 Software Size
 Software Complexity
 Limits OO Technology
 Quality of Service
OSGi Background
 Started as an embedded platform for the “home
gateway”
 Originally under the JCP as JSR-8 (1999)
 Maintained by OSGi alliance, consists of a large
number of big companies.
 Current version: OSGi Release 4.2 (JSR-294)
OSGi Introduction
 An interesting platform for creating dynamically
extensible applications
 Provides a service-oriented, component based
environment
 Offers standardized ways to manage the
software lifecycle.
 OSGi technology is Universal Middleware.
OSGi What we can achieve
 Resolves many deficiencies associated with
conventional approaches for modularity and
dynamism
◦ Provide a module concept
 Explicit sharing of code (i.e., importing and exporting)
◦ Automatic management of code dependencies
 Enforces sophisticated consistency rules for class
loading
◦ Life-cycle management
 Manages dynamic deployment and configuration
OSGi Architectural Overview
OSGi Framework Layers
L3 - publish/find/bind service model to
decouple bundles
L2 - independent life-cycle of bundles without
JVM restarts
L1 - a module (or bundle) uses classes from
other bundles in a controlled way
L0 - well defined profiles that define the
environment in which bundles can work
OSGi Module
Layer
 Unit of deployment is bundle, a JAR
 Separate class loader per bundle
 Multi-version support (side-by-side)
 Explicit code boundaries and
dependencies
 Metadata in the manifest
 Automatic wiring based on version
ranges
OSGi Life-cycle
Layer
 Managed life cycle
◦ States for each bundle;
 Allows updates of existing
bundles.
◦ Dynamically
install, start, update, and
uninstall
OSGi Service
Layer
 Service interfaces allow bundles to
interact by binding interfaces, not
implementations
 Publish/find/bind intra-VM service
model
OSGi Dynamic Service Lookup
OSGi Framework
Provided Service
Provided Package
install
bundle.jar
Automatic package
dependency resolution
Manual service
dependency resolution
Existing
Bundle
Installed
Bundle
Resolv
-ed
Bundle
resolve bundle
OSGi OSGi Service Advantages
 Lightweight services
◦ Direct method invocation
 Good design practice
◦ Separates interface from implementation
◦ Enables reuse, substitutability, loose coupling, and late binding
 Dynamic
◦ Loose coupling and late binding make it possible to support run-
time dynamism
 Application's configuration is simply the set of
deployed bundles
◦ Deploy only the bundles that you need
OSGi Paint Program
 Create a simple Swing-based paint program
 Define a SimpleShape interface to draw shapes
◦ Different implementations of SimpleShape can be
created to draw different shapes
◦ Each shape has name and icon properties
◦ Available shapes are displayed in tool bar
 To draw a shape, click on its button and then
click in the drawing canvas
◦ Shapes can be dragged, but not resized
 Support dynamic deployment of shapes
OSGi High Level ArchitectureBest practice – Try to
centralize interaction
with OSGi API so that
other components
remain POJOs...only
Shape Tracker will
interact with OSGi API.
Best practice – Do not
make assumptions
about threads...since we
are creating a Swing
application, Shape
Tracker sends events on
Swing thread.
Main application
window – gets
dynamically injected
with available shapes
from the Shape
Tracker..
Actual shape
implementation.
Injected “proxied” shape
implementation to hide
aspects of dynamism
and provide a default
implementation.
Component that draws the
shape in parent frame; looks
up shape via Drawing Frame
rather than having a direct
reference..
OSGi
DEMO
OSGi Adoption
 Applications can leverage OSGi
functionality in two ways
◦ Bundled application
 Build entire application as a set of bundles that will
run on top of a framework instance
◦ Hosted framework
 Host a framework instance inside the application
and externally interact with bundles/services
OSGi Adoption (Bundled vs Hosted)
 Building your application as a set of bundles is
the preferred approach
◦ Allows all parts of application to benefit from OSGi
modularity and dynamism
◦ Allows application to run on any framework
◦ However, it is not always possible to bundle
application, e.g., legacy situations
 Hosted framework approach allows piecemeal
OSGi adoption
◦ Will likely tie application to a framework
implementation

More Related Content

PPT
Enabling modularization through OSGi and SpringDM
PPT
Pro Syst Enterprise OSGi
PDF
Kotlin multi platform
PPTX
Feature flag launchdarkly
PDF
Microservice Approach for Web Development with Micro Frontends
PDF
01/2009 - Portral development with liferay
PPTX
Why choose Yii framework?
PDF
Building blocks of Angular
Enabling modularization through OSGi and SpringDM
Pro Syst Enterprise OSGi
Kotlin multi platform
Feature flag launchdarkly
Microservice Approach for Web Development with Micro Frontends
01/2009 - Portral development with liferay
Why choose Yii framework?
Building blocks of Angular

What's hot (18)

PPTX
Micro Front Ends for Micro Services using Oracle JET
PPT
OSGi Overview TomTom DevDay May 2009
PPTX
How to Build Composite Applications with PRISM
PDF
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
PDF
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
PPTX
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
PPTX
Liferay
PDF
Java Script from Browser to Server
PPTX
Build your own dev tools with salesforce cli plugin generator
PDF
Tutorial introduction to OSGi
PPSX
Yii framework
PPTX
Java fx
PPT
PPTX
Yii framework
PPT
JasForge : the collaborative agile project
PPT
Build Apps Using Dynamic Languages
PPTX
Liferay on docker
Micro Front Ends for Micro Services using Oracle JET
OSGi Overview TomTom DevDay May 2009
How to Build Composite Applications with PRISM
JavaCro'15 - Web UI best practice integration with Java EE 7 - Peter Lehto
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
Liferay
Java Script from Browser to Server
Build your own dev tools with salesforce cli plugin generator
Tutorial introduction to OSGi
Yii framework
Java fx
Yii framework
JasForge : the collaborative agile project
Build Apps Using Dynamic Languages
Liferay on docker
Ad

Viewers also liked (7)

PPTX
Community and Social Change in ASRH Programs Strategies For Measuring Change
PPSX
Aimsory
PPTX
Argh Lessons
PPTX
Each One Invites Three (EOI3) Approach Orientation
PPTX
Cloud storage
PPT
Family planning when “green” is queen: Exploring the potential for fertility ...
PDF
Portfolio Passport
Community and Social Change in ASRH Programs Strategies For Measuring Change
Aimsory
Argh Lessons
Each One Invites Three (EOI3) Approach Orientation
Cloud storage
Family planning when “green” is queen: Exploring the potential for fertility ...
Portfolio Passport
Ad

Similar to OSGi (20)

PPT
OSGi & Blueprint
PPTX
Introduction to OSGi - Part-1
PPT
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
PDF
Osgi Sun 20080820
PDF
OSGi introduction
PDF
OSGi tech session
PDF
OSGi user forum dc metro v1
PDF
OSGi User Forum US DC Metro
PPTX
PPTX
Java 9 Modules: The Duke Yet Lives That OSGi Shall Depose
PDF
Benefits of OSGi in Practise
KEY
Introduction to EclipseRT (JAX 2010)
PPTX
OSGi summary
PPTX
Osgi platform
PPT
Osgi Webinar
PDF
Open Services Gateway Initiative (OSGI)
PPTX
What is os gi and what does osgi
PDF
OSGi bootcamp - part 1
PDF
OSGi Presentation
KEY
OSGi & Blueprint
Introduction to OSGi - Part-1
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
Osgi Sun 20080820
OSGi introduction
OSGi tech session
OSGi user forum dc metro v1
OSGi User Forum US DC Metro
Java 9 Modules: The Duke Yet Lives That OSGi Shall Depose
Benefits of OSGi in Practise
Introduction to EclipseRT (JAX 2010)
OSGi summary
Osgi platform
Osgi Webinar
Open Services Gateway Initiative (OSGI)
What is os gi and what does osgi
OSGi bootcamp - part 1
OSGi Presentation

Recently uploaded (20)

PPTX
Chapter 5: Probability Theory and Statistics
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Hindi spoken digit analysis for native and non-native speakers
PPT
What is a Computer? Input Devices /output devices
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
DOCX
search engine optimization ppt fir known well about this
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Five Habits of High-Impact Board Members
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
Modernising the Digital Integration Hub
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Unlock new opportunities with location data.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Hybrid model detection and classification of lung cancer
Chapter 5: Probability Theory and Statistics
Enhancing emotion recognition model for a student engagement use case through...
Hindi spoken digit analysis for native and non-native speakers
What is a Computer? Input Devices /output devices
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
search engine optimization ppt fir known well about this
O2C Customer Invoices to Receipt V15A.pptx
WOOl fibre morphology and structure.pdf for textiles
Five Habits of High-Impact Board Members
Developing a website for English-speaking practice to English as a foreign la...
Modernising the Digital Integration Hub
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
CloudStack 4.21: First Look Webinar slides
Univ-Connecticut-ChatGPT-Presentaion.pdf
Unlock new opportunities with location data.pdf
1 - Historical Antecedents, Social Consideration.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Hybrid model detection and classification of lung cancer

OSGi

  • 1. OSGi The Dynamic Module System for JavaTM
  • 2. OSGi Motivation  Growing complexity requires not only highly modular code, but also systems that are dynamically extensible  Because there should be simpler way to construct software systems than writing , writing, and writing …  No matter which problem domain is your area of concern ◦ Embedded systems need to adapt to changing requirements even though they are deployed out in the field ◦ Server applications must be configurable and manageable without down time ◦ Client applications must respond to user desires for new functionality instantaneously
  • 3. OSGi Problems to Adders  Lack of Portability  Stale Devices  Software Size  Software Complexity  Limits OO Technology  Quality of Service
  • 4. OSGi Background  Started as an embedded platform for the “home gateway”  Originally under the JCP as JSR-8 (1999)  Maintained by OSGi alliance, consists of a large number of big companies.  Current version: OSGi Release 4.2 (JSR-294)
  • 5. OSGi Introduction  An interesting platform for creating dynamically extensible applications  Provides a service-oriented, component based environment  Offers standardized ways to manage the software lifecycle.  OSGi technology is Universal Middleware.
  • 6. OSGi What we can achieve  Resolves many deficiencies associated with conventional approaches for modularity and dynamism ◦ Provide a module concept  Explicit sharing of code (i.e., importing and exporting) ◦ Automatic management of code dependencies  Enforces sophisticated consistency rules for class loading ◦ Life-cycle management  Manages dynamic deployment and configuration
  • 8. OSGi Framework Layers L3 - publish/find/bind service model to decouple bundles L2 - independent life-cycle of bundles without JVM restarts L1 - a module (or bundle) uses classes from other bundles in a controlled way L0 - well defined profiles that define the environment in which bundles can work
  • 9. OSGi Module Layer  Unit of deployment is bundle, a JAR  Separate class loader per bundle  Multi-version support (side-by-side)  Explicit code boundaries and dependencies  Metadata in the manifest  Automatic wiring based on version ranges
  • 10. OSGi Life-cycle Layer  Managed life cycle ◦ States for each bundle;  Allows updates of existing bundles. ◦ Dynamically install, start, update, and uninstall
  • 11. OSGi Service Layer  Service interfaces allow bundles to interact by binding interfaces, not implementations  Publish/find/bind intra-VM service model
  • 12. OSGi Dynamic Service Lookup OSGi Framework Provided Service Provided Package install bundle.jar Automatic package dependency resolution Manual service dependency resolution Existing Bundle Installed Bundle Resolv -ed Bundle resolve bundle
  • 13. OSGi OSGi Service Advantages  Lightweight services ◦ Direct method invocation  Good design practice ◦ Separates interface from implementation ◦ Enables reuse, substitutability, loose coupling, and late binding  Dynamic ◦ Loose coupling and late binding make it possible to support run- time dynamism  Application's configuration is simply the set of deployed bundles ◦ Deploy only the bundles that you need
  • 14. OSGi Paint Program  Create a simple Swing-based paint program  Define a SimpleShape interface to draw shapes ◦ Different implementations of SimpleShape can be created to draw different shapes ◦ Each shape has name and icon properties ◦ Available shapes are displayed in tool bar  To draw a shape, click on its button and then click in the drawing canvas ◦ Shapes can be dragged, but not resized  Support dynamic deployment of shapes
  • 15. OSGi High Level ArchitectureBest practice – Try to centralize interaction with OSGi API so that other components remain POJOs...only Shape Tracker will interact with OSGi API. Best practice – Do not make assumptions about threads...since we are creating a Swing application, Shape Tracker sends events on Swing thread. Main application window – gets dynamically injected with available shapes from the Shape Tracker.. Actual shape implementation. Injected “proxied” shape implementation to hide aspects of dynamism and provide a default implementation. Component that draws the shape in parent frame; looks up shape via Drawing Frame rather than having a direct reference..
  • 17. OSGi Adoption  Applications can leverage OSGi functionality in two ways ◦ Bundled application  Build entire application as a set of bundles that will run on top of a framework instance ◦ Hosted framework  Host a framework instance inside the application and externally interact with bundles/services
  • 18. OSGi Adoption (Bundled vs Hosted)  Building your application as a set of bundles is the preferred approach ◦ Allows all parts of application to benefit from OSGi modularity and dynamism ◦ Allows application to run on any framework ◦ However, it is not always possible to bundle application, e.g., legacy situations  Hosted framework approach allows piecemeal OSGi adoption ◦ Will likely tie application to a framework implementation