SlideShare a Scribd company logo
1 of 30
Introduction to OSGi using Apache Karaf  Ioannis Canellos JHUG / 16 April 2011
Presenting today… OSGi Open Services Gateway initiative, since 1999 Initially targeted embedded devices OSGi containers: Felix, Equinox, Knoperfish, Concierge Most known use is Eclipse IDE Apache Karaf Apache OSGi runtime runs on any OSGi container Born inside Service Mix, now is Top level project Standard runtime for Geronimo, Service Mix, Sling Ecosystem for deploying OSGi/EE applications
Part I Introduction to OSGi
Introduction to OSGi Problem  Solution Architecture Tools OSGi in the Enterprise Questions & Answers
The problemaspects  Dependency management Version Hell Conflicting dependencies Class loading issues Dynamic behavior Difficulties to control component lifecycle Lack of a pure modularity solution
The problemsDependency management Large number of transitive dependencies Conflicts among among dependencies Class loading issues Boot class loader JTA System class loader JTA war war
The problemsDynamic Behavior Components & Services need come and go Components need to get updated / replaced Components need to started / stopped Real life examples Eclipse IDE Adding/Removing “plugins” Ebay Multiple version of the same component
The problemsModularity The JVM does not address need for modularity The class path paradox The jar is a “black box” No dependencies & No version The pastitsioexample The “WORA” promise was repeatedly failed JavaBeans EJBs Has the quest for modularity failed ? Project Jigsaw will be shipped with JDK 8  OSGi is already here
The OSGi SolutionOverview A Layer … A deployment infrastructure Bundles = class + metadata (import/exports) Bundles have a lifecycle Bundles have their own Class loader Class loading delegation between dependant bundles  A service platform Defines  a Service Registry Bundles provide or request services The service can “come and go”
Architecture
Architecture  Execution Environment The Runtime where the bundles live A bundle can bound to an Execution Environment JRE-1.5 J JRE-1.3 OSGi/Minimum-1.0
Architecture  Module Layer Bundles import, export or have private packages Each package can be assigned version range A bundle (fragment)can be attached to a bundle (host) Export Package javax.transaction 1.01B Import Package javax.transaction [1.0,1.1) Export Package javax.transaction 1.1 Bundle Name: JMS API Import Package: javax.transaction Export Package: javax.jms Bundle-RequiredExecutionEnvironment: J2SE-1.5
Architecture  Module Layera MANIFEST.MF example Manifest-Version:1.0 Import-Package: javax.transaction;version="1.1”, javax.transaction.xa;version="1.1” Export-Package: javax.jms;version="1.1” Bundle-SymbolicName:org.apache.geronimo.specs.geronimo-jms_1.1_spec Tool:Bnd-0.0.227
Installed Starting Architecture  Lifecycle Layer start update  refresh resolve Started Resolved uninstall uninstall stop Stopped Uninstalled
Architecture  Service Layer Each bundle can register or lookup a Service Each service corresponds to one or more interfaces Each service can be assigned and queried using properties Service Registry register lookup ServiceProvider Service Consumer
OSGi Tools		working with services Managing Services programmatically Using the OSGi blueprint Spring Dynamic Modules Apache Aries Felix i-Pojo
OSGi Tools		creating bundles Manually providing the MANIFEST.MF Bnd command line tool Maven Bundle Plug-in Spring’s Bundlor Maven plug-in flavor Command line flavor
OSGi Tools		OSGi Bundle Repository Simplifies the provisioning of bundles The “apt-get install” for the OSGi Integrates with public repositories Eclipse Orbit Spring’s Enterprise Bundle Repository
OSGiEnd of Part I Questions & Answers
Part II Getting started with Apache Karaf
Apache Karafagenda Overview	 Shell Console Deployer Features Concept Security Logging Service Demo Questions and Answers
Apache KarafOverview Born as Service Mix Kernel project Grown inside Apache Felix project Become a Top Level Apache project last year
Apache KarafShell Console Extensible	 Auto complete & coloring support Rich command set, covers most OSGi concepts/services Special commands for the development phase
Apache KarafDeployer File Scanner War Transformer Configuration Bundles Transformation Spring Transformer Blueprint Transformer Configuration Admin URL Handler Maven Handler HTTP Handler Hot deployment Large number of supported artifacts Large number of installation mediums OBR Handler
Apache KarafFeatures Concept A Karaf feature is a descriptor which defines… A set of bundles A set of configurations A set of other features Allows provisioning of applications Maven integration OBR integration
Apache KarafFeatures Example <feature name="http" version=”2.2.0” resolver=“(obr)”> <configname="org.ops4j.pax.web”>            org.osgi.service.http.port=8181  </config> <feature version="[7.0,8.0)">jetty</feature>      <bundle dependency=“true”>mvn:javax.servlet/servlet-api</bundle>      <bundle>mvn:org.ops4j.pax.web/pax-web-api</bundle> </feature>
Apache KarafSecurity JAAS based security Multiple login module implementations Property Login Module JDBC Login Module LDAP Login Module Command line support Provisioning of any JASS realm  Add users roles etc
Apache KarafLogging Service Centralized Logging configuration Supports most logging APIs Log4J Slf4j  Commons Logging Command line support clear, display, tail change threshold etc. OSGi integration per bundle appender, osgi specific attributes
Apache Karaf	End of Part II Questions & Answers
Thank you

