SlideShare a Scribd company logo
1 of 33
Download to read offline
1
GlassFish OSGi
From modular runtime to hybrid apps
Alexis Moussine-Pouchkine
Oracle GlassFish Team
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.
GlassFish Community
● Proven by developers
● Over 10 million downloads annually
● 50K active users in 30 days w/GlassFish Server 3
● Active user forums
● Sub-projects: Jersey, Metro, Grizzly, ...
● Application Server
● Open Source and high-quality runtime
● Java EE 5 / 6 Reference Implementation, early
access to latest standards
● Full Commercial Support from Oracle
Future of GlassFish Open Source
● No change to operation of project
● Open Source license, governance, participation,
transparency, ...
● Roadmap GlassFish Server Open Source Edition
● GlassFish Server 3.0.1 shipped in June as planned
● Two releases in 2011
● GlassFish Server 4.0 aligned with Java EE 7
● Clustering, centralized admin, Coherence, virtualization
● Details at http://glassfish.org/roadmap
Java EE
● Scalable and maintainable enterprise apps
● Container vs. Developer
● Life-cycle, resource injection, security, ...
● Portable code
● Portable skills
● Vendor independence
● Industry standard
● large developer community,
● books, training, best practices, consultants, ...
Java EE 6 (2009)
● New features
● Web profile, REST, managed beans,
standard dependency injection, validation
● Enhanced APIs
● EJB 3.1, JSF 2.0, JPA 2.0, Servlet 3.0
● More ease of use
● Optional XML, simpler packaging, extensibility
● Usable as is
● The end of the 100's MB .war
Enterprise Software
● Expectations
● Deal with complexity and age
● Ability to modify part of a (running) system
● Best Practices
● Make your system modular
● Define and document system interfaces
Enterprise Software Reality
● Java offers classpath as the only means of
dealing with dependencies
● Java EE provides a limited set of modularity
conventions
● Software versions are implicit and not enforced
●
Java public really means “public”
● When best practices aren't enough...
Started in 1999
grew from embedded to desktop to server-side
OSGi 101
● Module = “Bundle” = JAR with additional
metadata (import/export packages, ...)
● 5 states of an OSGi bundle
● INSTALLED
● RESOLVED
● STARTING
● ACTIVE
● STOPPING
Introducing GlassFish 3
Modular and Dynamic
● Modular : Apache Felix (OSGi)
● Extensible : HK2
● Yet very Fast !
Update Center
What's the deal with OSGi?
● GlassFish runs on top of OSGi (Felix by default)
● Also runs unmodified on Equinox
● GlassFish ships as 200+ bundles
● Can run without OSGi (Static mode)
● Can use OSGi management tools (CLI or Web)
● GlassFish OSGi Web Admin Console
● Can be installed on top of existing OSGi runtime
Does OSGi matter to you?
● As an enterprise app developer, should you
care about OSGi?
● Probably, yes
● OSGi Enterprise 4.2 from March 2010
What's the deal with OSGi?
● Any OSGi bundle will run in GlassFish
● Drop it in glassfish/modules{/autostart}
● Can also asadmin deploy it using --type osgi
Extending GlassFish v3
OSGi-style – an example, a demo and a picture
● OSGi declarative service
●
Service-Component
entry in the JAR Manifest
● Invoke the service from a
servlet using standard
@Resource injection
● Never use a GlassFish
API !
● No need to choose
between OSGi and
Java EE
Step by step: http://blogs.sun.com/dochez/entry/glassfish_v3_extensions_part_4
Extending GlassFish v3
SpringDM – another example, demo and picture
● Extend GlassFish with
an unmodified Spring dm
container
● Simple Spring bean
implementing the service
● Invoke the service from a
servlet using standard
@Resource injection
● Still no use of a
GlassFish API
● Single runtime for OSGi,
Spring and full Java EE
Step by step: http://blogs.sun.com/dochez/entry/glassfish_v3_extensions_part_4
Introducing Hybrid Applications
● An artifact that is both :
● A Java EE archive
● An OSGi bundle
● Requires a runtime to fully support both
standards
GlassFish & OSGi for developers
● Single, all-in-one modular runtime
● Assembled spontaneously with proper tooling
● Full Java EE 6 support
● Java EE-related OSGi services & standards
● OSGi/HTTP Service
● OSGi/JDBC (rfc #122)
● OSGi/JTA (rfc #98)
● OSGi/JPA (rfc #143)
● OSGi/JNDI (rfc #142)
● OSGi/Web Application (rfc #66)
Web Application Bundle (WAB)
OSGi/Web Application (rfc #66)
● WAR + OSGi bundle configuration
Manifest-Version: 1.0
Import-Package: javax.servlet.http; javax.persistence
Bundle-ClassPath: WEB-INF/classes/,
WEB-INF/lib/entities.jar
Bundle-Version: 1.0
Bundle-ManifestVersion: 2
Web-ContextPath: /hello
Bundle-SymbolicName: test.hellowab
● Lifecycle now can be driven by OSGi
● Wrapped WAR Support
webbundle:file:///myWebApp.war?Web-ContextPath=/hello
Required
Hello Hybrid World!
hellohybrid/UserAuthService.class
hellohybrid/impl/Activator.class
hellohybrid/impl/UserAuthServiceEJB.class
hellohybrid/impl/RegistrationServlet.class
hellohybrid/impl/LoginServlet.class
META-INF/MANIFEST.MF
Service interface
Creates DB table
After deployment
Web Tier
Service
implementation
WAB scenario
telnet localhost 6666
install file://work/hybridapp/target/hybridapp.war
start
(Web application getting deployed. Access the URL/application.)
stop
(The web app gets undeployed and URL/application are no more accessible.)
start
(It is back again)
uninstall
(The bundle gets removed from the system.)
● Java EE deployment on
RESOLVED => STARTING
● Java EE un-deployment on
STOPPING => RESOLVED
OSGi metadata
already present
Alternate WAB deployments
● With OSGi manifest
asadmin deploy --type osgi hybridapp.war
cp hybridapp.war glassfish/modules/autostart
cp hybridapp.war domains/domain1/autodeploy/bundles
● Plain WAR file
install
webbundle:file://work/webapp/target/webapp.war?
Web-ContextPath=/hello
OSGi/EJB
(GlassFish feature)
● Allow EJBs to run within OSGi context
● Easily discovered/accessed by other OSGi bundles
● Can use container managed JPA
● TX, security, persistence contexts propagated
● Automatic enlistment of EJBs as OSGi services
● Local beans only (SFSB, SLSB, Singleton)
●
Manifest entry Export-EJB: ALL|NONE
● Can split client & service into separate bundles
● OSGi ServiceTracker listens for EJB service
availability, making deployment order irrelevant
OSGi/JPA
● JPA in hybrid applications
● Support multiple JPA providers for OSGi
enterprise applications
● Standalone persistence unit in an OSGi bundle
●
Entities + persistence.xml
●
Shared PU means shared 2nd
level cache
● GlassFish 3.1 (work in progress)
OSGi JMS Producer
public class JMSActivator1 implements BundleActivator {
public void start ( BundleContext context ) {
context.registerService ( ManagedService.class.getName(),
new ManagedService() {
public void updated ( Dictionary properties ) {
sendMessage();
}
}, props );
}
private void sendMessage() {
...
Destination dest = (Destination)
ctx.lookup("jms/osgi.Topic1");
session.createProducer(dest).send(...);
....
}
}
OSGi MDB consumer
@MessageDriven(mappedName = "jms/osgi.Topic1")
public class MyMDB implements MessageListener {
public void onMessage(Message message) {
...
}
}
Summary
● GlassFish is modular (OSGi) & extensible (HK2)
● OSGi Declarative Services to extend GlassFish
● No OSGi API, no GlassFish API, Integration Nirvana!
● Available and stable in 3.0.1.
● Hybrid applications bring OSGi benefits to
JavaEE (and vice-versa)
● Reusable bundles
● Independent life-cycles
● Standard and existing application model
● GlassFish covers your Java EE and OSGi needs
Resources
● Sahoo's blog
● http://weblogs.java.net/blog/ss141213
● Jerome's blog
● http://blogs.sun.com/dochez
● GlassFish 3.1
● http://wikis.sun.com/display/GlassFish/PlanForGlassFish3.1
● http://wikis.sun.com/display/GlassFish/3.1OSGi
● http://wikis.sun.com/display/GlassFish/OsgiDashboard
● http://glassfish.org
alexis.moussine-pouchkine@oracle.com
http://blogs.sun.com/alexismp
twitter: alexismp
Questions

More Related Content

What's hot

Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011Agora Group
 
Glassfish An Introduction
Glassfish An IntroductionGlassfish An Introduction
Glassfish An IntroductionJumping Bean
 
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
 
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
 
Boston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFishBoston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFishArun Gupta
 
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 OSGi Server
GlassFish OSGi ServerGlassFish OSGi Server
GlassFish OSGi ServerArtur Alves
 
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
 
Part 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures EvolutionsPart 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures EvolutionsJasmine Conseil
 
Developing Web Application Using J2EE - Nex
Developing Web Application Using J2EE - NexDeveloping Web Application Using J2EE - Nex
Developing Web Application Using J2EE - NexNexSoftsys
 
Virgo Project Creation Review
Virgo Project Creation ReviewVirgo Project Creation Review
Virgo Project Creation Reviewglynnormington
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the CloudArun Gupta
 
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010Arun Gupta
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011Arun Gupta
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011Arun Gupta
 

What's hot (20)

Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011
 
Glassfish An Introduction
Glassfish An IntroductionGlassfish An Introduction
Glassfish An Introduction
 
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...
 
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
 
Boston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFishBoston 2011 OTN Developer Days - GlassFish
Boston 2011 OTN Developer Days - GlassFish
 
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 OSGi Server
GlassFish OSGi ServerGlassFish OSGi Server
GlassFish OSGi Server
 
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
 
Java 9 modularity
Java 9 modularityJava 9 modularity
Java 9 modularity
 
Part 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures EvolutionsPart 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
 
Web Space10 Overview
Web Space10 OverviewWeb Space10 Overview
Web Space10 Overview
 
Java modularization
Java modularizationJava modularization
Java modularization
 
Modularization in java 8
Modularization in java 8Modularization in java 8
Modularization in java 8
 
Developing Web Application Using J2EE - Nex
Developing Web Application Using J2EE - NexDeveloping Web Application Using J2EE - Nex
Developing Web Application Using J2EE - Nex
 
Virgo Project Creation Review
Virgo Project Creation ReviewVirgo Project Creation Review
Virgo Project Creation Review
 
GlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and FutureGlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and Future
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the Cloud
 
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
OSGi & Java EE in GlassFish @ Silicon Valley Code Camp 2010
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
 

Viewers also liked (11)

GlassFish Community - FISL 2010
GlassFish Community - FISL 2010GlassFish Community - FISL 2010
GlassFish Community - FISL 2010
 
Feuille de route (roadmap) GlassFish
Feuille de route (roadmap) GlassFishFeuille de route (roadmap) GlassFish
Feuille de route (roadmap) GlassFish
 
Javaee glassfish jcertif2010
Javaee glassfish jcertif2010Javaee glassfish jcertif2010
Javaee glassfish jcertif2010
 
GlassFish OSGi - From modular runtime to hybrid applications
GlassFish OSGi - From modular runtime to hybrid applicationsGlassFish OSGi - From modular runtime to hybrid applications
GlassFish OSGi - From modular runtime to hybrid applications
 
Java EE 6
Java EE 6Java EE 6
Java EE 6
 
Manual de carrera_magisterial_2011[1]
Manual de carrera_magisterial_2011[1]Manual de carrera_magisterial_2011[1]
Manual de carrera_magisterial_2011[1]
 
Open Solaris 2009.06
Open Solaris 2009.06Open Solaris 2009.06
Open Solaris 2009.06
 
GlassFish v2.1
GlassFish v2.1GlassFish v2.1
GlassFish v2.1
 
Behind The Clouds
Behind The CloudsBehind The Clouds
Behind The Clouds
 
Zembly
ZemblyZembly
Zembly
 
Niko Nelissen - Sun Microsystems - Keynote 'What's next in the Cloud?' CloudC...
Niko Nelissen - Sun Microsystems - Keynote 'What's next in the Cloud?' CloudC...Niko Nelissen - Sun Microsystems - Keynote 'What's next in the Cloud?' CloudC...
Niko Nelissen - Sun Microsystems - Keynote 'What's next in the Cloud?' CloudC...
 

Similar to GlassFish OSGi - Java2days 2010

Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010JUG Lausanne
 
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: 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
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in PractiseDavid Bosschaert
 
Modular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafModular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafIoan Eugen Stan
 
OSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P KriensOSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P Kriensmfrancis
 
GDG Algiers DevFest 2013 Cool AndroidLibs
GDG Algiers DevFest 2013 Cool AndroidLibsGDG Algiers DevFest 2013 Cool AndroidLibs
GDG Algiers DevFest 2013 Cool AndroidLibsnhachicha
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Nuxeo
 
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
 
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
 
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015 Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015 Mariano Gonzalez
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.Elian, I.
 
Bootify Yyour App from Zero to Hero
Bootify Yyour App from Zero to HeroBootify Yyour App from Zero to Hero
Bootify Yyour App from Zero to HeroEPAM
 
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
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)David Bosschaert
 
OW2 JOnAS 5.0 Java EE AS- An OSGi Based Integration Platform - François Forna...
OW2 JOnAS 5.0 Java EE AS- An OSGi Based Integration Platform - François Forna...OW2 JOnAS 5.0 Java EE AS- An OSGi Based Integration Platform - François Forna...
OW2 JOnAS 5.0 Java EE AS- An OSGi Based Integration Platform - François Forna...mfrancis
 

Similar to GlassFish OSGi - Java2days 2010 (20)

Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
 
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: 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
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
Modular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafModular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache Karaf
 
OSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P KriensOSGi enRoute Unveiled - P Kriens
OSGi enRoute Unveiled - P Kriens
 
GDG Algiers DevFest 2013 Cool AndroidLibs
GDG Algiers DevFest 2013 Cool AndroidLibsGDG Algiers DevFest 2013 Cool AndroidLibs
GDG Algiers DevFest 2013 Cool AndroidLibs
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
 
OSGi
OSGiOSGi
OSGi
 
Enterprise GlassFish
Enterprise GlassFishEnterprise GlassFish
Enterprise GlassFish
 
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
 
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
 
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015 Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.
 
Bootify Yyour App from Zero to Hero
Bootify Yyour App from Zero to HeroBootify Yyour App from Zero to Hero
Bootify Yyour App from Zero to Hero
 
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
 
Carbon and OSGi Deep Dive
Carbon and OSGi Deep DiveCarbon and OSGi Deep Dive
Carbon and OSGi Deep Dive
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
 
OW2 JOnAS 5.0 Java EE AS- An OSGi Based Integration Platform - François Forna...
OW2 JOnAS 5.0 Java EE AS- An OSGi Based Integration Platform - François Forna...OW2 JOnAS 5.0 Java EE AS- An OSGi Based Integration Platform - François Forna...
OW2 JOnAS 5.0 Java EE AS- An OSGi Based Integration Platform - François Forna...
 

More from Alexis Moussine-Pouchkine (18)

Java EE 6 Solutions Linux 2010
Java EE 6 Solutions Linux 2010Java EE 6 Solutions Linux 2010
Java EE 6 Solutions Linux 2010
 
GlassFish v3 at JavaZone 09
GlassFish v3 at JavaZone 09GlassFish v3 at JavaZone 09
GlassFish v3 at JavaZone 09
 
L'association GUSES
L'association GUSESL'association GUSES
L'association GUSES
 
Java EE 6 and GlassFish portfolio
Java EE 6 and GlassFish portfolioJava EE 6 and GlassFish portfolio
Java EE 6 and GlassFish portfolio
 
Metro Web Services
Metro Web ServicesMetro Web Services
Metro Web Services
 
Retour JavaOne 2009
Retour JavaOne 2009Retour JavaOne 2009
Retour JavaOne 2009
 
Retour d'expérience Cap Gemini GlassFish
Retour d'expérience Cap Gemini GlassFishRetour d'expérience Cap Gemini GlassFish
Retour d'expérience Cap Gemini GlassFish
 
OpenDS - Open Source Java LDAP server
OpenDS - Open Source Java LDAP serverOpenDS - Open Source Java LDAP server
OpenDS - Open Source Java LDAP server
 
Open MQ Jerome Moliere
Open MQ Jerome MoliereOpen MQ Jerome Moliere
Open MQ Jerome Moliere
 
GlassFish v3 : En Route Java EE 6
GlassFish v3 : En Route Java EE 6GlassFish v3 : En Route Java EE 6
GlassFish v3 : En Route Java EE 6
 
OpenMQ François Ostyn
OpenMQ François OstynOpenMQ François Ostyn
OpenMQ François Ostyn
 
OpenSSO Microsoft Interop
OpenSSO Microsoft InteropOpenSSO Microsoft Interop
OpenSSO Microsoft Interop
 
MySQL HA Solutions
MySQL HA SolutionsMySQL HA Solutions
MySQL HA Solutions
 
Intro Aquarium Paris Printemps 2009
Intro Aquarium Paris Printemps 2009Intro Aquarium Paris Printemps 2009
Intro Aquarium Paris Printemps 2009
 
OpenDS Aquarium Paris
OpenDS Aquarium ParisOpenDS Aquarium Paris
OpenDS Aquarium Paris
 
OpenSSO Aquarium Paris
OpenSSO Aquarium ParisOpenSSO Aquarium Paris
OpenSSO Aquarium Paris
 
Java FX Tools Aquarium Paris
Java FX Tools Aquarium ParisJava FX Tools Aquarium Paris
Java FX Tools Aquarium Paris
 
SFR RED Aquarium Paris
SFR RED Aquarium ParisSFR RED Aquarium Paris
SFR RED Aquarium Paris
 

Recently uploaded

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
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
 

Recently uploaded (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
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
 

GlassFish OSGi - Java2days 2010

  • 1. 1 GlassFish OSGi From modular runtime to hybrid apps Alexis Moussine-Pouchkine Oracle GlassFish Team
  • 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.
  • 3. GlassFish Community ● Proven by developers ● Over 10 million downloads annually ● 50K active users in 30 days w/GlassFish Server 3 ● Active user forums ● Sub-projects: Jersey, Metro, Grizzly, ... ● Application Server ● Open Source and high-quality runtime ● Java EE 5 / 6 Reference Implementation, early access to latest standards ● Full Commercial Support from Oracle
  • 4. Future of GlassFish Open Source ● No change to operation of project ● Open Source license, governance, participation, transparency, ... ● Roadmap GlassFish Server Open Source Edition ● GlassFish Server 3.0.1 shipped in June as planned ● Two releases in 2011 ● GlassFish Server 4.0 aligned with Java EE 7 ● Clustering, centralized admin, Coherence, virtualization ● Details at http://glassfish.org/roadmap
  • 5. Java EE ● Scalable and maintainable enterprise apps ● Container vs. Developer ● Life-cycle, resource injection, security, ... ● Portable code ● Portable skills ● Vendor independence ● Industry standard ● large developer community, ● books, training, best practices, consultants, ...
  • 6. Java EE 6 (2009) ● New features ● Web profile, REST, managed beans, standard dependency injection, validation ● Enhanced APIs ● EJB 3.1, JSF 2.0, JPA 2.0, Servlet 3.0 ● More ease of use ● Optional XML, simpler packaging, extensibility ● Usable as is ● The end of the 100's MB .war
  • 7. Enterprise Software ● Expectations ● Deal with complexity and age ● Ability to modify part of a (running) system ● Best Practices ● Make your system modular ● Define and document system interfaces
  • 8. Enterprise Software Reality ● Java offers classpath as the only means of dealing with dependencies ● Java EE provides a limited set of modularity conventions ● Software versions are implicit and not enforced ● Java public really means “public” ● When best practices aren't enough...
  • 9. Started in 1999 grew from embedded to desktop to server-side
  • 10. OSGi 101 ● Module = “Bundle” = JAR with additional metadata (import/export packages, ...) ● 5 states of an OSGi bundle ● INSTALLED ● RESOLVED ● STARTING ● ACTIVE ● STOPPING
  • 12. Modular and Dynamic ● Modular : Apache Felix (OSGi) ● Extensible : HK2 ● Yet very Fast !
  • 13.
  • 15. What's the deal with OSGi? ● GlassFish runs on top of OSGi (Felix by default) ● Also runs unmodified on Equinox ● GlassFish ships as 200+ bundles ● Can run without OSGi (Static mode) ● Can use OSGi management tools (CLI or Web) ● GlassFish OSGi Web Admin Console ● Can be installed on top of existing OSGi runtime
  • 16.
  • 17. Does OSGi matter to you? ● As an enterprise app developer, should you care about OSGi? ● Probably, yes ● OSGi Enterprise 4.2 from March 2010
  • 18. What's the deal with OSGi? ● Any OSGi bundle will run in GlassFish ● Drop it in glassfish/modules{/autostart} ● Can also asadmin deploy it using --type osgi
  • 19. Extending GlassFish v3 OSGi-style – an example, a demo and a picture ● OSGi declarative service ● Service-Component entry in the JAR Manifest ● Invoke the service from a servlet using standard @Resource injection ● Never use a GlassFish API ! ● No need to choose between OSGi and Java EE Step by step: http://blogs.sun.com/dochez/entry/glassfish_v3_extensions_part_4
  • 20. Extending GlassFish v3 SpringDM – another example, demo and picture ● Extend GlassFish with an unmodified Spring dm container ● Simple Spring bean implementing the service ● Invoke the service from a servlet using standard @Resource injection ● Still no use of a GlassFish API ● Single runtime for OSGi, Spring and full Java EE Step by step: http://blogs.sun.com/dochez/entry/glassfish_v3_extensions_part_4
  • 21. Introducing Hybrid Applications ● An artifact that is both : ● A Java EE archive ● An OSGi bundle ● Requires a runtime to fully support both standards
  • 22. GlassFish & OSGi for developers ● Single, all-in-one modular runtime ● Assembled spontaneously with proper tooling ● Full Java EE 6 support ● Java EE-related OSGi services & standards ● OSGi/HTTP Service ● OSGi/JDBC (rfc #122) ● OSGi/JTA (rfc #98) ● OSGi/JPA (rfc #143) ● OSGi/JNDI (rfc #142) ● OSGi/Web Application (rfc #66)
  • 23. Web Application Bundle (WAB) OSGi/Web Application (rfc #66) ● WAR + OSGi bundle configuration Manifest-Version: 1.0 Import-Package: javax.servlet.http; javax.persistence Bundle-ClassPath: WEB-INF/classes/, WEB-INF/lib/entities.jar Bundle-Version: 1.0 Bundle-ManifestVersion: 2 Web-ContextPath: /hello Bundle-SymbolicName: test.hellowab ● Lifecycle now can be driven by OSGi ● Wrapped WAR Support webbundle:file:///myWebApp.war?Web-ContextPath=/hello Required
  • 25. WAB scenario telnet localhost 6666 install file://work/hybridapp/target/hybridapp.war start (Web application getting deployed. Access the URL/application.) stop (The web app gets undeployed and URL/application are no more accessible.) start (It is back again) uninstall (The bundle gets removed from the system.) ● Java EE deployment on RESOLVED => STARTING ● Java EE un-deployment on STOPPING => RESOLVED OSGi metadata already present
  • 26. Alternate WAB deployments ● With OSGi manifest asadmin deploy --type osgi hybridapp.war cp hybridapp.war glassfish/modules/autostart cp hybridapp.war domains/domain1/autodeploy/bundles ● Plain WAR file install webbundle:file://work/webapp/target/webapp.war? Web-ContextPath=/hello
  • 27. OSGi/EJB (GlassFish feature) ● Allow EJBs to run within OSGi context ● Easily discovered/accessed by other OSGi bundles ● Can use container managed JPA ● TX, security, persistence contexts propagated ● Automatic enlistment of EJBs as OSGi services ● Local beans only (SFSB, SLSB, Singleton) ● Manifest entry Export-EJB: ALL|NONE ● Can split client & service into separate bundles ● OSGi ServiceTracker listens for EJB service availability, making deployment order irrelevant
  • 28. OSGi/JPA ● JPA in hybrid applications ● Support multiple JPA providers for OSGi enterprise applications ● Standalone persistence unit in an OSGi bundle ● Entities + persistence.xml ● Shared PU means shared 2nd level cache ● GlassFish 3.1 (work in progress)
  • 29. OSGi JMS Producer public class JMSActivator1 implements BundleActivator { public void start ( BundleContext context ) { context.registerService ( ManagedService.class.getName(), new ManagedService() { public void updated ( Dictionary properties ) { sendMessage(); } }, props ); } private void sendMessage() { ... Destination dest = (Destination) ctx.lookup("jms/osgi.Topic1"); session.createProducer(dest).send(...); .... } }
  • 30. OSGi MDB consumer @MessageDriven(mappedName = "jms/osgi.Topic1") public class MyMDB implements MessageListener { public void onMessage(Message message) { ... } }
  • 31. Summary ● GlassFish is modular (OSGi) & extensible (HK2) ● OSGi Declarative Services to extend GlassFish ● No OSGi API, no GlassFish API, Integration Nirvana! ● Available and stable in 3.0.1. ● Hybrid applications bring OSGi benefits to JavaEE (and vice-versa) ● Reusable bundles ● Independent life-cycles ● Standard and existing application model ● GlassFish covers your Java EE and OSGi needs
  • 32. Resources ● Sahoo's blog ● http://weblogs.java.net/blog/ss141213 ● Jerome's blog ● http://blogs.sun.com/dochez ● GlassFish 3.1 ● http://wikis.sun.com/display/GlassFish/PlanForGlassFish3.1 ● http://wikis.sun.com/display/GlassFish/3.1OSGi ● http://wikis.sun.com/display/GlassFish/OsgiDashboard ● http://glassfish.org