SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
OSGi



   Michal Malohlava

  Charles University in Prague
Faculty of Mathematics and Physics
         Czech Republic
Introduction
OSGi overview                              CZJUG, Prague – May 28, 2008




  • Distributed Systems Research Group
               http://dsrg.mff.cuni.cz/
               Formal methods sub-group
               Benchmarking gang
               Components team
  • Components team
          SOFA2 component system
                 • http://sofa.ow2.org/




                                                                          2
Outline
OSGi overview                          CZJUG, Prague – May 28, 2008




  • OSGi platform
          motivation
  • OSGi architecture overview
               Bundles
               Services
               Example
               Technical background
  • OSGi related projects




                                                                      3
OSGi history
OSGi overview                                                CZJUG, Prague – May 28, 2008




  • OSGi alliance
          Open Services Gateway initiative
                • Founded 1999
                • OSGi specification release 1 – 2000
  • OSGi specification target
          Define Java-based service platform, full dynamic
           component model
          Why?
                • JVM does not support natively dynamic module system -
                  starting, stopping, updating application at runtime
                • JAR dependencies management missing
                    No way how to restrict exported packages, enforce imports


                                                                                            4
OSGi motivation
OSGi overview                                                CZJUG, Prague – May 28, 2008




  • OSGi – kind of Java Operating System
  • Configuration of application
          “LEGO” principle :-)
                • Reusability
                • Scalability
                • Portability
                     Abstraction of underlying hardware
                     Standardized execution environment
                • Application isolation/security
                     Well defined classloading
                • Easy managing life-cycle of application
                     Dynamic updates, modification of running modules
          Not-only for enterprise solutions
                • Embedded devices
          Service oriented architecture                                                    5
OSGi current state
OSGi overview                                                CZJUG, Prague – May 28, 2008




  • OSGi specification
          Release 4.1 – May 2007
                • core + compendium (contains mobile spec. from R3)
  • Implementation
          Open source
                • Eclipse Equinox
                     Many extensions of OSGi, e.g. bundles aspects
                • Apache Felix
                     Based on Oscar (implementation of OSGi R3)
                • Knopflerfish
                • Concierge
                     Implementation of OSGi R3, optimized for embedded devices
          Commercial
                • ProSyst, Knopflerfish Pro
                                                                                            6
OSGi architecture
OSGi overview                            CZJUG, Prague – May 28, 2008




  • OSGi framework
               Bundles (modules)
               Execution environment
               Application life cycle
               Services
                 • Service registry
          Security
  • Application share
    the same JVM
          Isolation/security


                                                                        7
Execution environment
OSGi overview                                         CZJUG, Prague – May 28, 2008




  • OSGi platform can run on different target devices
          Profiles in specification
                • OSGi/Minimum-1.1, CDC-1.1/Foundation-1.1
          Other profiles
                • J2SE-1.4, J2SE-1.5
          OSGi APIs only use a subset of J2SE and J2ME
                • Matches most profiles
  • Application can enforce the profile




                                                                                     8
Bundle
OSGi overview                                                         CZJUG, Prague – May 28, 2008




  • Bundle
               Basic deployment entity (~ application, library)
               Versioned (1.0.2.rc3 – major, minor, micro, qualifier)
               Declaratively specified dependencies
               Represented as JAR file of             Manifest-Version:   1.0
                 • Code, Resources                       Bundle-Name: LogTargetBundle
                                                         Bundle-Activator: LogTargetActivator
                 • Extended manifest file                Bundle-SymbolicName: LogTargetBundle
  • Bundle fragments                                     Bundle-Version: 1.0.0
                                                         Import-Package: org.osgi.framework;
          Similar to bundles                              version=”1.3.1”
                 • Allow extending an existing bundle
                       represent e.g. native implementation, require a host bundle
  • Bundle context
               Representation of bundle instance in the framework
               Installation of new bundle, bundle properties
               Access to persistent storage
               Services management, Listeners management                                            9
