• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
OSGi and Java EE in GlassFish - Tech Days 2010 India
 

OSGi and Java EE in GlassFish - Tech Days 2010 India

on

  • 4,215 views

OSGi and Java EE in GlassFish - Tech Days 2010 India

OSGi and Java EE in GlassFish - Tech Days 2010 India

Statistics

Views

Total Views
4,215
Views on SlideShare
4,005
Embed Views
210

Actions

Likes
1
Downloads
114
Comments
1

6 Embeds 210

http://blogs.sun.com 107
http://blog.arungupta.me 40
http://blogs.oracle.com 28
https://blogs.oracle.com 17
http://www.slideshare.net 14
http://itnewscast.com 4

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…

  • Great Work ... I m Begineer and fresher need guidence hoe to apply , where ?

    <b>[Comment posted from</b> http://blogs.sun.com/arungupta/entry/day_1_tech_days_20101]
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    OSGi and Java EE in GlassFish - Tech Days 2010 India OSGi and Java EE in GlassFish - Tech Days 2010 India Presentation Transcript

    • <Insert Picture Here> OSGi & Java EE in GlassFish Arun Gupta, Java EE & GlassFish Guy blogs.sun.com/arungupta, @arungupta
    • The following/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. 2
    • Are you tweeting ? #glassfish #techdays 3
    • The OSGi Alliance is a worldwide consortium of technology innovators that advances a proven and mature process to assure interoperability of applications and services based on its component integration platform. 4
    • OSGi Alliance provides ... • Specifications • Reference Implementation • Test Suites • Certifications 5
    • What is OSGi ? • Specification delivered by OSGi Alliance • Originally for embedded devices and networks • Architecture for modular application development in Java • Reduces the cost of building, maintaining, and deploying applications 6
    • What is OSGi ? • OSGi “container” breaks application into “modules” or “bundles” • Felix, Equinox, Knopflerfish • Dependencies between each bundle are managed • Can install, uninstall, start, and stop each bundle dynamically without restarting container • Multiple versions of a bundle are supported 7
    • GlassFish v3 & OSGi • No OSGi APIs are used in GlassFish • HK2 provides abstraction layer • All GlassFish modules are OSGi bundles • Felix is default, also runs on Knopflerfish & Equinox • Can run in an existing shell • 216 modules in v3 http://blogs.sun.com/arungupta/entry/totd_103_glassfish_v3_with 8
    • Benefits of OSGi for GlassFish • Demands and enforces stronger modularity • Enables custom tailored App server • Lazy loading based on usage patterns • Open for all JVM based technologies • Native deployment of JRuby-on-Rails application • Successfully maintained quick startup • Available to GlassFish developers and users 9
    • GlassFish: The next generation platform REST OpenMQ WebSpace Server Scripting OpenESB OpenSSO Web Services JMS Portal Web Connection Java Web Services JSF EJB Container Application Container Container Pooling (JCA) Persistence Interop Management Console Update Center Management CLI Naming Grizzly Framework Monitoring/ Injection Service Config Deploy Manager Security Monitor Configuration Cluster Serviceability/ Logging GlassFish V3 Core Transaction Security (Module Subsystem) Service Service Deployment Clustering OSGi Java SE 10
    • GlassFish v3 Runtime with OSGi GlassFish V3 modules GlassFish V3 modules Random OSGi Bundle Random OSGi Bundle (OSGi + extra metadata) (OSGi + extra metadata) Service OSGi OSGi HK2 Service layer HK2 Service layer Mapper Service Layer Service Layer OSGi Bundle management OSGi Bundle management 11
    • Create an OSGi Bundle – Using Maven • Create a Maven project • Implement “BundleActivtor” • Update “pom.xml” • Change packaging to “bundle” • Add dependencies on OSGI APIs • Use “maven-bundle-plugin” to package • Build the bundle http://blogs.sun.com/arungupta/entry/totd_36_deploy_osgi_bundles 12
    • OSGi Bundle Management in GlassFish • asadmin deploy –type osgi • “cp” / “rm” glassfish/modules/autostart directory • telnet localhost 6666 • Apache Felix Web Console • REST Console bundle • Perl-based shell (Osgish) http://blogs.sun.com/arungupta/entry/totd_118_managing_osgi_bundles 13
    • 14
    • Hybrid Applications “A hybrid application is an OSGi bundle as well as a Java EE archive and hence has both an OSGi bundle context and Java EE c ontext at runtime and can leverage capabilities of both the platforms.” 15
    • Why OSGi in Enterprise Apps ? • Improved modularity • Reusable bundles • Dependencies are more visible • Better isolation / Cleaner class loading model • Better version control • Faster deployment cycle • Better tools for deployment • Observable bundle life cycle • Service Tracking • Criteria-based service selection 16
    • Why Java EE in Enterprise Apps ? • Better API (JPA, JTA, JAXB, JNDI) • Better component model (Servlet, EJB, JAX-RS) • Better frameworks (JSF, CDI) • Ease-of-use (Annotations, Convention-over-configuration) • Platform provided integrated infrastructure services • Transaction, Security, Persistence, Remoting, ... • Many more reasons ... 17
    • Why Hybrid Apps ? Best of both worlds!!! Why do you want to learn new APIs ? 18
    • Role of GlassFish • Provides a runtime for Hybrid Applications • Implements Java EE related OSGi services and standards • Don't have to assemble the bits • OSGi is no longer under the cover • Raises visibility from GlassFish developers to users 19
    • Enterprise OSGi API in GlassFish • OSGi/HTTP Service • OSGi/Web Application (rfc #66) • OSGi/EJB • OSGi/JDBC (rfc #122) • OSGi/JPA • OSGi/JTA (rfc #98) Work in Progress (in trunk), some of it already in v3. 20
    • OSGi/Web Application (rfc #66) • Web Application Bundle (WAB) • WAR + OSGi + Web-ContextPath Header • Can use all enterprise APIs include JPA with lazy loading • Sample manifest: 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 • Wrapped WAR Support • webbundle: URL scheme 21
    • Hybrid Applications - Demo • OSGi services in Java EE @Resource(mappedName=”osgiName”) SomeOSGiService osgiService; • JNDI Lookup • Portable, no OSGi dependencies in application • Exported APIs visible to Java EE apps http://blogs.sun.com/arungupta/entry/totd_124_osgi_declarative_services 22
    • Extending GlassFish v3 Using Spring dm Container • Simple Spring bean implementing the service • Invoke the service from a servlet using standard @Resource injection • Single runtime for both Spring and full Java EE http://blogs.sun.com/dochez/entry/glassfish_v3_extensions_part_4 23
    • Create an OSGi bundle - NetBeans 24
    • Looking Forward • GlassFish v3 • Support OSGi-Enabled Java EE applications • Implement Java EE-related OSGi services • Expose Java EE services as OSGi services • Improve underlying OSGi framework administration 25
    • References • glassfish.org • blogs.sun.com/theaquarium • twitter.com/glassfish • glassfish@sun.com 26
    • <Insert Picture Here> OSGi & Java EE in GlassFish Arun Gupta, Java EE & GlassFish Guy blogs.sun.com/arungupta, @arungupta