SlideShare a Scribd company logo
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?

More Related Content

PDF
Session9part2 Servers Detailed
ISSGC Summer School
 
PPT
Session 49 - Semantic metadata management practical
ISSGC Summer School
 
PPT
Session18 Madduri
ISSGC Summer School
 
PDF
Ese2008 Swordfish
wwtyler
 
PDF
Oracle BPM POSTER
Vijay Reddy
 
PDF
OSB POSTER
Vijay Reddy
 
PDF
Automated Performance Analysis of Business Processes
Daniele Gianni
 
Session9part2 Servers Detailed
ISSGC Summer School
 
Session 49 - Semantic metadata management practical
ISSGC Summer School
 
Session18 Madduri
ISSGC Summer School
 
Ese2008 Swordfish
wwtyler
 
Oracle BPM POSTER
Vijay Reddy
 
OSB POSTER
Vijay Reddy
 
Automated Performance Analysis of Business Processes
Daniele Gianni
 

Viewers also liked (17)

PPT
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Charles Moulliard
 
PDF
RC Presentation 2 - 2016
Gail Silverman
 
PDF
M8 acc lesson 8 0 geometry basics
lothomas
 
PDF
Digipak &amp; poster planning (1)
Reba05
 
PDF
Securitization of Intangible Assets
Aishwary Kumar Gupta
 
PDF
CarbonAds.click
CarbonAds .click
 
PPTX
Las células umis y mari
grabugnot
 
PPT
The Dark Art: Is Music Recommendation Science a Science
mpapish
 
PPTX
MEDICINA VETERINARIA
Marcela Moreno
 
PPTX
A2 Media Studies - Digipak analysis
Gliff
 
PDF
Aula 4 agitação e mistura
Davi Fogaça
 
PPTX
A2 Media Studies - Ancillary tasks(planning)
Gliff
 
PPT
ServiceMix 4 -- Integrating OSGi with JBI
Gert Vanthienen
 
ODP
Developing Microservices with Apache Camel
Claus Ibsen
 
KEY
101 lecture 2
Gale Pooley
 
DOCX
Dibujos Prehistoria
Manuela Romera Salas
 
KEY
310 lecture 2
Gale Pooley
 
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Charles Moulliard
 
RC Presentation 2 - 2016
Gail Silverman
 
M8 acc lesson 8 0 geometry basics
lothomas
 
Digipak &amp; poster planning (1)
Reba05
 
Securitization of Intangible Assets
Aishwary Kumar Gupta
 
CarbonAds.click
CarbonAds .click
 
Las células umis y mari
grabugnot
 
The Dark Art: Is Music Recommendation Science a Science
mpapish
 
MEDICINA VETERINARIA
Marcela Moreno
 
A2 Media Studies - Digipak analysis
Gliff
 
Aula 4 agitação e mistura
Davi Fogaça
 
A2 Media Studies - Ancillary tasks(planning)
Gliff
 
ServiceMix 4 -- Integrating OSGi with JBI
Gert Vanthienen
 
Developing Microservices with Apache Camel
Claus Ibsen
 
101 lecture 2
Gale Pooley
 
Dibujos Prehistoria
Manuela Romera Salas
 
310 lecture 2
Gale Pooley
 
Ad

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

PDF
Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...
mfrancis
 
PDF
All About Microservices and OpenSource Microservice Frameworks
Mohammad Asif Siddiqui
 
KEY
Beyond OSGi Software Architecture
Jeroen van Grondelle
 
PDF
Lightbend Lagom: Microservices Just Right
mircodotta
 
PDF
OSGi DevCon 2009 Review
njbartlett
 
PPTX
Play with cloud foundry
Peng Wan
 
PDF
OSGi bootcamp - part 2
Jan Willem Janssen
 
PDF
.NET Core, ASP.NET Core Course, Session 17
Amin Mesbahi
 
PDF
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
David Bosschaert
 
PPTX
Liferay (DXP) 7 Tech Meetup for Developers
Azilen Technologies Pvt. Ltd.
 
PDF
Microservices and modularity with java
DPC Consulting Ltd
 
PPTX
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic
 
ODP
Using Service Oriented Operation and Provisioning at Financial Times
Emeka Mosanya
 
