SlideShare une entreprise Scribd logo
1  sur  7
Serge
Huber,
Jahia
CTO
shuber@jahia.com

OSGi in 5 minutes
Why ?
• Most
mature
Java
“plug‐in”
technology
• Allows
hot
deployment/un‐deployment
• Manages
dependencies
between
plug‐ins
(aka

  OSGi
bundles)
• Offers
(opKonal)
addiKonal
services
(HTTP,

  configuraKon,
etc...)
What is an OSGi Bundle ?
                                                   JAR

• Basically
a
JAR
with:
                              MANIFEST.MF
  –AddiKonal
stuff
in
it’s
   Bundle-Name: Hello World


   manifest
file
                             Bundle-SymbolicName: org.example.helloworld
                             Bundle-Description: A Hello World bundle
                             Bundle-ManifestVersion: 2
                             Bundle-Version: 1.0.0

  –A
class
called
an
        Bundle-Activator: org.example.Activator
                             Export-Package:
                             org.example.helloworld;version="1.0.0"

   acKvator
to
register
     Import-Package: org.osgi.framework;version="1.3.0"



   services                  Classes
  –Your
code
and
resources   org.example.AcKvator
                             ...
  –(OpKonally)Other
JARs

   for
legacy
(migraKon)
    (OpKonal)
JARs
                             legacy‐1.0.jar
   purposes                  ...
OSGi Services
              Services
are
all
implemented
using
one
or
more
OSGi
bundles


Logging                      Component
RunKme              Wire
Admin


ConfiguraKon
Admin            Deployment
Admin              XML
Parser


Device
Access                Event
Admin                   Measurement
and
State


User
Admin                   ApplicaKon
Admin              My
Service
1


IO
Connector                 HTTP
Service                  My
Service
2


Preferences                  UPnP
Device
Service
Bundle Activator
• Simply
iniKalizes

  and
shuts
down
the
   package org.example;



  bundle
(if
needed)
                        import org.osgi.framework.BundleActivator;
                        import org.osgi.framework.BundleContext;

                        public class Activator implements BundleActivator {


• Can
register
with

                                private BundleContext context;

                                public void start(BundleContext context) throws Exception {
                                        System.out.println("Starting: Hello World");

  exisKng
services              }
                                        this.context = context;


                                public void stop(BundleContext context) throws Exception {

• Helper
classes
are
           }
                                        System.out.println("Stopping: Goodbye Cruel World");
                                        this.context = null;



  available
to
make

                        }




  things
easier
OSGi and Maven
• Very
good
match
as
both
know
about

  dependencies
• Maven
project
==
OSGi
bundle
• Maven
Felix
Plugin
does
the
packaging
for
you
!
             <plugin>
               <groupId>org.apache.felix</groupId>
               <artifactId>maven-bundle-plugin</artifactId>
               <extensions>true</extensions>
               <configuration>
                 <instructions>
                   <Export-Package>org.osgi.service.log</Export-Package>
                   <Private-Package>org.apache.felix.log.impl</Private-Package>
                   <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                   <Bundle-Activator>${pom.artifactId}.impl.Activator</Bundle-Activator>
                   <Export-
       Service>org.osgi.service.log.LogService,org.osgi.service.log.LogReaderService</
       Export-Service>
                 </instructions>
               </configuration>
             </plugin>
Learn more...
• OSGi
implementaKons
 –Eclipse
Equinox
:
hfp://eclipse.org/equinox/
(most

  mature,
was
born
out
of
Eclipse,
integrated
in

  Websphere
and
Eclipse)
 –Apache
Felix
:
hfp://felix.apache.org
(best
integraKon

  with
Maven,
evolving
rapidly,
used
in
Apache
Sling
and

  other
Apache
projects


Contenu connexe

Tendances

Modular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafModular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafIoan Eugen Stan
 
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 JEEmahrwald
 
Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGiDavid Bosschaert
 
OSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishOSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishSanjeeb Sahoo
 
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 worldsArun Gupta
 
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 GlassFishArun Gupta
 
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
 
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.
 
GlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixGlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixLudovic Champenois
 
Managing Change
Managing ChangeManaging Change
Managing ChangeMirko Jahn
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with GradleWei Chen
 
Embrace Change - Embrace OSGi
Embrace Change - Embrace OSGiEmbrace Change - Embrace OSGi
Embrace Change - Embrace OSGiCarsten Ziegeler
 
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)David Bosschaert
 
Make JSF more type-safe with CDI and MyFaces CODI
Make JSF more type-safe with CDI and MyFaces CODIMake JSF more type-safe with CDI and MyFaces CODI
Make JSF more type-safe with CDI and MyFaces CODIos890
 
Apache DeltaSpike
Apache DeltaSpikeApache DeltaSpike
Apache DeltaSpikeos890
 