More Related Content

What's hot

Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New Evolution
Allan Huang
 

What's hot (20)

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
 
ApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache KarafApacheCon EU 2014: Enterprise Development with Apache Karaf
ApacheCon EU 2014: Enterprise Development with Apache Karaf
 
OSGi Presentation
OSGi PresentationOSGi Presentation
OSGi Presentation
 
W-JAX 2011: OSGi with Apache Karaf
W-JAX 2011: OSGi with Apache KarafW-JAX 2011: OSGi with Apache Karaf
W-JAX 2011: OSGi with Apache Karaf
 
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
 
Jug Poitou Charentes - Apache, OSGi and Karaf
Jug Poitou Charentes -  Apache, OSGi and KarafJug Poitou Charentes -  Apache, OSGi and Karaf
Jug Poitou Charentes - Apache, OSGi and Karaf
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
Microservices OSGi-running-with-apache-karaf
Microservices OSGi-running-with-apache-karafMicroservices OSGi-running-with-apache-karaf
Microservices OSGi-running-with-apache-karaf
 
Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)
 
JBoss Fuse - Fuse workshop EAP container
JBoss Fuse - Fuse workshop EAP containerJBoss Fuse - Fuse workshop EAP container
JBoss Fuse - Fuse workshop EAP container
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGi
 
Deploying FuseMQ with Fuse Fabric
Deploying FuseMQ with Fuse FabricDeploying FuseMQ with Fuse Fabric
Deploying FuseMQ with Fuse Fabric
 
Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
 
JBoss Fuse Workshop 101 part 5
JBoss Fuse Workshop 101 part 5JBoss Fuse Workshop 101 part 5
JBoss Fuse Workshop 101 part 5
 
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,...
 
OSGi Blueprint Services
OSGi Blueprint ServicesOSGi Blueprint Services
OSGi Blueprint Services
 
Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New Evolution
 
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
 
What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)
 
Intro to OSGi
Intro to OSGiIntro to OSGi
Intro to OSGi
 

Viewers also liked

Apache Aries: A blueprint for developing with OSGi and JEE
Apache Aries: A blueprint for developing with OSGi and JEEApache Aries: A blueprint for developing with OSGi and JEE
Apache Aries: A blueprint for developing with OSGi and JEE
mahrwald
 

Viewers also liked (15)

Java class loader
Java class loaderJava class loader
Java class loader
 
Apache Aries: A blueprint for developing with OSGi and JEE
Apache Aries: A blueprint for developing with OSGi and JEEApache Aries: A blueprint for developing with OSGi and JEE
Apache Aries: A blueprint for developing with OSGi and JEE
 
Enterprise Integration Patterns Revisited (EIP, Apache Camel, Talend ESB)
Enterprise Integration Patterns Revisited (EIP, Apache Camel, Talend ESB)Enterprise Integration Patterns Revisited (EIP, Apache Camel, Talend ESB)
Enterprise Integration Patterns Revisited (EIP, Apache Camel, Talend ESB)
 
Why OSGi?
Why OSGi?Why OSGi?
Why OSGi?
 
A Secure Model of IoT Using Blockchain
A Secure Model of IoT Using BlockchainA Secure Model of IoT Using Blockchain
A Secure Model of IoT Using Blockchain
 
Top 12 Eventbrite add ons for Music and Festival Promoters
Top 12 Eventbrite add ons for Music and Festival PromotersTop 12 Eventbrite add ons for Music and Festival Promoters
Top 12 Eventbrite add ons for Music and Festival Promoters
 
Internet of Things (IoT) Past, Present, and Future
Internet of Things (IoT) Past, Present, and FutureInternet of Things (IoT) Past, Present, and Future
Internet of Things (IoT) Past, Present, and Future
 
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
 
2017 Silicon Valley Investment Trends by Edith Yeung
2017 Silicon Valley Investment Trends by Edith Yeung 2017 Silicon Valley Investment Trends by Edith Yeung
2017 Silicon Valley Investment Trends by Edith Yeung
 