Bundle life-cycle
OSGi overview       CZJUG, Prague – May 28, 2008




                                                   10
Bundle Activator
OSGi overview                                               CZJUG, Prague – May 28, 2008




  • Class defined in MANIFEST
          Bundle-Activator header
                                             public class SimpleLogTargetActivator {
                • Can be an external class
                                                 @Override
  • Handle bundle start/stop                     public void start(BundleContext context){
                                                   /* ... */
                                                 }
          Start                                 @Override
                • Register services              public void stop(BundleContext context) {
                                                   /* ... */
                • Create service trackers    }
                                                 }

                • Start threads
          Stop
                • Release resources
                     Unregister services
                     Release services


                                                                                             11
Bundle dependencies
OSGi overview                                       CZJUG, Prague – May 28, 2008



                                           Export-Package: cz.*;
  • Expose packages                        exclude=”*Impl”

          List all of packages + versions + attributes
          Fine grained package filtering

  • Import bundle                          Import-Package: cz.mff.*;
                                           version=”[1.0,1.3.1)”
          Require specific version(s)
                • e.g. [1.0, 2.0)

  • Require bundle                       Require-Bundle: logger-api-bundle

          Not recommended because it restricts further changes
           in API

  • Bundle class path                Bundle-Classpath: ., lib/bsh.jar
                                                                                   12
Technical background of classloading
OSGi overview                                                             CZJUG, Prague – May 28, 2008




  • Separated class loaders for each bundle
  • Defined lookup order
               Parent (only for class from java.* package)
               Imported packages
               Required bundles
               Local class path




                                                              Image from the book OSGi in Practice, Neil Barlett
                                                                                                                   13
Service
OSGi overview                                                     CZJUG, Prague – May 28, 2008




  • Bundles – static entities
          Static dependencies through packages
          How to communicate between bundles?
  • Services – dynamics in OSGi
          Can appear, disappear at runtime in according to a condition
          For one service name multiple providers can exist
          Bundles collaboration
            • Well defined communication points
          Services permit bundles to detect environment and adapt their behavior
            • Query language
  • Service
          Object, registered by a bundle
             • BundleContext.registerService(iface, implementation, properties)
             • Service registry
             • Framework automatically unregister all services of stopped bundle
          Service has properties (can be modified)
          Framework manages relation service <-> using bundle                                   14
Registering service (1)
OSGi overview                                                 CZJUG, Prague – May 28, 2008




  • Programatically in BundleActivator
      public void start(BundleContext context) {
        SimpleLogTargetImpl logTargetImpl = new SimpleLogTargetImpl();

          registration = context.registerService(
                               ILogTarget.class.getName(),
                               logTargetImpl,
                               null);
      }



  • Problems
           Code
                • Semantics is not clear
                     dependencies, properties, implementation v. provided interface
                • Simplicity
                                                                                             15
Registering service (2)
OSGi overview                                                   CZJUG, Prague – May 28, 2008



  • Declaratively
          Automated service management by framework
                • Declarative service
                • Dependency injection of required services
          Services provided by components
                • Component
                    Entity providing/requiring exactly specified interfaces
                    Optional, mandatory, collection interface
 <component name=quot;logger-componentquot;>
         <implementation class=quot;cz.cuni...LoggerImplquot;/>
         <service>
                 <provide interface=quot;cz...ILoggerquot;/>
         </service>
         <reference name=quot;TARGETquot;
                 interface=quot;cz...ILogTargetquot;
                 bind=quot;addLogTargetquot;
                 unbind=quot;removeLogTargetquot;
                 cardinality=quot;0..nquot;
                 policy=quot;dynamicquot;/>
 </component>
                                                                                               16
