SlideShare uma empresa Scribd logo
1 de 41
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

Mais conteúdo relacionado

Mais procurados

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 Zelzermfrancis
 
OSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishOSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishSanjeeb Sahoo
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGiIlya 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 NodetNormandy 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 GlassFishArun Gupta
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Azilen Technologies Pvt. Ltd.
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneidermfrancis
 
GlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixGlassFish v3, OSGi Equinox Felix
GlassFish v3, OSGi Equinox FelixLudovic 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 worldsArun Gupta
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applicationsJulien 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 OSGiMathieu Ancelin
 

Mais procurados (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
 

Semelhante a OSGi Java EE Hybrid Apps

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 IndiaArun Gupta
 
OSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon KaegiOSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon Kaegimfrancis
 
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 - Enterprisemfrancis
 
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 FelixMarcel Offermans
 
OTN Developer Days - GlassFish
OTN Developer Days - GlassFishOTN Developer Days - GlassFish
OTN Developer Days - GlassFishglassfish
 
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 PlatformNuxeo
 
Eclipse Apricot
Eclipse ApricotEclipse Apricot
Eclipse ApricotNuxeo
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011Arun Gupta
 
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
 
OSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P KriensOSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P Kriensmfrancis
 
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 WorldForgeRock
 
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 2011Nuxeo
 

Semelhante a OSGi Java EE Hybrid Apps (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 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011
 
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
 
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
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

OSGi Java EE Hybrid Apps

  • 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