Vital Trends in Digital Experience and Transformation in 2016 | Dreamforce 20...
Vital Trends in Digital Experience and Transformation in 2016 | Dreamforce 20...Vital Trends in Digital Experience and Transformation in 2016 | Dreamforce 20...
Vital Trends in Digital Experience and Transformation in 2016 | Dreamforce 20...
 
Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGi
 
The Australian Startup Stack
The Australian Startup StackThe Australian Startup Stack
The Australian Startup Stack
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
 
Next Generation Digital Enterprise (Workplace) Technology | Enterprise Digita...
Next Generation Digital Enterprise (Workplace) Technology | Enterprise Digita...Next Generation Digital Enterprise (Workplace) Technology | Enterprise Digita...
Next Generation Digital Enterprise (Workplace) Technology | Enterprise Digita...
 
Optimizing the Data Tier for Serverless Web Applications - March 2017 Online ...
Optimizing the Data Tier for Serverless Web Applications - March 2017 Online ...Optimizing the Data Tier for Serverless Web Applications - March 2017 Online ...
Optimizing the Data Tier for Serverless Web Applications - March 2017 Online ...
 

Similar to Introduction to-osgi

Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi Webinar
WSO2
 
Using OSGi technology in Eclipse - BJ Hargrave, IBM, for Jeff McAffer, IBM
Using OSGi technology in Eclipse - BJ Hargrave, IBM, for Jeff McAffer, IBMUsing OSGi technology in Eclipse - BJ Hargrave, IBM, for Jeff McAffer, IBM
Using OSGi technology in Eclipse - BJ Hargrave, IBM, for Jeff McAffer, IBM
mfrancis
 
Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016
Manuel Fomitescu
 
Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1
Rhinofly
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBay
Tony Ng
 

Similar to Introduction to-osgi (20)

Os Mcmahan
Os McmahanOs Mcmahan
Os Mcmahan
 
Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi Webinar
 
IJTC ServiceMix 4
IJTC   ServiceMix 4IJTC   ServiceMix 4
IJTC ServiceMix 4
 
Using OSGi technology in Eclipse - BJ Hargrave, IBM, for Jeff McAffer, IBM
Using OSGi technology in Eclipse - BJ Hargrave, IBM, for Jeff McAffer, IBMUsing OSGi technology in Eclipse - BJ Hargrave, IBM, for Jeff McAffer, IBM
Using OSGi technology in Eclipse - BJ Hargrave, IBM, for Jeff McAffer, IBM
 
Java platform
Java platformJava platform
Java platform
 
Java Programming - 01 intro to java
Java Programming - 01 intro to javaJava Programming - 01 intro to java
Java Programming - 01 intro to java
 
Brane.Storm
Brane.StormBrane.Storm
Brane.Storm
 
Part 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures EvolutionsPart 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
 
Fuse technology-2015
Fuse technology-2015Fuse technology-2015
Fuse technology-2015
 
Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016
 
Railo Presentation Railo 3.1
Railo Presentation Railo 3.1Railo Presentation Railo 3.1
Railo Presentation Railo 3.1
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBay
 
Intro to Alfresco for Developers
Intro to Alfresco for DevelopersIntro to Alfresco for Developers
Intro to Alfresco for Developers
 
Eclipse Concierge - an OSGi R5 framework for IoT applications
Eclipse Concierge - an OSGi R5 framework for IoT applicationsEclipse Concierge - an OSGi R5 framework for IoT applications
Eclipse Concierge - an OSGi R5 framework for IoT applications
 
Eclipse Overview
Eclipse Overview Eclipse Overview
Eclipse Overview
 
Cloud infrastructure as code
Cloud infrastructure as codeCloud infrastructure as code
Cloud infrastructure as code
 
Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
 
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
 
Servicemix4.5.0
Servicemix4.5.0Servicemix4.5.0
Servicemix4.5.0
 