Service consuming
OSGi overview                                                  CZJUG, Prague – May 28, 2008




  • Bundle can search for service which implements
    specific interface (defines semantics of the
    service)                 Service reference ref =
                                       context.getServiceRef(“cz.bar”);

  • Several bad solution     if (ref!=null) {
                               Bar bar = (Bar) context.getService(ref);
                               if (bar != null) {
          context.getService(...)             ...
                                               context.ungetService(ref)
                • Nasty code             }
                                              }


          Listeners
                • Just inform about changes
  • Components                                    <component name=”getServiceComp”>
                                                   <implementation class=”GetLoggerService”>
                                                   <reference name=”log”
          Declare getter component                  interface=”org.osgi...LogService”
                                                     bind=”setLog”
  • Service tracker                                  unbind=”unsetLog”
                                                  </component>



                                                                                               17
Service tracker
OSGi overview                                            CZJUG, Prague – May 28, 2008




  • Tracking for service
          Filters (name, id, property, owning bundle, ...)
                • LDAP syntax (e.g. (&(objectName=”foo”)(property1=”Xyz”)) )
          Adding service to registry, removing, update

    //In Bundle Activator - start                            Name of service to track
    tracker = new ServiceTracker(context,
      ILogger.class.getName(),
      null);

    tracker.open();                                          ServiceTrackerCustomizer
                                                              - customize behavior of adding,
    // get the service(s)                                    removing, modifying the service
    ILogger log = (ILogger)tracker.getService();
    Ilogger log = (Ilogger)
    tracker.waitForService(1000);

    // stop tracking
    tracker.close();
                                                                                                18
Whiteboard pattern
OSGi overview                                                CZJUG, Prague – May 28, 2008




  • Services dependencies
          Content provider v. content consumers
                • e.g. Register new service if and only if the specified service
                  appears
          “Don't look for content providers, let them to register as
           services and track for the services”
          ServiceTracker capture service life-cycle
                • via ServiceTrackerCustomizer
                     Capture process of adding/removing/modifying service




                                                                                            19
Example
OSGi overview   CZJUG, Prague – May 28, 2008




                                               20
Services
OSGi overview                                    CZJUG, Prague – May 28, 2008




  • Http
          Exposing registered servlets
  • Event
          Messaging Producer <-> Consumer
  • Device manager
  • Diagnostics/Monitoring
          JMX (in Equinox sandbox)
  • Application manager
          Application package – set of resource (bundles, data,...)
                • Can be deployed/install
  • Location/measurement services
                                                                                21
Security layer
OSGi overview                                              CZJUG, Prague – May 28, 2008




  • Optional
  • Based on Java 2 security architecture
  • 4 roles
      Developer
                • Adds local permissions to the bundle by signing
                     Admin, Service, Bundle permissions
          Deployer
                • Signs the bundle and deploys it
                • Resulting bundle permissions = intersection of bundle and
                  target environment permissions
          Operator
                • Full control all the time
          End user

                                                                                          22
Issues of OSGi R4
OSGi overview                                        CZJUG, Prague – May 28, 2008




  • No repository defined
          No single trusted point for downloading bundles
            • Each implementation has its own OBR (OSGi bundle
              repo.)
          No automatic download of required bundles/packages
          Currently just RFC-112
            • Searching by capabilities
          Planned in OSGi R5
  • Bundle dependency resolver
          Resolving bundles can take long time
          Maximal sharing of packages
  • Stale service problem
          Services can exchange objects connected to a bundle classloader.
           What happens when this bundle is stopped?                                23
Related projects
OSGi overview                                         CZJUG, Prague – May 28, 2008




  •    rOSGi
         Access services in a remote OSGi
  •    Glassfish v3
         OSGi replace HK2 (module subsystem)
         Uses Apache Felix
  •    SpringDM (Spring-OSGi)
         Integration of OSGi inside Spring
  •    Spring application platform
         Similar concept to OSGi, cooperates with it, reuses bundles
         Defines bundles repository
  •    JSR 277
         Java Modules, proposed OSGi interoperability



                                                                                     24
Q&A
OSGi overview                CZJUG, Prague – May 28, 2008




                Thank you!




                                                            25

