SlideShare una empresa de Scribd logo
1 de 19
What's new in the OSGi 4.2 Enterprise Specification
                                   David Bosschaert, 2010
History
●   EEG formed early 2007
    ●   Work areas identified and work started
●   Work areas:
    ●   Distributed Services
    ●   Developer Support / Spring DM
    ●   JEE – related specifications
●   Remote Services & Blueprint specs part of 4.2
    core/compendium release summer 2009
●   Culmination of the work done in
      4.2 Enterprise Release, Q1 2010
4.2 Enterprise
                          Specification
Component Models                Naming, Management
   ●   Blueprint                   ●   JNDI
   ●   Declarative Services        ●   JMX
Distributed Services            Database Access
   ●   Remote Services             ●   JDBC
   ●   Remote Services Admin       ●   JPA
   ●   SCA Configuration Type      ●   JTA
Web Applications                Supporting Technologies
   ●   Http Service Spec           ●   Events, Config Admin, User
   ●   Web Container Spec              Admin, Trackers, ...
Blueprint
Blueprint makes developing for OSGi easier.
●   Create Blueprint Components
    ●   Based on ideas from Spring Dynamic Modules
    ●   Blueprint Component ≈ Spring DM Bean
●   Inversion of Control
●   Dependency on other components or OSGi Services
●   Register components as Services
Blueprint
                           example Bundle