WebLogic Developer Experience and Java EE 6
WebLogic Developer Experience and Java EE 6WebLogic Developer Experience and Java EE 6
WebLogic Developer Experience and Java EE 6
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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...
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Introduction to-osgi

  • 1. Introduction to OSGi using Apache Karaf Ioannis Canellos JHUG / 16 April 2011
  • 2. Presenting today… OSGi Open Services Gateway initiative, since 1999 Initially targeted embedded devices OSGi containers: Felix, Equinox, Knoperfish, Concierge Most known use is Eclipse IDE Apache Karaf Apache OSGi runtime runs on any OSGi container Born inside Service Mix, now is Top level project Standard runtime for Geronimo, Service Mix, Sling Ecosystem for deploying OSGi/EE applications
  • 4. Introduction to OSGi Problem Solution Architecture Tools OSGi in the Enterprise Questions & Answers
  • 5. The problemaspects Dependency management Version Hell Conflicting dependencies Class loading issues Dynamic behavior Difficulties to control component lifecycle Lack of a pure modularity solution
  • 6. The problemsDependency management Large number of transitive dependencies Conflicts among among dependencies Class loading issues Boot class loader JTA System class loader JTA war war
  • 7. The problemsDynamic Behavior Components & Services need come and go Components need to get updated / replaced Components need to started / stopped Real life examples Eclipse IDE Adding/Removing “plugins” Ebay Multiple version of the same component
  • 8. The problemsModularity The JVM does not address need for modularity The class path paradox The jar is a “black box” No dependencies & No version The pastitsioexample The “WORA” promise was repeatedly failed JavaBeans EJBs Has the quest for modularity failed ? Project Jigsaw will be shipped with JDK 8 OSGi is already here
  • 9. The OSGi SolutionOverview A Layer … A deployment infrastructure Bundles = class + metadata (import/exports) Bundles have a lifecycle Bundles have their own Class loader Class loading delegation between dependant bundles A service platform Defines a Service Registry Bundles provide or request services The service can “come and go”
  • 11. Architecture Execution Environment The Runtime where the bundles live A bundle can bound to an Execution Environment JRE-1.5 J JRE-1.3 OSGi/Minimum-1.0
  • 12. Architecture Module Layer Bundles import, export or have private packages Each package can be assigned version range A bundle (fragment)can be attached to a bundle (host) Export Package javax.transaction 1.01B Import Package javax.transaction [1.0,1.1) Export Package javax.transaction 1.1 Bundle Name: JMS API Import Package: javax.transaction Export Package: javax.jms Bundle-RequiredExecutionEnvironment: J2SE-1.5
  • 13. Architecture Module Layera MANIFEST.MF example Manifest-Version:1.0 Import-Package: javax.transaction;version="1.1”, javax.transaction.xa;version="1.1” Export-Package: javax.jms;version="1.1” Bundle-SymbolicName:org.apache.geronimo.specs.geronimo-jms_1.1_spec Tool:Bnd-0.0.227
  • 14. Installed Starting Architecture Lifecycle Layer start update refresh resolve Started Resolved uninstall uninstall stop Stopped Uninstalled
  • 15. Architecture Service Layer Each bundle can register or lookup a Service Each service corresponds to one or more interfaces Each service can be assigned and queried using properties Service Registry register lookup ServiceProvider Service Consumer
  • 16. OSGi Tools working with services Managing Services programmatically Using the OSGi blueprint Spring Dynamic Modules Apache Aries Felix i-Pojo
  • 17. OSGi Tools creating bundles Manually providing the MANIFEST.MF Bnd command line tool Maven Bundle Plug-in Spring’s Bundlor Maven plug-in flavor Command line flavor
  • 18. OSGi Tools OSGi Bundle Repository Simplifies the provisioning of bundles The “apt-get install” for the OSGi Integrates with public repositories Eclipse Orbit Spring’s Enterprise Bundle Repository
  • 19. OSGiEnd of Part I Questions & Answers
  • 20. Part II Getting started with Apache Karaf
  • 21. Apache Karafagenda Overview Shell Console Deployer Features Concept Security Logging Service Demo Questions and Answers
  • 22. Apache KarafOverview Born as Service Mix Kernel project Grown inside Apache Felix project Become a Top Level Apache project last year
  • 23. Apache KarafShell Console Extensible Auto complete & coloring support Rich command set, covers most OSGi concepts/services Special commands for the development phase
  • 24. Apache KarafDeployer File Scanner War Transformer Configuration Bundles Transformation Spring Transformer Blueprint Transformer Configuration Admin URL Handler Maven Handler HTTP Handler Hot deployment Large number of supported artifacts Large number of installation mediums OBR Handler
  • 25. Apache KarafFeatures Concept A Karaf feature is a descriptor which defines… A set of bundles A set of configurations A set of other features Allows provisioning of applications Maven integration OBR integration
  • 26. Apache KarafFeatures Example <feature name="http" version=”2.2.0” resolver=“(obr)”> <configname="org.ops4j.pax.web”> org.osgi.service.http.port=8181 </config> <feature version="[7.0,8.0)">jetty</feature> <bundle dependency=“true”>mvn:javax.servlet/servlet-api</bundle> <bundle>mvn:org.ops4j.pax.web/pax-web-api</bundle> </feature>
  • 27. Apache KarafSecurity JAAS based security Multiple login module implementations Property Login Module JDBC Login Module LDAP Login Module Command line support Provisioning of any JASS realm Add users roles etc
  • 28. Apache KarafLogging Service Centralized Logging configuration Supports most logging APIs Log4J Slf4j Commons Logging Command line support clear, display, tail change threshold etc. OSGi integration per bundle appender, osgi specific attributes
  • 29. Apache Karaf End of Part II Questions & Answers