GlassFish V3 & OSGi

 Jerome Dochez and Ludovic Champenois
●


 GlassFish team
●Sun Microsystems, Inc.




               ...
Introduction
 • GlassFish, an Open Source application server
   built on and with Open Source components :
   > Maven 2
  ...
What's new in V3
 • Modularity
   > platform growth
   > choice of technologies rapidly evolving
   > based on industry st...
Modularity in V3
• Modules are great but let's face it, they do nothing just
  being modules !
  > A good service based ar...
Modularity
 • Kernel
   > startup/shutdown sequences
   > basic services (deployment)
   > configuration reading
 • Servic...
OSGi R4 Runtime

                                               S
                                    Services
           ...
HK2 Module Management Runtime


                                    Services
     Applications
                           ...
HK2 and OSGi
• Use OSGi as the underlying module management
  > capable of consuming any OSGi modules
  > all GlassFish V3...
Module Management
                4. return class loader


1. loadModule
                     HK2 Services

              ...
Services
• GlassFish V3 use extensively Services to identify
  extension points like :
  > Application Containers (like We...
GlassFish V3 Runtime with OSGi

  GlassFish V3 modules
                                        Random OSGi Bundle
 (OSGi +...
HK2 Service

 • Interfaces are declared with @Contract
 • Implementations are declared with @Service
 • Build system will ...
Runtime
• Kernel
  > startup/shutdown sequences
  > basic services (deployment)
  > configuration reading
• Services
  > C...
Runtime

                                             Security      Config
                JRuby/Rails

                 W...
OnDemand and Extensible
• Pay As you Go
  > containers are started when applications are deployed to
    them
  > startup ...
GlassFish containers
• Basic Functionalities
  > handles certain application types
  > started and stopped on demand
• Opt...
Container Pluggability
                                                Console user
domain.xml
                     Centra...
OSGi integration
• Module management
  > Add, remove, update installed modules
• OSGi as a container !
  > Treat OSGi just...
Upcoming SlideShare
Loading in...5
×

GlassFish v3, OSGi Equinox Felix

5,263

Published on

GlassFish v3: Java EE 6 OSGi and Eclipse Tooling

Published in: Technology, Education
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,263
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
166
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

GlassFish v3, OSGi Equinox Felix

  1. 1. GlassFish V3 & OSGi Jerome Dochez and Ludovic Champenois ● GlassFish team ●Sun Microsystems, Inc. 1
  2. 2. Introduction • GlassFish, an Open Source application server built on and with Open Source components : > Maven 2 – build system – module description > Felix – OSGi module management > Eclipse Link – Java Persistence Architecture implementation • V3 is the third open source release of GlassFish 2
  3. 3. What's new in V3 • Modularity > platform growth > choice of technologies rapidly evolving > based on industry standard OSGi runtime • Extensible and Embeddable > not limited to traditional Java EE containers > can run in any java or native host process • Service based architecture > services are defined by contracts and can be easily substituted > lazy loading based on usage patterns 3
  4. 4. Modularity in V3 • Modules are great but let's face it, they do nothing just being modules ! > A good service based architecture is what you need. • V3 innovation : > One of the few OSGi enabled application that is completely portable to any OSGi R4 compliant runtime > allow any type of container to be plugged in. > start all containers and services on demand yielding an unmatched startup time for a Java EE server. > focus on developer (keeping the already numerous deployer's features). 4
  5. 5. Modularity • Kernel > startup/shutdown sequences > basic services (deployment) > configuration reading • Services > Cross containers functionalities – Security, Naming Manager... – Admin Console • Containers > handle user's applications > independent of each others 5
  6. 6. OSGi R4 Runtime S Services e c Applications Life Cycle u (Bundles) r i Module t y JDK OS + Hardware 6
  7. 7. HK2 Module Management Runtime Services Applications Life Cycle (Bundles) Module Bundles Repository JDK OS + Hardware 7
  8. 8. HK2 and OSGi • Use OSGi as the underlying module management > capable of consuming any OSGi modules > all GlassFish V3 modules are OSGi modules • HK2 Provides runtime services on top of OSGi : Repository management > Isolation from OSGi APIs or implementation > Services definition and lookup > MBeans support > Configuration facilities > • HK2 is a separate Open Source project 8
  9. 9. Module Management 4. return class loader 1. loadModule HK2 Services OSGi 2.Get 3.Install Runtime Repository Repository Repository 9
  10. 10. Services • GlassFish V3 use extensively Services to identify extension points like : > Application Containers (like Web-App, Jruby, Spring) > Administrative Commands • Services are : > implementing an interface – Java SE style with a META-INF/services file – OSGi style – HK2 • Can be stateless or statefull 10
  11. 11. GlassFish V3 Runtime with OSGi GlassFish V3 modules Random OSGi Bundle (OSGi + extra metadata) Service OSGi HK2 Service layer Mapper Service Layer OSGi Bundle management 11
  12. 12. HK2 Service • Interfaces are declared with @Contract • Implementations are declared with @Service • Build system will generate Metadata automatically @Contract public interface Startup {...} @Service public class ConfigService implements Startup { ... } 12
  13. 13. Runtime • Kernel > startup/shutdown sequences > basic services (deployment) > configuration reading • Services > Cross containers functionalities – Security, Naming Manager... – Admin Console • Containers > handle user's applications > independent of each others 13
  14. 14. Runtime Security Config JRuby/Rails Web Naming Injection dispatch GlassFish Kernel browser requests Grizzly HK2 Services OSGi Runtime Bundles repositories services 14
  15. 15. OnDemand and Extensible • Pay As you Go > containers are started when applications are deployed to them > startup time is under 2 seconds • Extensible > Containers (scripting containers) > Administration – Admin Commands – Configuration – Admin GUI through plugin 15
  16. 16. GlassFish containers • Basic Functionalities > handles certain application types > started and stopped on demand • Optional features > Configuration services (so all containers configuration can be centrally managed) > administration commands > administration console plugins 16
  17. 17. Container Pluggability Console user domain.xml Central Config Admin Console C Container o GUI Parts Runtime n f Grizzly Adapter i Admin commands g Kernel client/browser admin invocation 17
  18. 18. OSGi integration • Module management > Add, remove, update installed modules • OSGi as a container ! > Treat OSGi just like the web container, bundles are deployed to it. • Converged Applications > Started investigating Java EE 6 + OSGi converged applications : – Dependencies in OSGi – Lifecycle still governed by Java EE. 18
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×