component.xml                                     MyComponent.java
<blueprint xmlns="...">                           package org.example.test;
  <reference id="logSvc"
  interface="org.osgi.service.log.LogService"/>   import org.osgi.service.log.LogService;

 <bean id="myComponent"                           public class MyComponent implements MyInterface
       class="org.example.test.MyComponent"       {
       init-method="started">                       private LogService logService;
   <property name="dbURL"                           private String dbURL;
             value="jdbc:foo://bar"/>
   <property name="logService"                        public String getDbURL() {
             ref="logSvc"/>                             return dbURL;
 </bean>                                              }

  <service ref="myComponent"                          public void setDbURL(String url) {
    interface="org.example.test.MyInterface"/>          dbURL = url;
</blueprint>                                          }

                                                      public void setLogService(LogService log) {
                                                        logService = log;
Blueprint manifest header:                            }

Bundle-Blueprint: OSGI-INF/blueprint/*.xml            public void started() {
                                                        logService.log(LogService.LOG_INFO,
                                                          "MyComponent started. DB URL: " + dbURL);
                                                      }
                                                  }
Distributed OSGi
Distributed OSGi (RFC 119) split up into three specs:
●   Remote Services spec released in 4.2 Compendium
    Summer 2009
      API to expose and consume remote OSGi Services (service properties)
●   Remote Services Admin spec new in the Enterprise
    Release
      Standardizes the APIs of internal Remote Services components,
      allowing mix & match of sub-components (like Discovery)
●   SCA Configuration spec
      If you want to use SCA metadata for configuration
Remote Services
                              (in brief)
Export a service remotely:                         Import a remote service:
 ●   Add an extra service property                 ●   With Discovery
public class Activator
       implements BundleActivator {
  private ServiceRegistration reg;
                                                          automatic
 public void start(BundleContext bc) {
   Dictionary props = new Hashtable();
                                                   ●   With static
   props.put("service.exported.interfaces",
             "*");                                     <endpoint-description>   files
     // optionally, configure some details
     // for example
     props.put("service.exported.configs",
                                                   ●   All client-side proxies
               "org.apache.cxf.ws");
     props.put("org.apache.cxf.ws.address",            services have
               "http://localhost:9090/greeter");
                                                          service.imported
     reg = bc.registerService(
       GreeterService.class.getName(),
       new GreeterServiceImpl(), props);               property set.
     // Greeter Service now accessible
     // over network
 }
 …
Remote Service
                                       Admin
 Standardizes the API of components under the hood
        ●    Distribution Provider, Topology Manager, Discovery
VM1


            creates                                                                           remote
                                                                                              invocation


  Distribution                    Topology    remote     Discovery
  Distribution                    Topology    service
                                                         Discovery          network
   Provider
   Provider           instructs   Manager
                                  Manager    metadata   Component
                                                        Component




         X              listens
                                                              D
                                                              D      T
                                                                     T     DP
                                                                           DP      creates   X'
                                                                                             X'
      a service
      by some                                                            listens
      bundle
                                                                                         Service
                                                                                         Service
                                                                                          Client
                                                                                          Client
                                                                                         Bundle
                                                                                         Bundle
                                                            VM2
Web Applications
Deploy your webapps straight into an OSGi Framework
Supports .WAR and .WAB files
   ●   Deploy them just like any other bundle
   ●   .WAB primary deployment format
        –   Is a proper bundle, with BSN, package Imports & Exports, etc...
        –   Required Manifest header:
            Web-ContextPath: /myServlet

   ●   .WARs are turned into a .WAB via a URL handler, e.g.
            webbundle:file:///mywebapp.war?Web-ContextPath=/myServlet
Web Applications (2)
Support for interaction with OSGi Framework
   ●   Access to Bundle Context from within a Servlet
            BundleContext bc = (BundleContext)
                servletContext.getAttribute("osgi-bundlecontext");

   ●   Servlet Context registered in OSGi Service Registry
        –   For every successfully started Web Application
JPA
Proper database persistence for OSGi
●   Don't use static Persistence class to create an
    EntityManager
●   Look up EntityManagerFactory or
    EntityManagerFactoryBuilder in the Service Registry
●   A bundle defining Persistence Units declares this using
    the OSGi/JPA header:
      Meta-Persistence: OSGI-INF/people-persistence.xml

●   Look up Filter
      filter:    (osgi.unit.name=People)
      interface: javax.persistence.EntityManagerFactory
JPA (2)
Small example:
  EntityManagerFactory emf = … // from OSGi Service Registry

  // From here everything is familiar
  EntityManager em = emf.createEntityManager();
  em.getTransaction().begin();
  Person person = new Person();
  person.setName("David");
  em.persist(person);
  em.getTransaction().commit();
  …
JNDI
Access to OSGi from JNDI clients
   ●   Look up OSGi Services and BundleContext through JNDI osgi:
       scheme
  osgi:service/javax.sql.DataSource
  osgi:service/my_service (if service sets the osgi.jndi.service.name property)
  osgi:servicelist/javax.sql.DataSource
  osgi:framework/bundleContext

Access to JNDI for OSGi Bundles
   ●   Look up JNDI in OSGi Service Registry
        –   JNDIContextManager Service provides access JNDI Initial Context
        –   Service registry preferred over calling new InitialContext()
JTA
Provides OSGi services in the registry:
   ●   javax.transaction.UserTransaction
   ●   javax.transaction.TransactionManager
   ●   javax.transaction.TransactionSynchronizationRegistry
Supports XA Resources.
JDBC

Database Drivers registered in the OSGi Service Registry
as DataSourceFactory objects
   ●   With APIs to create
        –   javax.sql.DataSource
        –   javax.sql.ConnectionPoolDataSource
        –   javax.sql.XADataSource
        –   java.sql.Driver
JMX
●   JMX access to the OSGi Framework
    ●   Framework Control (Bundle lifecycle)
    ●   Bundle information
    ●   Service information
●   Services supported
    ●   Package Admin
    ●   Configuration Admin
    ●   Permission Admin
    ●   Initial Provisioning
    ●   User Admin
Examples?
●   Apache Aries Trader
    ●   Leverages
         –   Blueprint
         –   Web
         –   JPA / JDBC
         –   JTA
         –   JNDI
        http://incubator.apache.org/aries/ariestrader.html

●   Besides that lots of more isolated examples can be
    found in the various implementing projects.
Future EEG work
Besides refinements to current specs...
●   Subsystems & Applications
●   OBR
●   Async communications
     ●    JMS
     ●    Message Driven Components
     ●    Asynchronous Services
●   ...
Questions?

Más contenido relacionado

Destacado

Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCharles Moulliard
 
RC Presentation 2 - 2016
RC Presentation 2 - 2016RC Presentation 2 - 2016
RC Presentation 2 - 2016Gail Silverman
 
M8 acc lesson 8 0 geometry basics
M8 acc lesson 8 0 geometry basicsM8 acc lesson 8 0 geometry basics
M8 acc lesson 8 0 geometry basicslothomas
 
Digipak &amp; poster planning (1)
Digipak &amp; poster planning (1)Digipak &amp; poster planning (1)
Digipak &amp; poster planning (1)Reba05
 
Securitization of Intangible Assets
Securitization of Intangible AssetsSecuritization of Intangible Assets
Securitization of Intangible AssetsAishwary Kumar Gupta
 
Las células umis y mari
Las células umis y mariLas células umis y mari
Las células umis y marigrabugnot
 
The Dark Art: Is Music Recommendation Science a Science
The Dark Art: Is Music Recommendation Science a ScienceThe Dark Art: Is Music Recommendation Science a Science
The Dark Art: Is Music Recommendation Science a Sciencempapish
 
A2 Media Studies - Digipak analysis
A2 Media Studies - Digipak analysisA2 Media Studies - Digipak analysis
A2 Media Studies - Digipak analysisGliff
 
Aula 4 agitação e mistura
Aula 4   agitação e misturaAula 4   agitação e mistura
Aula 4 agitação e misturaDavi Fogaça
 
A2 Media Studies - Ancillary tasks(planning)
A2 Media Studies - Ancillary tasks(planning)A2 Media Studies - Ancillary tasks(planning)
A2 Media Studies - Ancillary tasks(planning)Gliff
 
ServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIGert Vanthienen
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache CamelClaus Ibsen
 

Destacado (17)

Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/CamelCamelone-2012 HTML5 WebSocket ActiveMQ/Camel
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
 
RC Presentation 2 - 2016
RC Presentation 2 - 2016RC Presentation 2 - 2016
RC Presentation 2 - 2016
 
M8 acc lesson 8 0 geometry basics
M8 acc lesson 8 0 geometry basicsM8 acc lesson 8 0 geometry basics
M8 acc lesson 8 0 geometry basics
 
Digipak &amp; poster planning (1)
Digipak &amp; poster planning (1)Digipak &amp; poster planning (1)
Digipak &amp; poster planning (1)
 
Securitization of Intangible Assets
Securitization of Intangible AssetsSecuritization of Intangible Assets
Securitization of Intangible Assets
 
CarbonAds.click
CarbonAds.clickCarbonAds.click
CarbonAds.click
 
Las células umis y mari
Las células umis y mariLas células umis y mari
Las células umis y mari
 
The Dark Art: Is Music Recommendation Science a Science
The Dark Art: Is Music Recommendation Science a ScienceThe Dark Art: Is Music Recommendation Science a Science
The Dark Art: Is Music Recommendation Science a Science
 
MEDICINA VETERINARIA
MEDICINA VETERINARIAMEDICINA VETERINARIA
MEDICINA VETERINARIA
 
A2 Media Studies - Digipak analysis
A2 Media Studies - Digipak analysisA2 Media Studies - Digipak analysis
A2 Media Studies - Digipak analysis
 
Aula 4 agitação e mistura
Aula 4   agitação e misturaAula 4   agitação e mistura
Aula 4 agitação e mistura
 
A2 Media Studies - Ancillary tasks(planning)
A2 Media Studies - Ancillary tasks(planning)A2 Media Studies - Ancillary tasks(planning)
A2 Media Studies - Ancillary tasks(planning)
 
ServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBI
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache Camel
 
101 lecture 2
101 lecture 2101 lecture 2
101 lecture 2
 
Dibujos Prehistoria
Dibujos PrehistoriaDibujos Prehistoria
Dibujos Prehistoria
 
310 lecture 2
310 lecture 2310 lecture 2
310 lecture 2
 

Similar a What's new in the OSGi 4.2 Enterprise Release

Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...
Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...
Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...mfrancis
 
All About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice FrameworksAll About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice FrameworksMohammad Asif Siddiqui
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Rightmircodotta
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Reviewnjbartlett
 
Play with cloud foundry
Play with cloud foundryPlay with cloud foundry
Play with cloud foundryPeng Wan
 
.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17aminmesbahi
 
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)David Bosschaert
 
Microservices and modularity with java
Microservices and modularity with javaMicroservices and modularity with java
Microservices and modularity with javaDPC Consulting Ltd
 
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with KubernetesSumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with KubernetesSumo Logic
 
Using Service Oriented Operation and Provisioning at Financial Times
Using Service Oriented Operation and Provisioning at Financial TimesUsing Service Oriented Operation and Provisioning at Financial Times
Using Service Oriented Operation and Provisioning at Financial TimesEmeka Mosanya
 
Celix, Universal OSGi?
Celix, Universal OSGi?Celix, Universal OSGi?
Celix, Universal OSGi?abroekhuis
 
SpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSASpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSAOracle Korea
 
Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?glynnormington
 
OSGi Remote Services With SCA using Apache Tuscany
OSGi Remote Services With SCA using Apache TuscanyOSGi Remote Services With SCA using Apache Tuscany
OSGi Remote Services With SCA using Apache TuscanyRaymond Feng
 
Microservices with kubernetes @190316
Microservices with kubernetes @190316Microservices with kubernetes @190316
Microservices with kubernetes @190316Jupil Hwang
 

Similar a What's new in the OSGi 4.2 Enterprise Release (20)

Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...
Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...
Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...
 
All About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice FrameworksAll About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice Frameworks
 
Beyond OSGi Software Architecture
Beyond OSGi Software ArchitectureBeyond OSGi Software Architecture
Beyond OSGi Software Architecture
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Review
 
Play with cloud foundry
Play with cloud foundryPlay with cloud foundry
Play with cloud foundry
 
OSGi bootcamp - part 2
OSGi bootcamp - part 2OSGi bootcamp - part 2
OSGi bootcamp - part 2
 
.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17
 
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)OSGi Cloud Ecosystems (OSGi Users Forum Germany)
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
 
Microservices and modularity with java
Microservices and modularity with javaMicroservices and modularity with java
Microservices and modularity with java
 
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with KubernetesSumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
 
Using Service Oriented Operation and Provisioning at Financial Times
Using Service Oriented Operation and Provisioning at Financial TimesUsing Service Oriented Operation and Provisioning at Financial Times
Using Service Oriented Operation and Provisioning at Financial Times
 
Puppetconf2012
Puppetconf2012Puppetconf2012
Puppetconf2012
 
Celix, Universal OSGi?
Celix, Universal OSGi?Celix, Universal OSGi?
Celix, Universal OSGi?
 
C#on linux
C#on linuxC#on linux
C#on linux
 
SpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSASpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSA
 
Is OSGi modularity always worth it?
Is OSGi modularity always worth it?Is OSGi modularity always worth it?
Is OSGi modularity always worth it?
 
OSGi Remote Services With SCA using Apache Tuscany
OSGi Remote Services With SCA using Apache TuscanyOSGi Remote Services With SCA using Apache Tuscany
OSGi Remote Services With SCA using Apache Tuscany
 
Microservices with kubernetes @190316
Microservices with kubernetes @190316Microservices with kubernetes @190316
Microservices with kubernetes @190316
 

Más de David Bosschaert

Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGiDavid Bosschaert
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixDavid Bosschaert
 
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)David Bosschaert
 
What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)David Bosschaert
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in PractiseDavid Bosschaert
 
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)David Bosschaert
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)David Bosschaert
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)David Bosschaert
 
What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0David Bosschaert
 
Update on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert GroupUpdate on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert GroupDavid Bosschaert
 
Distributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancementsDistributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancementsDavid Bosschaert
 
Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009David Bosschaert
 

Más de David Bosschaert (14)

Node MCU Fun
Node MCU FunNode MCU Fun
Node MCU Fun
 
Maximize the power of OSGi
Maximize the power of OSGiMaximize the power of OSGi
Maximize the power of OSGi
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and FelixProvisioning with OSGi Subsystems and Repository using Apache Aries and Felix
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
 
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)What's cool in the new and updated OSGi Specs (EclipseCon 2014)
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
 
What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)What's cool in the new and updated OSGi Specs (2013)
What's cool in the new and updated OSGi Specs (2013)
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
 
OSGi Cloud Ecosystems
OSGi Cloud EcosystemsOSGi Cloud Ecosystems
OSGi Cloud Ecosystems
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)
 
What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0
 
Update on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert GroupUpdate on the OSGi Enterprise Expert Group
Update on the OSGi Enterprise Expert Group
 
Distributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancementsDistributed Services - OSGi 4.2 and possible future enhancements
Distributed Services - OSGi 4.2 and possible future enhancements
 
Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009Distributed OSGi Demo Eclipsecon 2009
Distributed OSGi Demo Eclipsecon 2009
 

Último

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
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
 

Último (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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...
 
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
 

What's new in the OSGi 4.2 Enterprise Release

  • 1. What's new in the OSGi 4.2 Enterprise Specification David Bosschaert, 2010
  • 2. History ● EEG formed early 2007 ● Work areas identified and work started ● Work areas: ● Distributed Services ● Developer Support / Spring DM ● JEE – related specifications ● Remote Services & Blueprint specs part of 4.2 core/compendium release summer 2009 ● Culmination of the work done in 4.2 Enterprise Release, Q1 2010
  • 3. 4.2 Enterprise Specification Component Models Naming, Management ● Blueprint ● JNDI ● Declarative Services ● JMX Distributed Services Database Access ● Remote Services ● JDBC ● Remote Services Admin ● JPA ● SCA Configuration Type ● JTA Web Applications Supporting Technologies ● Http Service Spec ● Events, Config Admin, User ● Web Container Spec Admin, Trackers, ...
  • 4. Blueprint Blueprint makes developing for OSGi easier. ● Create Blueprint Components ● Based on ideas from Spring Dynamic Modules ● Blueprint Component ≈ Spring DM Bean ● Inversion of Control ● Dependency on other components or OSGi Services ● Register components as Services
  • 5. Blueprint example Bundle component.xml MyComponent.java <blueprint xmlns="..."> package org.example.test; <reference id="logSvc" interface="org.osgi.service.log.LogService"/> import org.osgi.service.log.LogService; <bean id="myComponent" public class MyComponent implements MyInterface class="org.example.test.MyComponent" { init-method="started"> private LogService logService; <property name="dbURL" private String dbURL; value="jdbc:foo://bar"/> <property name="logService" public String getDbURL() { ref="logSvc"/> return dbURL; </bean> } <service ref="myComponent" public void setDbURL(String url) { interface="org.example.test.MyInterface"/> dbURL = url; </blueprint> } public void setLogService(LogService log) { logService = log; Blueprint manifest header: } Bundle-Blueprint: OSGI-INF/blueprint/*.xml public void started() { logService.log(LogService.LOG_INFO, "MyComponent started. DB URL: " + dbURL); } }
  • 6. Distributed OSGi Distributed OSGi (RFC 119) split up into three specs: ● Remote Services spec released in 4.2 Compendium Summer 2009 API to expose and consume remote OSGi Services (service properties) ● Remote Services Admin spec new in the Enterprise Release Standardizes the APIs of internal Remote Services components, allowing mix & match of sub-components (like Discovery) ● SCA Configuration spec If you want to use SCA metadata for configuration
  • 7. Remote Services (in brief) Export a service remotely: Import a remote service: ● Add an extra service property ● With Discovery public class Activator implements BundleActivator { private ServiceRegistration reg; automatic public void start(BundleContext bc) { Dictionary props = new Hashtable(); ● With static props.put("service.exported.interfaces", "*"); <endpoint-description> files // optionally, configure some details // for example props.put("service.exported.configs", ● All client-side proxies "org.apache.cxf.ws"); props.put("org.apache.cxf.ws.address", services have "http://localhost:9090/greeter"); service.imported reg = bc.registerService( GreeterService.class.getName(), new GreeterServiceImpl(), props); property set. // Greeter Service now accessible // over network } …
  • 8. Remote Service Admin Standardizes the API of components under the hood ● Distribution Provider, Topology Manager, Discovery VM1 creates remote invocation Distribution Topology remote Discovery Distribution Topology service Discovery network Provider Provider instructs Manager Manager metadata Component Component X listens D D T T DP DP creates X' X' a service by some listens bundle Service Service Client Client Bundle Bundle VM2
  • 9. Web Applications Deploy your webapps straight into an OSGi Framework Supports .WAR and .WAB files ● Deploy them just like any other bundle ● .WAB primary deployment format – Is a proper bundle, with BSN, package Imports & Exports, etc... – Required Manifest header: Web-ContextPath: /myServlet ● .WARs are turned into a .WAB via a URL handler, e.g. webbundle:file:///mywebapp.war?Web-ContextPath=/myServlet
  • 10. Web Applications (2) Support for interaction with OSGi Framework ● Access to Bundle Context from within a Servlet BundleContext bc = (BundleContext) servletContext.getAttribute("osgi-bundlecontext"); ● Servlet Context registered in OSGi Service Registry – For every successfully started Web Application
  • 11. JPA Proper database persistence for OSGi ● Don't use static Persistence class to create an EntityManager ● Look up EntityManagerFactory or EntityManagerFactoryBuilder in the Service Registry ● A bundle defining Persistence Units declares this using the OSGi/JPA header: Meta-Persistence: OSGI-INF/people-persistence.xml ● Look up Filter filter: (osgi.unit.name=People) interface: javax.persistence.EntityManagerFactory
  • 12. JPA (2) Small example: EntityManagerFactory emf = … // from OSGi Service Registry // From here everything is familiar EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); Person person = new Person(); person.setName("David"); em.persist(person); em.getTransaction().commit(); …
  • 13. JNDI Access to OSGi from JNDI clients ● Look up OSGi Services and BundleContext through JNDI osgi: scheme osgi:service/javax.sql.DataSource osgi:service/my_service (if service sets the osgi.jndi.service.name property) osgi:servicelist/javax.sql.DataSource osgi:framework/bundleContext Access to JNDI for OSGi Bundles ● Look up JNDI in OSGi Service Registry – JNDIContextManager Service provides access JNDI Initial Context – Service registry preferred over calling new InitialContext()
  • 14. JTA Provides OSGi services in the registry: ● javax.transaction.UserTransaction ● javax.transaction.TransactionManager ● javax.transaction.TransactionSynchronizationRegistry Supports XA Resources.
  • 15. JDBC Database Drivers registered in the OSGi Service Registry as DataSourceFactory objects ● With APIs to create – javax.sql.DataSource – javax.sql.ConnectionPoolDataSource – javax.sql.XADataSource – java.sql.Driver
  • 16. JMX ● JMX access to the OSGi Framework ● Framework Control (Bundle lifecycle) ● Bundle information ● Service information ● Services supported ● Package Admin ● Configuration Admin ● Permission Admin ● Initial Provisioning ● User Admin
  • 17. Examples? ● Apache Aries Trader ● Leverages – Blueprint – Web – JPA / JDBC – JTA – JNDI http://incubator.apache.org/aries/ariestrader.html ● Besides that lots of more isolated examples can be found in the various implementing projects.
  • 18. Future EEG work Besides refinements to current specs... ● Subsystems & Applications ● OBR ● Async communications ● JMS ● Message Driven Components ● Asynchronous Services ● ...