SlideShare a Scribd company logo
1
<Insert Picture Here>




OSGi and Java EE: A Hybrid Approach to Enterprise Java Application
Development
Sanjeeb Sahoo and Sivakumar Thyagarajan
Staff Engineers, Sun Microsystems India Pvt. Ltd.
JavaOne and Oracle Develop

Latin America 2010

December 7–9, 2010




                             3
JavaOne and Oracle Develop

Beijing 2010

December 13–16, 2010




                             4
Agenda


•   OSGi 101                                   <Insert Picture Here>

•   Basic OSGi Demo
•   OSGi meets Java EE – Hybrid Applications
•   Hybrid Application Demo
•   Advanced usecases
•   Q&A




                                                                  5
Agenda


•   OSGi 101                                   <Insert Picture Here>

•   Basic OSGi Demo
•   OSGi meets Java EE – Hybrid Applications
•   Hybrid Application Demo
•   Advanced usecases
•   Q&A




                                                                  6
OSGi



       Service oriented
          dynamic
       module system
           for Java


                          7
OSGi Layers




              8
Module Layer


• Bundle – a unit of modularity in OSGi
• Encapsulation
• Lifecycle independent of the JVM
• Versionable
• Packaged as a JAR (classes + Manifest with OSGi
  metadata)
• Very explicit dependency specification
• Well defined dependency resolution rules




                                                    9
OSGi Metadata



Bundle-SymbolicName: com.acme.hello.startup
Bundle-Name: Hello World OSGi Sample
Bundle-Version: 1.0.1
Bundle-ManifestVersion: 2
Bundle-Activator: com.acme.hello.startup.MyActivator
Export-Package: com.acme.hello.startup;version=1.0.0
Import-Package: org.osgi.framework;version=1.3




                                                       10
Classloading in OSGi




Image from the OSGi R4 Core Specification



                                            11
Lifecycle Layer


• Provides an API to manage bundles
  – BundleContext.install
  – BundleContext.uninstall
  – Bundle.update
• BundleActivator
• BundleListener – listen to BundleEvents
  – Synchronous
  – Asynchronous




                                            12
Bundle Lifecycle




Image from the OSGi R4 Core Specification



                                            13
Service Layer

• In-VM SOA
• Service Registry
  – Register
  – Unregister
• Service is a POJO
• Service Dynamism
  – Service tracking
• Service Discovery
  – LDAP filter based queries




                                14
Interactions between OSGi Layers




Image from the OSGi R4 Core Specification



                                            15
Simple OSGi Demo




                   16
OSGi benefits – a recap

• Layered approach
• Modularity
  –   Enforces modularity
  –   Ensures class-space consistency
  –   Enables component reuse
  –   Supports versioning and evolution
• Dynamism
  – Bundles
  – Services
• Ease of deployment and management
  – OBR
     • Bundle deployment order is not relevant
  – Faster deployment cycle




                                                 17
OSGi meets Java EE




                     18
Agenda


•   OSGi 101                                   <Insert Picture Here>

•   Basic OSGi Demo
•   OSGi meets Java EE – Hybrid Applications
•   Hybrid Application Demo
•   Advanced usecases
•   Q&A




                                                                 19
Java EE
Platform of choice for enterprise applications


• Widely used APIs (JPA, JTA, JAXB, JNDI)
• Component Models (Servlet, EJB, JAX-RS)
• Frameworks (JSF, CDI)
• Ease of Use (Annotations, Convention over
  Configuration)
• Platform provided infrastructure services
  (Transaction, Security, Persistence, Remoting)
• Tools (IDE, Management, Monitoring)
• Ubiquitous deployment platform for enterprise
  applications


                                                   20
Hybrid Applications
Meeting of the two worlds


• OSGi + Java EE = Hybrid application
• Hybrid application
   – An OSGi bundle
   – And a Java EE Archive
