SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
First steps in OSGi
                             Andrea Chiodoni, 2009




martedì, 17 maggio 2011
Understand:
                what OSGi is, why OSGi
                a n d w h y it i s s o
                important to the Java
                community.

martedì, 17 maggio 2011
Agenda
                          Jar Hell problem
                          A definition of OSGi
                          Modularity and Java
                          Architecture
                          Versioning
                          Sample: Activator
                          Sample: Service
                          OSGi implementations
                          Tools for OSGi
                          Repositories
                          Advanced topics
                          What comes next...
martedì, 17 maggio 2011
Jar Hell problem
         Missing Module construct at              Bootstrap Class Loader
         runtime: JARs are only knows at       ${JAVA_HOME}/jre/lib/rt.jar
         build and deploy time
                                                              Delegate to
         Information hiding not properly          Extension Class Loader
         enforced                              ${JAVA_HOME}/jre/lib/ext/

         Version information not consumed                     Delegate to
         at runtime                                System Class Loader
                                                      ${CLASSPATH}
         Java SE/EE are subject to JAR Hell
                                                              Delegate to
         problem
                                               User-Defined Class Loader(s)
         JAR specification is too old for the
         time being (JARs are not modules)!


martedì, 17 maggio 2011
Modularity and Java 1/2
           JSR 277: Java Module System
                  A new module system for Java (JAR -> JAM)
                  Abandoned the 3.12.2008, proceed under Project
                  Jigsaw
           Project Jigsaw (OpenJDK)
                  Many discussions around “The massive, monolithic
                  JDK”
                  Low-level module system to modularise the JDK 7
                  Available for developers to use in their own code
                  Not an official part of the Java SE 7!
                  Interoperate with other module systems (OSGi)
                  Apache Harmony (based on OSGi core)
martedì, 17 maggio 2011
Modularity and Java 2/2
              Open Service Gateway initiative (OSGi)
                     from OSGi Alliance, founded 1999 (Ericsson, IBM,
                     Oracle,...)
                     The Dynamic Module System for Java
                     Target: embedded, client, server systems
                     Widely adopted: even by SUN (Glassfish v3)
                     R1 (JSR 8) in May 2000, R4.1 (JSR 291) in May 2007
                     (current release)
                     Will be closer to Java (language extensions), SUN-
                     OSGi Alliance effort (JSR 294)


martedì, 17 maggio 2011
What is OSGi

                              Extension of the JAR
                                Module = bundle
                               Naming + definition
                                   Versioning
                          ■   Gestione automatica delle dipendenze
                          ■   Gestione del ciclo di vita del codice (configurazione e distribuzione dinamica)




martedì, 17 maggio 2011
Layered architecture

                                              Services
                          Bundles




                                                            Security
                                            Life Cycle
                                            Modules
                                    Execution Environment
                                           Java VM
                                Native Operating System


martedì, 17 maggio 2011
Bundle states

                                 install               refresh
                                                       update

                                Installed                          Starting
                          resolve              refresh
                                               update      start

                                Resolved                            Active
                                                                          stop
                          uninstall        uninstall
                                                                   Stopped
                              Uninstalled
                                                                    Explicit transition
                                                                    Automatic transition




martedì, 17 maggio 2011
Service Registry

                             Service Registry


                  publish      Service           discover
                              Description


               Service Provider           Service Requester
                  <<bundle>>                 <<bundle>>
                                   bind

martedì, 17 maggio 2011
Sample:xx

           <<bundle>>                                 <<bundle>>
                                  <<service>>
                          A              S                B
                              register          get


                                                listen




martedì, 17 maggio 2011
Execution Environments

                          Eclipse Equinox
                             Eclipse
                             Spring DM Server
                             mBedded Server Equinox Edition
                          Apache Felix
                             ServiceMix Kernel
                          Knopflerfish