OpenWebBeans and DeltaSpike at ApacheCon
OpenWebBeans and DeltaSpike at ApacheConOpenWebBeans and DeltaSpike at ApacheCon
OpenWebBeans and DeltaSpike at ApacheConos890
 

Tendances (20)

Modular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafModular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache Karaf
 
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
 
Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012
 
Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGi
 
OSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishOSGi & Java EE in GlassFish
OSGi & Java EE in GlassFish
 
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
 
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
 
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)
 
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
 
GlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixGlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox Felix
 
Managing Change
Managing ChangeManaging Change
Managing Change
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
 
GlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium ParisGlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium Paris
 
Embrace Change - Embrace OSGi
Embrace Change - Embrace OSGiEmbrace Change - Embrace OSGi
Embrace Change - Embrace OSGi
 
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)
 
Make JSF more type-safe with CDI and MyFaces CODI
Make JSF more type-safe with CDI and MyFaces CODIMake JSF more type-safe with CDI and MyFaces CODI
Make JSF more type-safe with CDI and MyFaces CODI
 
Apache DeltaSpike
Apache DeltaSpikeApache DeltaSpike
Apache DeltaSpike
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
 
OpenWebBeans and DeltaSpike at ApacheCon
OpenWebBeans and DeltaSpike at ApacheConOpenWebBeans and DeltaSpike at ApacheCon
OpenWebBeans and DeltaSpike at ApacheCon
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 

En vedette

Introducing the Jahia Log Analyzer
Introducing the Jahia Log AnalyzerIntroducing the Jahia Log Analyzer
Introducing the Jahia Log AnalyzerSerge Huber
 
Jahia DX 7.2 : Bye bye felix, hello karaf
Jahia DX 7.2 : Bye bye felix, hello karafJahia DX 7.2 : Bye bye felix, hello karaf
Jahia DX 7.2 : Bye bye felix, hello karafSerge Huber
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL IntroductionSerge Huber
 
The Zero Bullshit Architecture
The Zero Bullshit ArchitectureThe Zero Bullshit Architecture
The Zero Bullshit ArchitectureLars Trieloff
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 

En vedette (8)

Introducing the Jahia Log Analyzer
Introducing the Jahia Log AnalyzerIntroducing the Jahia Log Analyzer
Introducing the Jahia Log Analyzer
 
Java modularity: life after Java 9
Java modularity: life after Java 9Java modularity: life after Java 9
Java modularity: life after Java 9
 
Jahia DX 7.2 : Bye bye felix, hello karaf
Jahia DX 7.2 : Bye bye felix, hello karafJahia DX 7.2 : Bye bye felix, hello karaf
Jahia DX 7.2 : Bye bye felix, hello karaf
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL Introduction
 
Java 9 and Project Jigsaw
Java 9 and Project JigsawJava 9 and Project Jigsaw
Java 9 and Project Jigsaw
 
The Zero Bullshit Architecture
The Zero Bullshit ArchitectureThe Zero Bullshit Architecture
The Zero Bullshit Architecture
 
Provisioning the IoT
Provisioning the IoTProvisioning the IoT
Provisioning the IoT
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 

Similaire à OSGi in 5 minutes

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 applicationsjochen.hiller
 
Os gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC teamOs gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC teamThuy_Dang
 
Introduction to OSGGi
Introduction to OSGGiIntroduction to OSGGi
Introduction to OSGGiMarek Koniew
 
Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi WebinarWSO2
 
OSGi Community Event 2010 - Automated Semantic Versioning for OSGi Bundles
OSGi Community Event 2010 - Automated Semantic Versioning for OSGi BundlesOSGi Community Event 2010 - Automated Semantic Versioning for OSGi Bundles
OSGi Community Event 2010 - Automated Semantic Versioning for OSGi Bundlesmfrancis
 
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
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The FactLuciano Resende
 
Cocoon Blocks ApacheCon US 2005
Cocoon Blocks ApacheCon US 2005Cocoon Blocks ApacheCon US 2005
Cocoon Blocks ApacheCon US 2005Daniel Fagerstrom
 
Eclipse_Building_Blocks
Eclipse_Building_BlocksEclipse_Building_Blocks
Eclipse_Building_BlocksRahul Shukla
 
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 2010Arun Gupta
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaSAppsembler
 
OSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyOSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyRaymond Feng
 
Introduction to OSGi (Tokyo JUG)
Introduction to OSGi (Tokyo JUG)Introduction to OSGi (Tokyo JUG)
Introduction to OSGi (Tokyo JUG)njbartlett
 
OSGi Training for Carbon Developers
OSGi Training for Carbon DevelopersOSGi Training for Carbon Developers
OSGi Training for Carbon DevelopersAruna Karunarathna
 
