SlideShare a Scribd company logo
OSGi - Basics


  Runtime modular Java

       Lifecycle handling of
          individual bundles
       Class-loading
       Versioning
       Depency management
       Been around since 1999




PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
Java class visibility


jar (A)                                                   jar (B)



 com.rl.log.api                                             com.rl.app


 com.rl.log.impl

 com.rl.util




   PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
OSGi visibility


       bundle (A)     Bundle-Version: 1.2.3                      bundle (B)       Import-Package:
                      Export: com.rl.api;v=1.2.3                                  com.rl.api;v=[1,2)


         com.rl.log.api                                            com.rl.app


        com.rl.log.impl

        com.rl.util




OSGi adds restrictions on a module-level basis to each deployable unit (bundle).
A bundle however is nothing more than a JAR with added meta-data in MANIFEST.MF


          PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
Traditional vs OSGi classloading

 Traditional (extremely simplified...)                                         OSGi

                                                                                            ClassLoader
             ClassLoader A                                 ClassLoader A                        C.1
            (Loads class A)                               (Loads class A)                   (Loads class
                                                             Sees: A,                           C.1)
                                                                                             Sees: C.1,
                  Sees: A                                     (C.1)                               (D)

                                                                                           ClassLoader D
            ClassLoader B
                                                                                            (Loads class
           (Loads class B)
                                                                                                 D)
              Sees: A,B                                                                        Sees: D


                                                                                            ClassLoader
 ClassLoader X               ClassLoader Y                 ClassLoader B                        C.2
(Loads class X)             (Loads class Y)               (Loads class B)                   (Loads class
                                                                                                C.2)
Sees: A,B,X                                                  Sees: B,                        Sees: C.2,
                             Sees: A,B,Y
                                                              (C.2)                             (D)

                                                          * - Imported bundles classes are actually
                                                              loaded from delegated classloader


          PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
Bundle lifecycle


osgi:install

    deploys bundle
osgi:start

osgi:stop

osgi:update

    uninstall → install →
      resolve → restart
osgi:refresh

    rewire package dep.


       PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
Services




                get()                               register()
Consumer                     Service                               Implementer



Bundle                                                                Bundle
                                        listen()




                                Listener



                                 Bundle
PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
Implementations


  Apache Felix (ASF)
                                                                ServiceMix / Karaf
  Equinox (Eclipse)

  Knoplerfish




PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
The ServiceMix runtime

ServiceMix / Fuse ESB

        CXF                  Camel                   ActiveMQ



Karaf

     Shell                  Security               Provisioning             Karaf features


    Logging              ConfigAdmin                   Deploy

                                      Spring DM                            Dependency injection
           Blueprint
                                     (Spring OSGi                          (optional)
         (Apache Aries)
                                          ext)

              Equinox                    Felix                              OSGi container



    PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING

More Related Content

More from RedpillLinpro

Version control:
Version control:Version control:
Version control:
RedpillLinpro
 
Myths, Open Source &
Myths, Open Source &Myths, Open Source &
Myths, Open Source &
RedpillLinpro
 
11 information disaster risks
11 information disaster risks11 information disaster risks
11 information disaster risks
RedpillLinpro
 
02 stock gwdemo
02 stock gwdemo02 stock gwdemo
02 stock gwdemo
RedpillLinpro
 
01 apache camel-intro
01 apache camel-intro01 apache camel-intro
01 apache camel-intro
RedpillLinpro
 
00 intro & fuse offerings
00 intro & fuse offerings00 intro & fuse offerings
00 intro & fuse offerings
RedpillLinpro
 

More from RedpillLinpro (6)

Version control:
Version control:Version control:
Version control:
 
Myths, Open Source &
Myths, Open Source &Myths, Open Source &
Myths, Open Source &
 
11 information disaster risks
11 information disaster risks11 information disaster risks
11 information disaster risks
 
02 stock gwdemo
02 stock gwdemo02 stock gwdemo
02 stock gwdemo
 
01 apache camel-intro
01 apache camel-intro01 apache camel-intro
01 apache camel-intro
 
00 intro & fuse offerings
00 intro & fuse offerings00 intro & fuse offerings
00 intro & fuse offerings
 

Recently uploaded

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 

Recently uploaded (20)

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 

03 osgi and servicemix

  • 1. OSGi - Basics Runtime modular Java Lifecycle handling of individual bundles Class-loading Versioning Depency management Been around since 1999 PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  • 2. Java class visibility jar (A) jar (B) com.rl.log.api com.rl.app com.rl.log.impl com.rl.util PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  • 3. OSGi visibility bundle (A) Bundle-Version: 1.2.3 bundle (B) Import-Package: Export: com.rl.api;v=1.2.3 com.rl.api;v=[1,2) com.rl.log.api com.rl.app com.rl.log.impl com.rl.util OSGi adds restrictions on a module-level basis to each deployable unit (bundle). A bundle however is nothing more than a JAR with added meta-data in MANIFEST.MF PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  • 4. Traditional vs OSGi classloading Traditional (extremely simplified...) OSGi ClassLoader ClassLoader A ClassLoader A C.1 (Loads class A) (Loads class A) (Loads class Sees: A, C.1) Sees: C.1, Sees: A (C.1) (D) ClassLoader D ClassLoader B (Loads class (Loads class B) D) Sees: A,B Sees: D ClassLoader ClassLoader X ClassLoader Y ClassLoader B C.2 (Loads class X) (Loads class Y) (Loads class B) (Loads class C.2) Sees: A,B,X Sees: B, Sees: C.2, Sees: A,B,Y (C.2) (D) * - Imported bundles classes are actually loaded from delegated classloader PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  • 5. Bundle lifecycle osgi:install deploys bundle osgi:start osgi:stop osgi:update uninstall → install → resolve → restart osgi:refresh rewire package dep. PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  • 6. Services get() register() Consumer Service Implementer Bundle Bundle listen() Listener Bundle PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  • 7. Implementations Apache Felix (ASF) ServiceMix / Karaf Equinox (Eclipse) Knoplerfish PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING
  • 8. The ServiceMix runtime ServiceMix / Fuse ESB CXF Camel ActiveMQ Karaf Shell Security Provisioning Karaf features Logging ConfigAdmin Deploy Spring DM Dependency injection Blueprint (Spring OSGi (optional) (Apache Aries) ext) Equinox Felix OSGi container PRODUCTS • CONSULTING • APPLICATION MANAGEMENT • IT OPERATIONS • SUPPORT • TRAINING