ODP
Puppetconf2012
Emeka Mosanya
 
ZIP
Celix, Universal OSGi?
abroekhuis
 
PPTX
C#on linux
AvarinTalks
 
PDF
SpringBoot and Spring Cloud Service for MSA
Oracle Korea
 
KEY
Is OSGi modularity always worth it?
glynnormington
 
PPT
OSGi Remote Services With SCA using Apache Tuscany
Raymond Feng
 
PPTX
Microservices with kubernetes @190316
Jupil Hwang
 
Automatically Managing Service Dependencies in an OSGi Environment - Marcel O...
mfrancis
 
All About Microservices and OpenSource Microservice Frameworks
Mohammad Asif Siddiqui
 
Beyond OSGi Software Architecture
Jeroen van Grondelle
 
Lightbend Lagom: Microservices Just Right
mircodotta
 
OSGi DevCon 2009 Review
njbartlett
 
Play with cloud foundry
Peng Wan
 
OSGi bootcamp - part 2
Jan Willem Janssen
 
.NET Core, ASP.NET Core Course, Session 17
Amin Mesbahi
 
OSGi Cloud Ecosystems (OSGi Users Forum Germany)
David Bosschaert
 
Liferay (DXP) 7 Tech Meetup for Developers
Azilen Technologies Pvt. Ltd.
 
Microservices and modularity with java
DPC Consulting Ltd
 
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic
 
Using Service Oriented Operation and Provisioning at Financial Times
Emeka Mosanya
 
Puppetconf2012
Emeka Mosanya
 
Celix, Universal OSGi?
abroekhuis
 
C#on linux
AvarinTalks
 
SpringBoot and Spring Cloud Service for MSA
Oracle Korea
 
Is OSGi modularity always worth it?
glynnormington
 
OSGi Remote Services With SCA using Apache Tuscany
Raymond Feng
 
Microservices with kubernetes @190316
Jupil Hwang
 
Ad

More from David Bosschaert (14)

PDF
Node MCU Fun
David Bosschaert
 
PDF
Maximize the power of OSGi
David Bosschaert
 
PDF
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
David Bosschaert
 
PDF
What's cool in the new and updated OSGi Specs (EclipseCon 2014)
David Bosschaert
 
PDF
What's cool in the new and updated OSGi Specs (2013)
David Bosschaert
 
PDF
Benefits of OSGi in Practise
David Bosschaert
 
PDF
OSGi Cloud Ecosystems (EclipseCon 2013)
David Bosschaert
 
PDF
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
David Bosschaert
 
PDF
OSGi Cloud Ecosystems
David Bosschaert
 
PDF
OpenJDK Penrose Presentation (JavaOne 2012)
David Bosschaert
 
PDF
What's new in the OSGi Enterprise Release 5.0
David Bosschaert
 
PDF
Update on the OSGi Enterprise Expert Group
David Bosschaert
 
PDF
Distributed Services - OSGi 4.2 and possible future enhancements
David Bosschaert
 
PDF
Distributed OSGi Demo Eclipsecon 2009
David Bosschaert
 
Node MCU Fun
David Bosschaert
 
Maximize the power of OSGi
David Bosschaert
 
Provisioning with OSGi Subsystems and Repository using Apache Aries and Felix
David Bosschaert
 
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)
David Bosschaert
 
Benefits of OSGi in Practise
David Bosschaert
 
OSGi Cloud Ecosystems (EclipseCon 2013)
David Bosschaert
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
David Bosschaert
 
OSGi Cloud Ecosystems
David Bosschaert
 
OpenJDK Penrose Presentation (JavaOne 2012)
David Bosschaert
 
What's new in the OSGi Enterprise Release 5.0
David Bosschaert
 
Update on the OSGi Enterprise Expert Group
David Bosschaert
 
Distributed Services - OSGi 4.2 and possible future enhancements
David Bosschaert
 
Distributed OSGi Demo Eclipsecon 2009
David Bosschaert
 

Recently uploaded (20)

PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
The Future of Artificial Intelligence (AI)
Mukul
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Software Development Methodologies in 2025
KodekX
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 

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 ● ...