Riga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationRiga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationNicolas Fränkel
 
Brada -semantic-versioning-tool
Brada -semantic-versioning-toolBrada -semantic-versioning-tool
Brada -semantic-versioning-toolPremek Brada
 
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010Atlassian
 

Similaire à OSGi in 5 minutes (20)

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
 
Os gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC teamOs gi introduction made by Ly MInh Phuong-SOC team
Os gi introduction made by Ly MInh Phuong-SOC team
 
Introduction to OSGGi
Introduction to OSGGiIntroduction to OSGGi
Introduction to OSGGi
 
Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi Webinar
 
OSGi bootcamp - part 1
OSGi bootcamp - part 1OSGi bootcamp - part 1
OSGi bootcamp - part 1
 
Osgi
OsgiOsgi
Osgi
 
OSGi Community Event 2010 - Automated Semantic Versioning for OSGi Bundles
OSGi Community Event 2010 - Automated Semantic Versioning for OSGi BundlesOSGi Community Event 2010 - Automated Semantic Versioning for OSGi Bundles
OSGi Community Event 2010 - Automated Semantic Versioning for OSGi Bundles
 
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,...
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The Fact
 
Cocoon Blocks ApacheCon US 2005
Cocoon Blocks ApacheCon US 2005Cocoon Blocks ApacheCon US 2005
Cocoon Blocks ApacheCon US 2005
 
Introduction to-osgi
Introduction to-osgiIntroduction to-osgi
Introduction to-osgi
 
Eclipse_Building_Blocks
Eclipse_Building_BlocksEclipse_Building_Blocks
Eclipse_Building_Blocks
 
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
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaS
 
OSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyOSGi Enablement For Apache Tuscany
OSGi Enablement For Apache Tuscany
 
Introduction to OSGi (Tokyo JUG)
Introduction to OSGi (Tokyo JUG)Introduction to OSGi (Tokyo JUG)
Introduction to OSGi (Tokyo JUG)
 
OSGi Training for Carbon Developers
OSGi Training for Carbon DevelopersOSGi Training for Carbon Developers
OSGi Training for Carbon Developers
 
Riga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous IntegrationRiga Dev Day - Automated Android Continuous Integration
Riga Dev Day - Automated Android Continuous Integration
 
Brada -semantic-versioning-tool
Brada -semantic-versioning-toolBrada -semantic-versioning-tool
Brada -semantic-versioning-tool
 
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
 

Plus de Serge Huber

ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...Serge Huber
 
ApacheCon NA 2019 : Customer segmentation and personalization using apache unomi
ApacheCon NA 2019 : Customer segmentation and personalization using apache unomiApacheCon NA 2019 : Customer segmentation and personalization using apache unomi
ApacheCon NA 2019 : Customer segmentation and personalization using apache unomiSerge Huber
 
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...Serge Huber
 
DEVOXX FR 2016 We're Watching You (Apache Unomi)
DEVOXX FR 2016 We're Watching You (Apache Unomi)DEVOXX FR 2016 We're Watching You (Apache Unomi)
DEVOXX FR 2016 We're Watching You (Apache Unomi)Serge Huber
 
UXDev Summit Keynote : A real world story of Angular and Apache Unomi integra...
UXDev Summit Keynote : A real world story of Angular and Apache Unomi integra...UXDev Summit Keynote : A real world story of Angular and Apache Unomi integra...
UXDev Summit Keynote : A real world story of Angular and Apache Unomi integra...Serge Huber
 
Apache Unomi In Depth - ApacheCon EU 2015 Session
Apache Unomi In Depth - ApacheCon EU 2015 SessionApache Unomi In Depth - ApacheCon EU 2015 Session
Apache Unomi In Depth - ApacheCon EU 2015 SessionSerge Huber
 
Introducing Apache Unomi - JavaOne 2015 Session
Introducing Apache Unomi - JavaOne 2015 SessionIntroducing Apache Unomi - JavaOne 2015 Session
Introducing Apache Unomi - JavaOne 2015 SessionSerge Huber
 
Webinar Présentation jahia en collaboration avec Developpez.com
Webinar Présentation jahia en collaboration avec Developpez.comWebinar Présentation jahia en collaboration avec Developpez.com
Webinar Présentation jahia en collaboration avec Developpez.comSerge Huber
 
Portets to composite applications
Portets to composite applicationsPortets to composite applications
Portets to composite applicationsSerge Huber
 

Plus de Serge Huber (9)

ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
 
ApacheCon NA 2019 : Customer segmentation and personalization using apache unomi
ApacheCon NA 2019 : Customer segmentation and personalization using apache unomiApacheCon NA 2019 : Customer segmentation and personalization using apache unomi
ApacheCon NA 2019 : Customer segmentation and personalization using apache unomi
 
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
ApacheCon NA 2018 : Apache Unomi, an Open Source Customer Data Platformapache...
 
