SlideShare a Scribd company logo
1 of 38
Download to read offline
1
<Insert Picture Here>
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application
Development
Sanjeeb Sahoo
Staff Engineer, Sun Microsystems India Pvt. Ltd.
2
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.
Safe Harbor Statements
3
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.
4
<Insert Picture Here>
Agenda
• OSGi 101
• OSGi meets Java EE – Hybrid Applications
• Advanced usecases
• Hybrid Application Demo
• Q & A
5
<Insert Picture Here>
Agenda
• OSGi 101
• OSGi meets Java EE – Hybrid Applications
• Advanced usecases
• Hybrid Application Demo
• 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
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
OSGi Metadata
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
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
16
OSGi meets Java EE
17
<Insert Picture Here>
Agenda
• OSGi 101
• OSGi meets Java EE – Hybrid Applications
• Advanced usecases
• Hybrid Application Demo
• Q & A
18
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
19
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 modular OSGi bundles
• use OBR, Config Admin, service tracking, etc.
– OSGi bundles can now use Java EE services like JTA, JPA,
etc.
20
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
21
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
22
Bundle-SymbolicName: com.acme.hellowab
Bundle-Name: Hello World OSGi Web Application
Bundle-Version: 1.0.0
Bundle-ManifestVersion: 2
Bundle-Activator: com.acme.hellowab.MyActivator
Import-Package: javax.servlet; javax.servlet.http; version=3.0,
org.osgi.framework; version=1.5
Bundle-ClassPath: WEB-INF/classes, WEB-INF/lib/foo.jar
Web-ContextPath: /hello
OSGi Metadata of a WAB
23
Hybrid application bundle lifecycle
24
Enterprise OSGi Specifications
• OSGi/Web Application
• OSGi/JPA
• OSGi/JDBC
• OSGi/JTA
• OSGi/JNDI
• OSGi/HTTP Service
• OSGi Blueprint Service
25
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
26
Tools
• BND (http://www.aqute.biz/Code/Bnd)
– de-facto tool for OSGi metadata generation
– maven-bundle-plugin
– Ant task
• IDE
– Eclipse
– NetBeans
– IntelliJ IDEA
27
Advanced Usecases
28
<Insert Picture Here>
Agenda
• OSGi 101
• OSGi meets Java EE – Hybrid Applications
• Advanced usecases
• Hybrid Application Demo
• Q & A
29
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>
30
Bundle-SymbolicName: com.acme.helloEjbOsgi
Bundle-Name: Hello World OSGi EJB Bundle
Bundle-Version: 1.0.0
Bundle-ManifestVersion: 2
Import-Package: javax.ejb; version=3.0,
Export-EJB: ALL
OSGi Metadata of an OSGi/EJB bundle
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: Putting them
together
34
Demo schematic
• WAB
• JPA- LAZY loading
• EJB as Service
• OSGi Service Injection
• OBR
• Security/Transaction
Context propagation
Simple
OSGi
Bundle
OSGi
Service
Simple
OSGi
Service
EJB
OSGi
Service
Advanced
WAB
Simple
WAB
35
Call To Action
• Want to build hybrid applications?
– Try our tutorial at http://tinyurl.com/osgieehol
• Want to try out?
– Use GlassFish 3.1 trunk builds from http://glassfish.org
• Questions?
– users@glassfish.dev.java.net
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
37
<Insert Picture Here>
Agenda
• OSGi 101
• OSGi meets Java EE – Hybrid Applications
• Advanced usecases
• Hybrid Application Demo
• Q & A
38
<Insert Picture Here>
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application
Development
Sanjeeb Sahoo
Staff Engineer, Sun Microsystems India Pvt. Ltd.

More Related Content

What's hot

Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesJan S. Rellermeyer
 
Boston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFishBoston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFishArun Gupta
 
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...Arun Gupta
 
OTN Developer Days - GlassFish
OTN Developer Days - GlassFishOTN Developer Days - GlassFish
OTN Developer Days - GlassFishglassfish
 
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
 
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
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudBruno Borges
 
What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)Pavel Bucek
 
µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015Izzet Mustafaiev
 
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...Paul Withers
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applicationsJulien Dubois
 
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011Arun Gupta
 
Migrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXMigrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXBruno Borges
 
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemBruno Borges
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009Roland Tritsch
 
µServices for the rest of us - karl pauls
µServices for the rest of us - karl paulsµServices for the rest of us - karl pauls
µServices for the rest of us - karl paulsmfrancis
 
Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3Nuxeo
 

What's hot (20)

Concierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded DevicesConcierge - Bringing OSGi (back) to Embedded Devices
Concierge - Bringing OSGi (back) to Embedded Devices
 
Boston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFishBoston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFish
 
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
GlassFish 3.1 – Simplifying your Java EE 6 Development and Deployment @ JAX L...
 
OTN Developer Days - GlassFish
OTN Developer Days - GlassFishOTN Developer Days - GlassFish
OTN Developer Days - GlassFish
 
GlassFish Community and future larochelle
GlassFish Community and future larochelleGlassFish Community and future larochelle
GlassFish Community and future larochelle
 
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
 
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
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The Cloud
 
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško VukmanovićJavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
 
What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)
 
µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015
 
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
Deploying Java EE 6 Apps in a Cluster: GlassFish 3.1 at Dallas Tech Fest 2011
 
Migrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXMigrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFX
 
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009
 
µServices for the rest of us - karl pauls
µServices for the rest of us - karl paulsµServices for the rest of us - karl pauls
µServices for the rest of us - karl pauls
 
Modular Java
Modular JavaModular Java
Modular Java
 
Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3
 

Viewers also liked

Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...Yuji Kosuga
 
Java, app servers and oracle application grid
Java, app servers and oracle application gridJava, app servers and oracle application grid
Java, app servers and oracle application gridAlicja Sieminska
 
Structuring software systems with OSGi - Ulf Fildebrandt
Structuring software systems with OSGi - Ulf FildebrandtStructuring software systems with OSGi - Ulf Fildebrandt
Structuring software systems with OSGi - Ulf Fildebrandtmfrancis
 
Microsoft Sharepoint and Java Application Development
Microsoft Sharepoint and Java Application DevelopmentMicrosoft Sharepoint and Java Application Development
Microsoft Sharepoint and Java Application DevelopmentDavid Nuescheler
 
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Quek Lilian
 
Scalable Java Application Development on AWS
Scalable Java Application Development on AWSScalable Java Application Development on AWS
Scalable Java Application Development on AWSMikalai Alimenkou
 
Web Applications and Deployment
Web Applications and DeploymentWeb Applications and Deployment
Web Applications and DeploymentBG Java EE Course
 

Viewers also liked (8)

Open
OpenOpen
Open
 
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Inje...
 
Java, app servers and oracle application grid
Java, app servers and oracle application gridJava, app servers and oracle application grid
Java, app servers and oracle application grid
 
Structuring software systems with OSGi - Ulf Fildebrandt
Structuring software systems with OSGi - Ulf FildebrandtStructuring software systems with OSGi - Ulf Fildebrandt
Structuring software systems with OSGi - Ulf Fildebrandt
 
Microsoft Sharepoint and Java Application Development
Microsoft Sharepoint and Java Application DevelopmentMicrosoft Sharepoint and Java Application Development
Microsoft Sharepoint and Java Application Development
 
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
 
Scalable Java Application Development on AWS
Scalable Java Application Development on AWSScalable Java Application Development on AWS
Scalable Java Application Development on AWS
 
Web Applications and Deployment
Web Applications and DeploymentWeb Applications and Deployment
Web Applications and Deployment
 

Similar to OSGi & Java EE: A hybrid approach to Enterprise Java Application Development, Sahoo

OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentSanjeeb Sahoo
 
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 User Forum US DC Metro
OSGi User Forum US DC MetroOSGi User Forum US DC Metro
OSGi User Forum US DC MetropjhInovex
 
OSGi user forum dc metro v1
OSGi user forum dc metro v1OSGi user forum dc metro v1
OSGi user forum dc metro v1pjhInovex
 
Introduction to OSGGi
Introduction to OSGGiIntroduction to OSGGi
Introduction to OSGGiMarek Koniew
 
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
 
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
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Martin Toshev
 