Contenu connexe

Tendances

Spring boot Under Da Hood
Spring boot Under Da HoodSpring boot Under Da Hood
Spring boot Under Da HoodMichel Schudel
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerizationBalint Pato
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container SecuritySuraj Khetani
 
DDD 구현기초 (거의 Final 버전)
DDD 구현기초 (거의 Final 버전)DDD 구현기초 (거의 Final 버전)
DDD 구현기초 (거의 Final 버전)beom kyun choi
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introductionrajdeep
 
Distributed Locking in Kubernetes
Distributed Locking in KubernetesDistributed Locking in Kubernetes
Distributed Locking in KubernetesRafał Leszko
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a DockerfileKnoldus Inc.
 
Docker Advanced registry usage
Docker Advanced registry usageDocker Advanced registry usage
Docker Advanced registry usageDocker, Inc.
 
HTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versionsHTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versionsneexemil
 
Java spring framework
Java spring frameworkJava spring framework
Java spring frameworkRajiv Gupta
 
(Fios#03) 4. 파워셸 포렌식 조사 기법
(Fios#03) 4. 파워셸 포렌식 조사 기법(Fios#03) 4. 파워셸 포렌식 조사 기법
(Fios#03) 4. 파워셸 포렌식 조사 기법INSIGHT FORENSIC
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache MavenRajind Ruparathna
 
Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1Imesh Gunaratne
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionRobert Reiz
 

Tendances (20)

Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Docker
DockerDocker
Docker
 
Spring boot Under Da Hood
Spring boot Under Da HoodSpring boot Under Da Hood
Spring boot Under Da Hood
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container Security
 
DDD 구현기초 (거의 Final 버전)
DDD 구현기초 (거의 Final 버전)DDD 구현기초 (거의 Final 버전)
DDD 구현기초 (거의 Final 버전)
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
Distributed Locking in Kubernetes
Distributed Locking in KubernetesDistributed Locking in Kubernetes
Distributed Locking in Kubernetes
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a Dockerfile
 
Docker Advanced registry usage
Docker Advanced registry usageDocker Advanced registry usage
Docker Advanced registry usage
 
HTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versionsHTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versions
 
Java spring framework
Java spring frameworkJava spring framework
Java spring framework
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
Docker on Docker
Docker on DockerDocker on Docker
Docker on Docker
 
(Fios#03) 4. 파워셸 포렌식 조사 기법
(Fios#03) 4. 파워셸 포렌식 조사 기법(Fios#03) 4. 파워셸 포렌식 조사 기법
(Fios#03) 4. 파워셸 포렌식 조사 기법
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache Maven
 
Docker internals
Docker internalsDocker internals
Docker internals
 
Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 

En vedette

Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in PractiseDavid Bosschaert
 
Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGiCarsten Ziegeler
 
OSGI(Open Service Gateway initiative)
OSGI(Open Service Gateway initiative)OSGI(Open Service Gateway initiative)
OSGI(Open Service Gateway initiative)ymtech
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesikmfrancis
 
OSGi Alliance Community Event 2007 - Business Session#2 - Abdallah Bushnaq, A...
OSGi Alliance Community Event 2007 - Business Session#2 - Abdallah Bushnaq, A...OSGi Alliance Community Event 2007 - Business Session#2 - Abdallah Bushnaq, A...
OSGi Alliance Community Event 2007 - Business Session#2 - Abdallah Bushnaq, A...mfrancis
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Martin Toshev
 
OSGi Forward Path – Summary - Dr. John Barr, President of OSGi Alliance
OSGi Forward Path – Summary - Dr. John Barr, President of OSGi AllianceOSGi Forward Path – Summary - Dr. John Barr, President of OSGi Alliance
OSGi Forward Path – Summary - Dr. John Barr, President of OSGi Alliancemfrancis
 
Apache, osgi and karaf par Guillaume Nodet
Apache, osgi and karaf par Guillaume NodetApache, osgi and karaf par Guillaume Nodet
Apache, osgi and karaf par Guillaume NodetNormandy JUG
 
Os gi 기술교육
Os gi 기술교육Os gi 기술교육
Os gi 기술교육ymtech
 
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
 
OSGi Technology Value Proposition - December 2013
OSGi Technology Value Proposition - December 2013OSGi Technology Value Proposition - December 2013
OSGi Technology Value Proposition - December 2013mfrancis
 
개발자 지향 WAS : IBM WebSphere Liberty Server
개발자 지향 WAS : IBM WebSphere Liberty Server개발자 지향 WAS : IBM WebSphere Liberty Server
개발자 지향 WAS : IBM WebSphere Liberty ServerJungWoon Lee
 
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 Schneidermfrancis
 
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 BlockchainAltoros
 

En vedette (20)

Introduction to-osgi
Introduction to-osgiIntroduction to-osgi
Introduction to-osgi
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGi
 
OSGI(Open Service Gateway initiative)
OSGI(Open Service Gateway initiative)OSGI(Open Service Gateway initiative)
OSGI(Open Service Gateway initiative)
 
OSGi
OSGiOSGi
OSGi
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
 
Présentation OSGI
Présentation OSGIPrésentation OSGI
Présentation OSGI
 
OSGi Alliance Community Event 2007 - Business Session#2 - Abdallah Bushnaq, A...
OSGi Alliance Community Event 2007 - Business Session#2 - Abdallah Bushnaq, A...OSGi Alliance Community Event 2007 - Business Session#2 - Abdallah Bushnaq, A...
OSGi Alliance Community Event 2007 - Business Session#2 - Abdallah Bushnaq, A...
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
 
OSGi Forward Path – Summary - Dr. John Barr, President of OSGi Alliance
OSGi Forward Path – Summary - Dr. John Barr, President of OSGi AllianceOSGi Forward Path – Summary - Dr. John Barr, President of OSGi Alliance
OSGi Forward Path – Summary - Dr. John Barr, President of OSGi Alliance
 
Apache, osgi and karaf par Guillaume Nodet
Apache, osgi and karaf par Guillaume NodetApache, osgi and karaf par Guillaume Nodet
Apache, osgi and karaf par Guillaume Nodet
 
Intro To OSGi
Intro To OSGiIntro To OSGi
Intro To OSGi
 
Os gi 기술교육
Os gi 기술교육Os gi 기술교육
Os gi 기술교육
 
OSGi & Blueprint
OSGi & BlueprintOSGi & Blueprint
OSGi & Blueprint
 
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
 
OSGi Technology Value Proposition - December 2013
OSGi Technology Value Proposition - December 2013OSGi Technology Value Proposition - December 2013
OSGi Technology Value Proposition - December 2013
 
개발자 지향 WAS : IBM WebSphere Liberty Server
개발자 지향 WAS : IBM WebSphere Liberty Server개발자 지향 WAS : IBM WebSphere Liberty Server
개발자 지향 WAS : IBM WebSphere Liberty Server
 
Why OSGi?
Why OSGi?Why OSGi?
Why OSGi?
 
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
 
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
 

Similaire à OSGi Presentation

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 & 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
 
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
 
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 GlassFishArun Gupta
 
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010JUG Lausanne
 
Plugins 2.0: The Overview
Plugins 2.0: The OverviewPlugins 2.0: The Overview
Plugins 2.0: The OverviewAtlassian
 
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
 
Gf Overview For Spanish Speakers 16 October2008
Gf Overview For Spanish Speakers 16 October2008Gf Overview For Spanish Speakers 16 October2008
Gf Overview For Spanish Speakers 16 October2008Eduardo Pelegri-Llopart
 
GlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixGlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixLudovic Champenois
 
What's Expected in Java 7
What's Expected in Java 7What's Expected in Java 7
What's Expected in Java 7Gal Marder
 
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 ApplicationArun Gupta
 
Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)Chris Aniszczyk
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaArun Gupta
 
Nuxeo Roadmap 2008/06
Nuxeo Roadmap 2008/06Nuxeo Roadmap 2008/06
Nuxeo Roadmap 2008/06Eric Barroca
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SEdogangoko
 
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 2011Arun Gupta
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009Roland Tritsch
 
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
 

Similaire à OSGi Presentation (20)

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 & 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
 
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
 
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
 
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
 
Plugins 2.0: The Overview
Plugins 2.0: The OverviewPlugins 2.0: The Overview
Plugins 2.0: The Overview
 
GlassFish v3 at JavaZone 09
GlassFish v3 at JavaZone 09GlassFish v3 at JavaZone 09
GlassFish v3 at JavaZone 09
 
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
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
Gf Overview For Spanish Speakers 16 October2008
Gf Overview For Spanish Speakers 16 October2008Gf Overview For Spanish Speakers 16 October2008
Gf Overview For Spanish Speakers 16 October2008
 
GlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixGlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox Felix
 
What's Expected in Java 7
What's Expected in Java 7What's Expected in Java 7
What's Expected in Java 7
 
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
 
Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 India
 
Nuxeo Roadmap 2008/06
Nuxeo Roadmap 2008/06Nuxeo Roadmap 2008/06
Nuxeo Roadmap 2008/06
 
New Features of Java7 SE
New Features of Java7 SENew Features of Java7 SE
New Features of Java7 SE
 
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
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009
 
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,...
 

Dernier

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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 organizationRadu Cotescu
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Dernier (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

OSGi Presentation

  • 1. OSGi Michal Malohlava Charles University in Prague Faculty of Mathematics and Physics Czech Republic
  • 2. Introduction OSGi overview CZJUG, Prague – May 28, 2008 • Distributed Systems Research Group  http://dsrg.mff.cuni.cz/  Formal methods sub-group  Benchmarking gang  Components team • Components team  SOFA2 component system • http://sofa.ow2.org/ 2
  • 3. Outline OSGi overview CZJUG, Prague – May 28, 2008 • OSGi platform  motivation • OSGi architecture overview  Bundles  Services  Example  Technical background • OSGi related projects 3
  • 4. OSGi history OSGi overview CZJUG, Prague – May 28, 2008 • OSGi alliance  Open Services Gateway initiative • Founded 1999 • OSGi specification release 1 – 2000 • OSGi specification target  Define Java-based service platform, full dynamic component model  Why? • JVM does not support natively dynamic module system - starting, stopping, updating application at runtime • JAR dependencies management missing  No way how to restrict exported packages, enforce imports 4
  • 5. OSGi motivation OSGi overview CZJUG, Prague – May 28, 2008 • OSGi – kind of Java Operating System • Configuration of application  “LEGO” principle :-) • Reusability • Scalability • Portability  Abstraction of underlying hardware  Standardized execution environment • Application isolation/security  Well defined classloading • Easy managing life-cycle of application  Dynamic updates, modification of running modules  Not-only for enterprise solutions • Embedded devices  Service oriented architecture 5
  • 6. OSGi current state OSGi overview CZJUG, Prague – May 28, 2008 • OSGi specification  Release 4.1 – May 2007 • core + compendium (contains mobile spec. from R3) • Implementation  Open source • Eclipse Equinox  Many extensions of OSGi, e.g. bundles aspects • Apache Felix  Based on Oscar (implementation of OSGi R3) • Knopflerfish • Concierge  Implementation of OSGi R3, optimized for embedded devices  Commercial • ProSyst, Knopflerfish Pro 6
  • 7. OSGi architecture OSGi overview CZJUG, Prague – May 28, 2008 • OSGi framework  Bundles (modules)  Execution environment  Application life cycle  Services • Service registry  Security • Application share the same JVM  Isolation/security 7
  • 8. Execution environment OSGi overview CZJUG, Prague – May 28, 2008 • OSGi platform can run on different target devices  Profiles in specification • OSGi/Minimum-1.1, CDC-1.1/Foundation-1.1  Other profiles • J2SE-1.4, J2SE-1.5  OSGi APIs only use a subset of J2SE and J2ME • Matches most profiles • Application can enforce the profile 8
  • 9. Bundle OSGi overview CZJUG, Prague – May 28, 2008 • Bundle  Basic deployment entity (~ application, library)  Versioned (1.0.2.rc3 – major, minor, micro, qualifier)  Declaratively specified dependencies  Represented as JAR file of Manifest-Version: 1.0 • Code, Resources Bundle-Name: LogTargetBundle Bundle-Activator: LogTargetActivator • Extended manifest file Bundle-SymbolicName: LogTargetBundle • Bundle fragments Bundle-Version: 1.0.0 Import-Package: org.osgi.framework;  Similar to bundles version=”1.3.1” • Allow extending an existing bundle  represent e.g. native implementation, require a host bundle • Bundle context  Representation of bundle instance in the framework  Installation of new bundle, bundle properties  Access to persistent storage  Services management, Listeners management 9
  • 10. Bundle life-cycle OSGi overview CZJUG, Prague – May 28, 2008 10
  • 11. Bundle Activator OSGi overview CZJUG, Prague – May 28, 2008 • Class defined in MANIFEST  Bundle-Activator header public class SimpleLogTargetActivator { • Can be an external class @Override • Handle bundle start/stop public void start(BundleContext context){ /* ... */ }  Start @Override • Register services public void stop(BundleContext context) { /* ... */ • Create service trackers } } • Start threads  Stop • Release resources  Unregister services  Release services 11
  • 12. Bundle dependencies OSGi overview CZJUG, Prague – May 28, 2008 Export-Package: cz.*; • Expose packages exclude=”*Impl”  List all of packages + versions + attributes  Fine grained package filtering • Import bundle Import-Package: cz.mff.*; version=”[1.0,1.3.1)”  Require specific version(s) • e.g. [1.0, 2.0) • Require bundle Require-Bundle: logger-api-bundle  Not recommended because it restricts further changes in API • Bundle class path Bundle-Classpath: ., lib/bsh.jar 12
  • 13. Technical background of classloading OSGi overview CZJUG, Prague – May 28, 2008 • Separated class loaders for each bundle • Defined lookup order  Parent (only for class from java.* package)  Imported packages  Required bundles  Local class path Image from the book OSGi in Practice, Neil Barlett 13
  • 14. Service OSGi overview CZJUG, Prague – May 28, 2008 • Bundles – static entities  Static dependencies through packages  How to communicate between bundles? • Services – dynamics in OSGi  Can appear, disappear at runtime in according to a condition  For one service name multiple providers can exist  Bundles collaboration • Well defined communication points  Services permit bundles to detect environment and adapt their behavior • Query language • Service  Object, registered by a bundle • BundleContext.registerService(iface, implementation, properties) • Service registry • Framework automatically unregister all services of stopped bundle  Service has properties (can be modified)  Framework manages relation service <-> using bundle 14
  • 15. Registering service (1) OSGi overview CZJUG, Prague – May 28, 2008 • Programatically in BundleActivator public void start(BundleContext context) { SimpleLogTargetImpl logTargetImpl = new SimpleLogTargetImpl(); registration = context.registerService( ILogTarget.class.getName(), logTargetImpl, null); } • Problems  Code • Semantics is not clear  dependencies, properties, implementation v. provided interface • Simplicity 15
  • 16. Registering service (2) OSGi overview CZJUG, Prague – May 28, 2008 • Declaratively  Automated service management by framework • Declarative service • Dependency injection of required services  Services provided by components • Component  Entity providing/requiring exactly specified interfaces  Optional, mandatory, collection interface <component name=quot;logger-componentquot;> <implementation class=quot;cz.cuni...LoggerImplquot;/> <service> <provide interface=quot;cz...ILoggerquot;/> </service> <reference name=quot;TARGETquot; interface=quot;cz...ILogTargetquot; bind=quot;addLogTargetquot; unbind=quot;removeLogTargetquot; cardinality=quot;0..nquot; policy=quot;dynamicquot;/> </component> 16
  • 17. Service consuming OSGi overview CZJUG, Prague – May 28, 2008 • Bundle can search for service which implements specific interface (defines semantics of the service) Service reference ref = context.getServiceRef(“cz.bar”); • Several bad solution if (ref!=null) { Bar bar = (Bar) context.getService(ref); if (bar != null) {  context.getService(...) ... context.ungetService(ref) • Nasty code } }  Listeners • Just inform about changes • Components <component name=”getServiceComp”> <implementation class=”GetLoggerService”> <reference name=”log”  Declare getter component interface=”org.osgi...LogService” bind=”setLog” • Service tracker unbind=”unsetLog” </component> 17
  • 18. Service tracker OSGi overview CZJUG, Prague – May 28, 2008 • Tracking for service  Filters (name, id, property, owning bundle, ...) • LDAP syntax (e.g. (&(objectName=”foo”)(property1=”Xyz”)) )  Adding service to registry, removing, update //In Bundle Activator - start Name of service to track tracker = new ServiceTracker(context, ILogger.class.getName(), null); tracker.open(); ServiceTrackerCustomizer - customize behavior of adding, // get the service(s) removing, modifying the service ILogger log = (ILogger)tracker.getService(); Ilogger log = (Ilogger) tracker.waitForService(1000); // stop tracking tracker.close(); 18
  • 19. Whiteboard pattern OSGi overview CZJUG, Prague – May 28, 2008 • Services dependencies  Content provider v. content consumers • e.g. Register new service if and only if the specified service appears  “Don't look for content providers, let them to register as services and track for the services”  ServiceTracker capture service life-cycle • via ServiceTrackerCustomizer  Capture process of adding/removing/modifying service 19
  • 20. Example OSGi overview CZJUG, Prague – May 28, 2008 20
  • 21. Services OSGi overview CZJUG, Prague – May 28, 2008 • Http  Exposing registered servlets • Event  Messaging Producer <-> Consumer • Device manager • Diagnostics/Monitoring  JMX (in Equinox sandbox) • Application manager  Application package – set of resource (bundles, data,...) • Can be deployed/install • Location/measurement services 21
  • 22. Security layer OSGi overview CZJUG, Prague – May 28, 2008 • Optional • Based on Java 2 security architecture • 4 roles  Developer • Adds local permissions to the bundle by signing  Admin, Service, Bundle permissions  Deployer • Signs the bundle and deploys it • Resulting bundle permissions = intersection of bundle and target environment permissions  Operator • Full control all the time  End user 22
  • 23. Issues of OSGi R4 OSGi overview CZJUG, Prague – May 28, 2008 • No repository defined  No single trusted point for downloading bundles • Each implementation has its own OBR (OSGi bundle repo.)  No automatic download of required bundles/packages  Currently just RFC-112 • Searching by capabilities  Planned in OSGi R5 • Bundle dependency resolver  Resolving bundles can take long time  Maximal sharing of packages • Stale service problem  Services can exchange objects connected to a bundle classloader. What happens when this bundle is stopped? 23
  • 24. Related projects OSGi overview CZJUG, Prague – May 28, 2008 • rOSGi  Access services in a remote OSGi • Glassfish v3  OSGi replace HK2 (module subsystem)  Uses Apache Felix • SpringDM (Spring-OSGi)  Integration of OSGi inside Spring • Spring application platform  Similar concept to OSGi, cooperates with it, reuses bundles  Defines bundles repository • JSR 277  Java Modules, proposed OSGi interoperability 24
  • 25. Q&A OSGi overview CZJUG, Prague – May 28, 2008 Thank you! 25