martedì, 17 maggio 2011
Development Tools

                          Eclipse

                          Maven Bundle Plugin (Apache Felix)

                          http://www.springsource.com/repository

                          Bundle Tool (BND), http://www.aqute.biz/
                          Code/Bnd




martedì, 17 maggio 2011
What comes next
                          Advanced OSGi
                             Standard Services
                             Whiteboard Pattern
                             Event Admin
                             Extender Model Building WEB applications
                             OSGi Bundle Repository (OBR, RFC 112)
                          Spring Dynamic Modules
                          Distributed OSGi Specification (RFC 119, OSGi
                          R4.2)
                          SCA and OSGi


martedì, 17 maggio 2011
References
                          http://www.osgi.org
                          http://neilbartlett.name/blog/osgibook
                          http://blogs.sun.com/mr
                          http://wiki.ops4j.org
                          http://www.eclipse.org/equinox
                          http://www.knopflerfish.org
                          http://felix.apache.org
                          http://www.prosyst.com
                          http://www.aqute.biz/Code/Bnd
                          http://www.springsource.com/repository

martedì, 17 maggio 2011

Contenu connexe

Similaire à An introduction to OSGi

Java 7 - State of the Enterprise
Java 7 - State of the EnterpriseJava 7 - State of the Enterprise
Java 7 - State of the Enterprise
Markus Eisele
 
An introductionto mGAR (Dublin 2011)
An introductionto mGAR (Dublin 2011)An introductionto mGAR (Dublin 2011)
An introductionto mGAR (Dublin 2011)
dmichelsen
 

Similaire à An introduction to OSGi (20)

Java EE Technical Keynote - JavaOne India 2011
Java EE Technical Keynote - JavaOne India 2011Java EE Technical Keynote - JavaOne India 2011
Java EE Technical Keynote - JavaOne India 2011
 
TDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationTDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE Application
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
 
Secrets of the GWT
Secrets of the GWTSecrets of the GWT
Secrets of the GWT
 
OSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFishOSGi-enabled Java EE Applications using GlassFish
OSGi-enabled Java EE Applications using GlassFish
 
OSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFishOSGi-enabled Java EE applications in GlassFish
OSGi-enabled Java EE applications in GlassFish
 
All the Java ADF beginners need to know - part1
All the Java ADF beginners need to know - part1All the Java ADF beginners need to know - part1
All the Java ADF beginners need to know - part1
 
Java 7 Dolphin manjula kollipara
Java 7 Dolphin manjula kolliparaJava 7 Dolphin manjula kollipara
Java 7 Dolphin manjula kollipara
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
 
Groke
GrokeGroke
Groke
 
OSGi & Java EE in GlassFish - Best of both worlds
OSGi & Java EE in GlassFish - Best of both worldsOSGi & Java EE in GlassFish - Best of both worlds
OSGi & Java EE in GlassFish - Best of both worlds
 
Java 7 - State of the Enterprise
Java 7 - State of the EnterpriseJava 7 - State of the Enterprise
Java 7 - State of the Enterprise
 
Modularity with OSGi
Modularity with OSGiModularity with OSGi
Modularity with OSGi
 
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
 
Banking on Enterprise OSGi
Banking on Enterprise OSGiBanking on Enterprise OSGi
Banking on Enterprise OSGi
 
An introductionto mGAR (Dublin 2011)
An introductionto mGAR (Dublin 2011)An introductionto mGAR (Dublin 2011)
An introductionto mGAR (Dublin 2011)
 
Java Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewJava Enterprise Edition 6 Overview
Java Enterprise Edition 6 Overview
 
Zookeeper In Simple Words
Zookeeper In Simple WordsZookeeper In Simple Words
Zookeeper In Simple Words
 
Liferay Module Framework
Liferay Module FrameworkLiferay Module Framework
Liferay Module Framework
 
Spark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopSpark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 Workshop
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