IBM Impact session CICS & java a tale of liberty
IBM Impact session CICS & java a tale of libertyIBM Impact session CICS & java a tale of liberty
IBM Impact session CICS & java a tale of libertynick_garrod
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBayTony Ng
 
WebLogic Event Server - Alexandre Alves, BEA
WebLogic Event Server - Alexandre Alves, BEAWebLogic Event Server - Alexandre Alves, BEA
WebLogic Event Server - Alexandre Alves, BEAmfrancis
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in developmentMartin Toshev
 
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...IndicThreads
 

Similar to OSGi & Java EE: A hybrid approach to Enterprise Java Application Development, Sahoo (20)

OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and 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
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
OSGi User Forum US DC Metro
OSGi User Forum US DC MetroOSGi User Forum US DC Metro
OSGi User Forum US DC Metro
 
OSGi user forum dc metro v1
OSGi user forum dc metro v1OSGi user forum dc metro v1
OSGi user forum dc metro v1
 
Introduction to OSGGi
Introduction to OSGGiIntroduction to OSGGi
Introduction to OSGGi
 
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
 
OSGi introduction
OSGi introductionOSGi introduction
OSGi introduction
 
OSGi
OSGiOSGi
OSGi
 
De leukste Bug
De leukste BugDe leukste Bug
De leukste Bug
 
Hybrid Applications
Hybrid ApplicationsHybrid Applications
Hybrid Applications
 
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
 
Osgi platform
Osgi platformOsgi platform
Osgi platform
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
 
Osgi
OsgiOsgi
Osgi
 
IBM Impact session CICS & java a tale of liberty
IBM Impact session CICS & java a tale of libertyIBM Impact session CICS & java a tale of liberty
IBM Impact session CICS & java a tale of liberty
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBay
 
WebLogic Event Server - Alexandre Alves, BEA
WebLogic Event Server - Alexandre Alves, BEAWebLogic Event Server - Alexandre Alves, BEA
WebLogic Event Server - Alexandre Alves, BEA
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in development
 
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
 

More from OpenBlend society

Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)OpenBlend society
 
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)OpenBlend society
 
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)OpenBlend society
 
National Reference runtime environment, Boris Šaletić (MJU)
National Reference runtime environment, Boris Šaletić (MJU)National Reference runtime environment, Boris Šaletić (MJU)
National Reference runtime environment, Boris Šaletić (MJU)OpenBlend society
 
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)OpenBlend society
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...OpenBlend society
 
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)OpenBlend society
 
How to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de WolfHow to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de WolfOpenBlend society
 
Enterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha LaboureyEnterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha LaboureyOpenBlend society
 
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure PolutnikTackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure PolutnikOpenBlend society
 
Android Up Close, Martin Sonc
Android Up Close, Martin SoncAndroid Up Close, Martin Sonc
Android Up Close, Martin SoncOpenBlend society
 
Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...OpenBlend society
 
Becoming an Open Source developer, Dimitris Andreadis
Becoming an Open Source developer, Dimitris AndreadisBecoming an Open Source developer, Dimitris Andreadis
Becoming an Open Source developer, Dimitris AndreadisOpenBlend society
 

More from OpenBlend society (13)

Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
 
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
SOA architecture patterns, Matjaž Jurič (FRI/Univerza v Ljubljani)
 
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
 
National Reference runtime environment, Boris Šaletić (MJU)
National Reference runtime environment, Boris Šaletić (MJU)National Reference runtime environment, Boris Šaletić (MJU)
National Reference runtime environment, Boris Šaletić (MJU)
 
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
 
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
 
How to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de WolfHow to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de Wolf
 
Enterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha LaboureyEnterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha Labourey
 
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure PolutnikTackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
 
Android Up Close, Martin Sonc
Android Up Close, Martin SoncAndroid Up Close, Martin Sonc
Android Up Close, Martin Sonc
 
Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...
 
Becoming an Open Source developer, Dimitris Andreadis
Becoming an Open Source developer, Dimitris AndreadisBecoming an Open Source developer, Dimitris Andreadis
Becoming an Open Source developer, Dimitris Andreadis
 

Recently uploaded

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