• Leverage the capabilities of both the platforms
   – Enterprise applications can now be built as OSGi bundles
   – OSGi bundles can now use Java EE services




                                                                21
Current State

• OSGi Enterprise Expert Group (EEG)
  – Relased OSGi Service Platform Enterprise Specification 4.2
    in 2010
• Open source efforts
  – Project GlassFish
  – Project Aries
  – Eclipse Gemini




                                                                 22
Enterprise OSGi Specifications

•   OSGi/Web Application (RFC #66)
•   OSGi/JPA (RFC #143)
•   OSGi/JDBC (RFC #122)
•   OSGi/JTA (RFC #98)
•   OSGi/JNDI (RFC #142)
•   OSGi/HTTP Service




                                     23
Hybrid application bundle lifecycle




                                      24
OSGi/Web Application (WAB)

• Web Application Bundle (WAB)
  – WAR + OSGi metadata + Web-ContextPath header
• Can use all enterprise APIs (like JPA, JTA)
• Wrapped WAR support
  – webbundle: URL scheme




                                                   25
OSGi/EJB Application

• Allows you to develop managed, transactional, secure
  OSGi services with very little knowledge of OSGi
• Make your existing EJB service available to OSGi
  clients with little effort
• Achieved through simple manifest metadata
  – Export-EJB: ALL/None/<names of stateless local EJB>




                                                          26
EE APIs in OSGi

• OSGi/JDBC
  – JDBC driver as DataSourceFactory
  – Dynamic discovery of driver details
  – Multiple versions of same driver
• OSGi/JTA
  – JTA artifacts available as OSGi Services
• OSGi/JPA
  – Enhancement of JPA entities at runtime
  – Same packaging rules as JPA and also deploy entities as a
    bundle
  – Shared Persistence Unit and thereby shared second level
    cache



                                                                27
Demo: Putting them
together




                     28
Demo schematic


• WAB

• JPA- LAZY loading

• EJB as Service

• OBR

• Security/Transaction
 Context propagation




                         29
Advanced Usecases




                    30
Agenda


•   OSGi 101                                   <Insert Picture Here>

•   Basic OSGi Demo
•   OSGi meets Java EE – Hybrid Applications
•   Hybrid Application Demo
•   Advanced usecases
•   Q&A




                                                                 31
CDI

• Brings type-safe dependency injection to EE platform
  – Strong typing and loose coupling
• Well defined life cycle of stateful objects bound to life
  cycle contexts
• Ability to decorate and intercept injected Beans
• An event notification model
• An ability to develop portable extensions that
  integrates with the container to extend the runtime




                                                              32
GlassFish CDI/OSGi Portable Extension

• Use of CDI for type safe injection of OSGi services

@WebServlet(urlPatterns = “/login”)
public class FooServlet implements HttpServlet {
    @Inject 
    @org.glassfish.osgicdi.OSGiService(
          dynamic=”true”, 
          timeout = 200, 
          serviceCriteria=<an ldap query >
    FooService foo;
}




                                                        33
Demo: Service Injection




                          34
Call To Action

• Want to build hybrid applications? Come to our HOL
  – ID#: S313522, tomorrow at 12:00 in Plaza A of Hilton San
    Francisco
• Want to try out?
  – Use GlassFish 3.1 trunk builds from http://glassfish.org
• Questions?
  – users@glassfish.dev.java.net




                                                               35
References

• OSGi Service Platform Core and Enterprise
  Specification 4.2
  – http://www.osgi.org
• Project GlassFish
  – http://glassfish.org
• Hybrid application samples
  – http://wikis.sun.com/display/GlassFish/BlogsGfOsgi




                                                         36
Agenda


•   OSGi 101                                   <Insert Picture Here>

•   Basic OSGi Demo
•   OSGi meets Java EE – Hybrid Applications
•   Hybrid Application Demo
•   Advanced usecases
•   Q&A




                                                                 37
Safe Harbor Statements


The following is intended to outline our general
product direction. It is intended for information
purposes only, and may not be incorporated into any
contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.




                                                      38
The preceding is intended to outline our general
product direction. It is intended for information
purposes only, and may not be incorporated into any
contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.




                                                      39
<Insert Picture Here>




OSGi and Java EE: A Hybrid Approach to Enterprise Java Application
Development
{sahoo, sivakumart}@sun.com
Staff Engineers, Sun Microsystems India Pvt. Ltd.
41

More Related Content

What's hot

Intro To OSGi
Intro To OSGiIntro To OSGi
Intro To OSGi
Stephan Janssen
 
Going Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha ZelzerGoing Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha Zelzer
mfrancis
 
Introduction to-osgi
Introduction to-osgiIntroduction to-osgi
Introduction to-osgi
Ioannis Canellos
 
OSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishOSGi & Java EE in GlassFish
OSGi & Java EE in GlassFish
Sanjeeb Sahoo
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGi
Ilya Rybak
 
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
Normandy JUG
 
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
Arun Gupta
 
Intro to OSGi
Intro to OSGiIntro to OSGi
Intro to OSGi
Tricode (part of Dept)
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7
Azilen Technologies Pvt. Ltd.
 
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
mfrancis
 
GlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixGlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox Felix
Ludovic Champenois
 
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
Arun Gupta
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
Julien Dubois
 
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
 
Native OSGi, Modular Software Development in a Native World - Alexander Broek...
Native OSGi, Modular Software Development in a Native World - Alexander Broek...Native OSGi, Modular Software Development in a Native World - Alexander Broek...
Native OSGi, Modular Software Development in a Native World - Alexander Broek...
mfrancis
 
Weld-OSGi, injecting easiness in OSGi
Weld-OSGi, injecting easiness in OSGiWeld-OSGi, injecting easiness in OSGi
Weld-OSGi, injecting easiness in OSGi
Mathieu Ancelin
 
Desiging for Modularity with Java 9
Desiging for Modularity with Java 9Desiging for Modularity with Java 9
Desiging for Modularity with Java 9
Sander Mak (@Sander_Mak)
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
Sander Mak (@Sander_Mak)
 
Modular Java
Modular JavaModular Java
Modular Java
Martin Toshev
 

What's hot (20)

Intro To OSGi
Intro To OSGiIntro To OSGi
Intro To OSGi
 
Going Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha ZelzerGoing Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha Zelzer
 
OSGi Blueprint Services
OSGi Blueprint ServicesOSGi Blueprint Services
OSGi Blueprint Services
 
Introduction to-osgi
Introduction to-osgiIntroduction to-osgi
Introduction to-osgi
 
OSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishOSGi & Java EE in GlassFish
OSGi & Java EE in GlassFish
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGi
 
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
 
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
 
Intro to OSGi
Intro to OSGiIntro to OSGi
Intro to OSGi
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7
 
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
 
GlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixGlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox Felix
 
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
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
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)
 
Native OSGi, Modular Software Development in a Native World - Alexander Broek...
Native OSGi, Modular Software Development in a Native World - Alexander Broek...Native OSGi, Modular Software Development in a Native World - Alexander Broek...
Native OSGi, Modular Software Development in a Native World - Alexander Broek...
 
Weld-OSGi, injecting easiness in OSGi
Weld-OSGi, injecting easiness in OSGiWeld-OSGi, injecting easiness in OSGi
Weld-OSGi, injecting easiness in OSGi
 
Desiging for Modularity with Java 9
Desiging for Modularity with Java 9Desiging for Modularity with Java 9
Desiging for Modularity with Java 9
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
 
Modular Java
Modular JavaModular Java
Modular Java
 

Similar to OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development

OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OpenBlend society
 
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
Arun Gupta
 
Os gi l
Os gi lOs gi l
Os gi l
babu4b4u
 
OSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon KaegiOSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon Kaegi
mfrancis
 
OSGi Working Group Technical Progress Report 2007 - Enterprise
OSGi Working Group Technical Progress Report 2007 - EnterpriseOSGi Working Group Technical Progress Report 2007 - Enterprise
OSGi Working Group Technical Progress Report 2007 - Enterprise
mfrancis
 
OSGi on Google Android using Apache Felix
OSGi on Google Android using Apache FelixOSGi on Google Android using Apache Felix
OSGi on Google Android using Apache Felix
Marcel Offermans
 
OTN Developer Days - GlassFish
OTN Developer Days - GlassFishOTN Developer Days - GlassFish
OTN Developer Days - GlassFish
glassfish
 
A Platform Approach to Enterprise Content Management with Eclipse Apricot, CM...
A Platform Approach to Enterprise Content Management with Eclipse Apricot, CM...A Platform Approach to Enterprise Content Management with Eclipse Apricot, CM...
A Platform Approach to Enterprise Content Management with Eclipse Apricot, CM...
Nuxeo
 
Introducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management PlatformIntroducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management Platform
Nuxeo
 
Eclipse Apricot
Eclipse ApricotEclipse Apricot
Eclipse Apricot
Nuxeo
 
GlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 ApplicationsGlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 ApplicationsArun Gupta
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011
Arun Gupta
 
OSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P KriensOSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P Kriens
mfrancis
 
OSGi introduction
OSGi introductionOSGi introduction
OSGi introduction
Dario Bonino
 
Osgi platform
Osgi platformOsgi platform
Osgi platform
Yuriy Shapovalov
 
Java EE 6 Clustering with Glassfish 3.1
Java EE 6 Clustering with Glassfish 3.1 Java EE 6 Clustering with Glassfish 3.1
Java EE 6 Clustering with Glassfish 3.1 Shreedhar Ganapathy
 
AS7/OSGi One Day Talk 2012
AS7/OSGi One Day Talk 2012AS7/OSGi One Day Talk 2012
AS7/OSGi One Day Talk 2012tdiesler
 
Case Study: Plus Retail - Moving from the Old World to the New World
Case Study: Plus Retail - Moving from the Old World to the New WorldCase Study: Plus Retail - Moving from the Old World to the New World
Case Study: Plus Retail - Moving from the Old World to the New World
ForgeRock
 
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
Nuxeo
 

Similar to OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development (20)

OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
 
OSGi 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
 
Os gi l
Os gi lOs gi l
Os gi l
 
OSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon KaegiOSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon Kaegi
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
OSGi Working Group Technical Progress Report 2007 - Enterprise
OSGi Working Group Technical Progress Report 2007 - EnterpriseOSGi Working Group Technical Progress Report 2007 - Enterprise
OSGi Working Group Technical Progress Report 2007 - Enterprise
 
OSGi on Google Android using Apache Felix
OSGi on Google Android using Apache FelixOSGi on Google Android using Apache Felix
OSGi on Google Android using Apache Felix
 
OTN Developer Days - GlassFish
OTN Developer Days - GlassFishOTN Developer Days - GlassFish
OTN Developer Days - GlassFish
 
A Platform Approach to Enterprise Content Management with Eclipse Apricot, CM...
A Platform Approach to Enterprise Content Management with Eclipse Apricot, CM...A Platform Approach to Enterprise Content Management with Eclipse Apricot, CM...
A Platform Approach to Enterprise Content Management with Eclipse Apricot, CM...
 
Introducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management PlatformIntroducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management Platform
 
Eclipse Apricot
Eclipse ApricotEclipse Apricot
Eclipse Apricot
 
GlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 ApplicationsGlassFish Server 3.1: Deploying your Java EE 6 Applications
GlassFish Server 3.1: Deploying your Java EE 6 Applications
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011
 
OSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P KriensOSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P Kriens
 
OSGi introduction
OSGi introductionOSGi introduction
OSGi introduction
 
Osgi platform
Osgi platformOsgi platform
Osgi platform
 
Java EE 6 Clustering with Glassfish 3.1
Java EE 6 Clustering with Glassfish 3.1 Java EE 6 Clustering with Glassfish 3.1
Java EE 6 Clustering with Glassfish 3.1
 
AS7/OSGi One Day Talk 2012
AS7/OSGi One Day Talk 2012AS7/OSGi One Day Talk 2012
AS7/OSGi One Day Talk 2012
 
Case Study: Plus Retail - Moving from the Old World to the New World
Case Study: Plus Retail - Moving from the Old World to the New WorldCase Study: Plus Retail - Moving from the Old World to the New World
Case Study: Plus Retail - Moving from the Old World to the New World
 
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
 

Recently uploaded

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development

  • 1. 1
  • 2. <Insert Picture Here> OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development Sanjeeb Sahoo and Sivakumar Thyagarajan Staff Engineers, Sun Microsystems India Pvt. Ltd.
  • 3. JavaOne and Oracle Develop Latin America 2010 December 7–9, 2010 3
  • 4. JavaOne and Oracle Develop Beijing 2010 December 13–16, 2010 4
  • 5. Agenda • OSGi 101 <Insert Picture Here> • Basic OSGi Demo • OSGi meets Java EE – Hybrid Applications • Hybrid Application Demo • Advanced usecases • Q&A 5
  • 6. Agenda • OSGi 101 <Insert Picture Here> • Basic OSGi Demo • OSGi meets Java EE – Hybrid Applications • Hybrid Application Demo • Advanced usecases • Q&A 6
  • 7. OSGi Service oriented dynamic module system for Java 7
  • 9. Module Layer • Bundle – a unit of modularity in OSGi • Encapsulation • Lifecycle independent of the JVM • Versionable • Packaged as a JAR (classes + Manifest with OSGi metadata) • Very explicit dependency specification • Well defined dependency resolution rules 9
  • 10. OSGi Metadata Bundle-SymbolicName: com.acme.hello.startup Bundle-Name: Hello World OSGi Sample Bundle-Version: 1.0.1 Bundle-ManifestVersion: 2 Bundle-Activator: com.acme.hello.startup.MyActivator Export-Package: com.acme.hello.startup;version=1.0.0 Import-Package: org.osgi.framework;version=1.3 10
  • 11. Classloading in OSGi Image from the OSGi R4 Core Specification 11
  • 12. Lifecycle Layer • Provides an API to manage bundles – BundleContext.install – BundleContext.uninstall – Bundle.update • BundleActivator • BundleListener – listen to BundleEvents – Synchronous – Asynchronous 12
  • 13. Bundle Lifecycle Image from the OSGi R4 Core Specification 13
  • 14. Service Layer • In-VM SOA • Service Registry – Register – Unregister • Service is a POJO • Service Dynamism – Service tracking • Service Discovery – LDAP filter based queries 14
  • 15. Interactions between OSGi Layers Image from the OSGi R4 Core Specification 15
  • 17. OSGi benefits – a recap • Layered approach • Modularity – Enforces modularity – Ensures class-space consistency – Enables component reuse – Supports versioning and evolution • Dynamism – Bundles – Services • Ease of deployment and management – OBR • Bundle deployment order is not relevant – Faster deployment cycle 17
  • 19. Agenda • OSGi 101 <Insert Picture Here> • Basic OSGi Demo • OSGi meets Java EE – Hybrid Applications • Hybrid Application Demo • Advanced usecases • Q&A 19
  • 20. Java EE Platform of choice for enterprise applications • Widely used APIs (JPA, JTA, JAXB, JNDI) • Component Models (Servlet, EJB, JAX-RS) • Frameworks (JSF, CDI) • Ease of Use (Annotations, Convention over Configuration) • Platform provided infrastructure services (Transaction, Security, Persistence, Remoting) • Tools (IDE, Management, Monitoring) • Ubiquitous deployment platform for enterprise applications 20
  • 21. Hybrid Applications Meeting of the two worlds • OSGi + Java EE = Hybrid application • Hybrid application – An OSGi bundle – And a Java EE Archive • Leverage the capabilities of both the platforms – Enterprise applications can now be built as OSGi bundles – OSGi bundles can now use Java EE services 21
  • 22. Current State • OSGi Enterprise Expert Group (EEG) – Relased OSGi Service Platform Enterprise Specification 4.2 in 2010 • Open source efforts – Project GlassFish – Project Aries – Eclipse Gemini 22
  • 23. Enterprise OSGi Specifications • OSGi/Web Application (RFC #66) • OSGi/JPA (RFC #143) • OSGi/JDBC (RFC #122) • OSGi/JTA (RFC #98) • OSGi/JNDI (RFC #142) • OSGi/HTTP Service 23
  • 25. OSGi/Web Application (WAB) • Web Application Bundle (WAB) – WAR + OSGi metadata + Web-ContextPath header • Can use all enterprise APIs (like JPA, JTA) • Wrapped WAR support – webbundle: URL scheme 25
  • 26. OSGi/EJB Application • Allows you to develop managed, transactional, secure OSGi services with very little knowledge of OSGi • Make your existing EJB service available to OSGi clients with little effort • Achieved through simple manifest metadata – Export-EJB: ALL/None/<names of stateless local EJB> 26
  • 27. EE APIs in OSGi • OSGi/JDBC – JDBC driver as DataSourceFactory – Dynamic discovery of driver details – Multiple versions of same driver • OSGi/JTA – JTA artifacts available as OSGi Services • OSGi/JPA – Enhancement of JPA entities at runtime – Same packaging rules as JPA and also deploy entities as a bundle – Shared Persistence Unit and thereby shared second level cache 27
  • 29. Demo schematic • WAB • JPA- LAZY loading • EJB as Service • OBR • Security/Transaction Context propagation 29
  • 31. Agenda • OSGi 101 <Insert Picture Here> • Basic OSGi Demo • OSGi meets Java EE – Hybrid Applications • Hybrid Application Demo • Advanced usecases • Q&A 31
  • 32. CDI • Brings type-safe dependency injection to EE platform – Strong typing and loose coupling • Well defined life cycle of stateful objects bound to life cycle contexts • Ability to decorate and intercept injected Beans • An event notification model • An ability to develop portable extensions that integrates with the container to extend the runtime 32
  • 33. GlassFish CDI/OSGi Portable Extension • Use of CDI for type safe injection of OSGi services @WebServlet(urlPatterns = “/login”) public class FooServlet implements HttpServlet {     @Inject      @org.glassfish.osgicdi.OSGiService(           dynamic=”true”,            timeout = 200,            serviceCriteria=<an ldap query >     FooService foo; } 33
  • 35. Call To Action • Want to build hybrid applications? Come to our HOL – ID#: S313522, tomorrow at 12:00 in Plaza A of Hilton San Francisco • Want to try out? – Use GlassFish 3.1 trunk builds from http://glassfish.org • Questions? – users@glassfish.dev.java.net 35
  • 36. References • OSGi Service Platform Core and Enterprise Specification 4.2 – http://www.osgi.org • Project GlassFish – http://glassfish.org • Hybrid application samples – http://wikis.sun.com/display/GlassFish/BlogsGfOsgi 36
  • 37. Agenda • OSGi 101 <Insert Picture Here> • Basic OSGi Demo • OSGi meets Java EE – Hybrid Applications • Hybrid Application Demo • Advanced usecases • Q&A 37
  • 38. Safe Harbor Statements The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 38
  • 39. The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 39
  • 40. <Insert Picture Here> OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development {sahoo, sivakumart}@sun.com Staff Engineers, Sun Microsystems India Pvt. Ltd.
  • 41. 41