An introduction to OSGi

  • 1. First steps in OSGi Andrea Chiodoni, 2009 martedì, 17 maggio 2011
  • 2. Understand: what OSGi is, why OSGi a n d w h y it i s s o important to the Java community. martedì, 17 maggio 2011
  • 3. Agenda Jar Hell problem A definition of OSGi Modularity and Java Architecture Versioning Sample: Activator Sample: Service OSGi implementations Tools for OSGi Repositories Advanced topics What comes next... martedì, 17 maggio 2011
  • 4. Jar Hell problem Missing Module construct at Bootstrap Class Loader runtime: JARs are only knows at ${JAVA_HOME}/jre/lib/rt.jar build and deploy time Delegate to Information hiding not properly Extension Class Loader enforced ${JAVA_HOME}/jre/lib/ext/ Version information not consumed Delegate to at runtime System Class Loader ${CLASSPATH} Java SE/EE are subject to JAR Hell Delegate to problem User-Defined Class Loader(s) JAR specification is too old for the time being (JARs are not modules)! martedì, 17 maggio 2011
  • 5. Modularity and Java 1/2 JSR 277: Java Module System A new module system for Java (JAR -> JAM) Abandoned the 3.12.2008, proceed under Project Jigsaw Project Jigsaw (OpenJDK) Many discussions around “The massive, monolithic JDK” Low-level module system to modularise the JDK 7 Available for developers to use in their own code Not an official part of the Java SE 7! Interoperate with other module systems (OSGi) Apache Harmony (based on OSGi core) martedì, 17 maggio 2011
  • 6. Modularity and Java 2/2 Open Service Gateway initiative (OSGi) from OSGi Alliance, founded 1999 (Ericsson, IBM, Oracle,...) The Dynamic Module System for Java Target: embedded, client, server systems Widely adopted: even by SUN (Glassfish v3) R1 (JSR 8) in May 2000, R4.1 (JSR 291) in May 2007 (current release) Will be closer to Java (language extensions), SUN- OSGi Alliance effort (JSR 294) martedì, 17 maggio 2011
  • 7. What is OSGi Extension of the JAR Module = bundle Naming + definition Versioning ■ Gestione automatica delle dipendenze ■ Gestione del ciclo di vita del codice (configurazione e distribuzione dinamica) martedì, 17 maggio 2011
  • 8. Layered architecture Services Bundles Security Life Cycle Modules Execution Environment Java VM Native Operating System martedì, 17 maggio 2011
  • 9. Bundle states install refresh update Installed Starting resolve refresh update start Resolved Active stop uninstall uninstall Stopped Uninstalled Explicit transition Automatic transition martedì, 17 maggio 2011
  • 10. Service Registry Service Registry publish Service discover Description Service Provider Service Requester <<bundle>> <<bundle>> bind martedì, 17 maggio 2011
  • 11. Sample:xx <<bundle>> <<bundle>> <<service>> A S B register get listen martedì, 17 maggio 2011
  • 12. Execution Environments Eclipse Equinox Eclipse Spring DM Server mBedded Server Equinox Edition Apache Felix ServiceMix Kernel Knopflerfish martedì, 17 maggio 2011
  • 13. Development Tools Eclipse Maven Bundle Plugin (Apache Felix) http://www.springsource.com/repository Bundle Tool (BND), http://www.aqute.biz/ Code/Bnd martedì, 17 maggio 2011
  • 14. What comes next Advanced OSGi Standard Services Whiteboard Pattern Event Admin Extender Model Building WEB applications OSGi Bundle Repository (OBR, RFC 112) Spring Dynamic Modules Distributed OSGi Specification (RFC 119, OSGi R4.2) SCA and OSGi martedì, 17 maggio 2011
  • 15. References http://www.osgi.org http://neilbartlett.name/blog/osgibook http://blogs.sun.com/mr http://wiki.ops4j.org http://www.eclipse.org/equinox http://www.knopflerfish.org http://felix.apache.org http://www.prosyst.com http://www.aqute.biz/Code/Bnd http://www.springsource.com/repository martedì, 17 maggio 2011