OSGi & Java EE: A hybrid approach to Enterprise Java Application Development, Sahoo

  • 1. 1 <Insert Picture Here> OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development Sanjeeb Sahoo Staff Engineer, Sun Microsystems India Pvt. Ltd.
  • 2. 2 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. Safe Harbor Statements
  • 3. 3 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.
  • 4. 4 <Insert Picture Here> Agenda • OSGi 101 • OSGi meets Java EE – Hybrid Applications • Advanced usecases • Hybrid Application Demo • Q & A
  • 5. 5 <Insert Picture Here> Agenda • OSGi 101 • OSGi meets Java EE – Hybrid Applications • Advanced usecases • Hybrid Application Demo • Q & A
  • 8. 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. 9 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 OSGi Metadata
  • 10. 10 Classloading in OSGi Image from the OSGi R4 Core Specification
  • 11. 11 Lifecycle Layer • Provides an API to manage bundles – BundleContext.install – BundleContext.uninstall – Bundle.update • BundleActivator • BundleListener – listen to BundleEvents – Synchronous – Asynchronous
  • 12. 12 Bundle Lifecycle Image from the OSGi R4 Core Specification
  • 13. 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. 14 Interactions between OSGi Layers Image from the OSGi R4 Core Specification
  • 15. 15 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. 17 <Insert Picture Here> Agenda • OSGi 101 • OSGi meets Java EE – Hybrid Applications • Advanced usecases • Hybrid Application Demo • Q & A
  • 18. 18 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
  • 19. 19 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 modular OSGi bundles • use OBR, Config Admin, service tracking, etc. – OSGi bundles can now use Java EE services like JTA, JPA, etc.
  • 20. 20 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
  • 21. 21 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
  • 22. 22 Bundle-SymbolicName: com.acme.hellowab Bundle-Name: Hello World OSGi Web Application Bundle-Version: 1.0.0 Bundle-ManifestVersion: 2 Bundle-Activator: com.acme.hellowab.MyActivator Import-Package: javax.servlet; javax.servlet.http; version=3.0, org.osgi.framework; version=1.5 Bundle-ClassPath: WEB-INF/classes, WEB-INF/lib/foo.jar Web-ContextPath: /hello OSGi Metadata of a WAB
  • 24. 24 Enterprise OSGi Specifications • OSGi/Web Application • OSGi/JPA • OSGi/JDBC • OSGi/JTA • OSGi/JNDI • OSGi/HTTP Service • OSGi Blueprint Service
  • 25. 25 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
  • 26. 26 Tools • BND (http://www.aqute.biz/Code/Bnd) – de-facto tool for OSGi metadata generation – maven-bundle-plugin – Ant task • IDE – Eclipse – NetBeans – IntelliJ IDEA
  • 28. 28 <Insert Picture Here> Agenda • OSGi 101 • OSGi meets Java EE – Hybrid Applications • Advanced usecases • Hybrid Application Demo • Q & A
  • 29. 29 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>
  • 30. 30 Bundle-SymbolicName: com.acme.helloEjbOsgi Bundle-Name: Hello World OSGi EJB Bundle Bundle-Version: 1.0.0 Bundle-ManifestVersion: 2 Import-Package: javax.ejb; version=3.0, Export-EJB: ALL OSGi Metadata of an OSGi/EJB bundle
  • 31. 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. 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; }
  • 34. 34 Demo schematic • WAB • JPA- LAZY loading • EJB as Service • OSGi Service Injection • OBR • Security/Transaction Context propagation Simple OSGi Bundle OSGi Service Simple OSGi Service EJB OSGi Service Advanced WAB Simple WAB
  • 35. 35 Call To Action • Want to build hybrid applications? – Try our tutorial at http://tinyurl.com/osgieehol • Want to try out? – Use GlassFish 3.1 trunk builds from http://glassfish.org • Questions? – users@glassfish.dev.java.net
  • 36. 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
  • 37. 37 <Insert Picture Here> Agenda • OSGi 101 • OSGi meets Java EE – Hybrid Applications • Advanced usecases • Hybrid Application Demo • Q & A
  • 38. 38 <Insert Picture Here> OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development Sanjeeb Sahoo Staff Engineer, Sun Microsystems India Pvt. Ltd.