DEVOXX FR 2016 We're Watching You (Apache Unomi)
DEVOXX FR 2016 We're Watching You (Apache Unomi)DEVOXX FR 2016 We're Watching You (Apache Unomi)
DEVOXX FR 2016 We're Watching You (Apache Unomi)
 
UXDev Summit Keynote : A real world story of Angular and Apache Unomi integra...
UXDev Summit Keynote : A real world story of Angular and Apache Unomi integra...UXDev Summit Keynote : A real world story of Angular and Apache Unomi integra...
UXDev Summit Keynote : A real world story of Angular and Apache Unomi integra...
 
Apache Unomi In Depth - ApacheCon EU 2015 Session
Apache Unomi In Depth - ApacheCon EU 2015 SessionApache Unomi In Depth - ApacheCon EU 2015 Session
Apache Unomi In Depth - ApacheCon EU 2015 Session
 
Introducing Apache Unomi - JavaOne 2015 Session
Introducing Apache Unomi - JavaOne 2015 SessionIntroducing Apache Unomi - JavaOne 2015 Session
Introducing Apache Unomi - JavaOne 2015 Session
 
Webinar Présentation jahia en collaboration avec Developpez.com
Webinar Présentation jahia en collaboration avec Developpez.comWebinar Présentation jahia en collaboration avec Developpez.com
Webinar Présentation jahia en collaboration avec Developpez.com
 
Portets to composite applications
Portets to composite applicationsPortets to composite applications
Portets to composite applications
 

Dernier

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
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?Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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 Scriptwesley chun
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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 WorkerThousandEyes
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
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?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

OSGi in 5 minutes

  • 2. Why ? • Most
mature
Java
“plug‐in”
technology • Allows
hot
deployment/un‐deployment • Manages
dependencies
between
plug‐ins
(aka
 OSGi
bundles) • Offers
(opKonal)
addiKonal
services
(HTTP,
 configuraKon,
etc...)
  • 3. What is an OSGi Bundle ? JAR • Basically
a
JAR
with: MANIFEST.MF –AddiKonal
stuff
in
it’s
 Bundle-Name: Hello World manifest
file Bundle-SymbolicName: org.example.helloworld Bundle-Description: A Hello World bundle Bundle-ManifestVersion: 2 Bundle-Version: 1.0.0 –A
class
called
an
 Bundle-Activator: org.example.Activator Export-Package: org.example.helloworld;version="1.0.0" acKvator
to
register
 Import-Package: org.osgi.framework;version="1.3.0" services Classes –Your
code
and
resources org.example.AcKvator ... –(OpKonally)Other
JARs
 for
legacy
(migraKon)
 (OpKonal)
JARs legacy‐1.0.jar purposes ...
  • 4. OSGi Services Services
are
all
implemented
using
one
or
more
OSGi
bundles Logging Component
RunKme Wire
Admin ConfiguraKon
Admin Deployment
Admin XML
Parser Device
Access Event
Admin Measurement
and
State User
Admin ApplicaKon
Admin My
Service
1 IO
Connector HTTP
Service My
Service
2 Preferences UPnP
Device
Service
  • 5. Bundle Activator • Simply
iniKalizes
 and
shuts
down
the
 package org.example; bundle
(if
needed) import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; public class Activator implements BundleActivator { • Can
register
with
 private BundleContext context; public void start(BundleContext context) throws Exception { System.out.println("Starting: Hello World"); exisKng
services } this.context = context; public void stop(BundleContext context) throws Exception { • Helper
classes
are
 } System.out.println("Stopping: Goodbye Cruel World"); this.context = null; available
to
make
 } things
easier
  • 6. OSGi and Maven • Very
good
match
as
both
know
about
 dependencies • Maven
project
==
OSGi
bundle • Maven
Felix
Plugin
does
the
packaging
for
you
! <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Export-Package>org.osgi.service.log</Export-Package> <Private-Package>org.apache.felix.log.impl</Private-Package> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> <Bundle-Activator>${pom.artifactId}.impl.Activator</Bundle-Activator> <Export- Service>org.osgi.service.log.LogService,org.osgi.service.log.LogReaderService</ Export-Service> </instructions> </configuration> </plugin>
  • 7. Learn more... • OSGi
implementaKons –Eclipse
Equinox
:
hfp://eclipse.org/equinox/
(most
 mature,
was
born
out
of
Eclipse,
integrated
in
 Websphere
and
Eclipse) –Apache
Felix
:
hfp://felix.apache.org
(best
integraKon
 with
Maven,
evolving
rapidly,
used
in
Apache
Sling
and
 other
Apache
projects


Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n