OSGi and Java EE 6
Yes you can with GlassFish V3
Jerome Dochez Oracle Corposration
OSGi and Java EE 6 Yes you can with GlassFish V3 Jerome Dochez - - PowerPoint PPT Presentation
OSGi and Java EE 6 Yes you can with GlassFish V3 Jerome Dochez Oracle Corposration The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any
Yes you can with GlassFish V3
Jerome Dochez Oracle Corposration
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into 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.
Introduction OSGi in GlassFish > Demo OSGi + Java EE in GlassFish > Hybrid Applications > Enterprise OSGi API > Demo Q &A
Tomcat
Jasper Catalina JSTL Struts Crimson XSLTC Xalan Xerces JAXB JAX-RPC JSF
June 2005 May 2006 GlassFish Launch
v2
GlassFish v1 (Java EE 5) GlassFish v3 (Java EE 6, OSGi Sept. 2007 Dec. 2009
v2.1
Jan 2008
v2.1.1
Nov. 2009
A Community > Users, Partners, Testers, Developers > Started in 2005 on java.net Application Server > Enterprise Quality and Open Source > Java EE 5 / 6 Reference Implementation > Full Commercial Support from Sun/Oracle > Tools Bundle for NetBeans & Eclipse
a
GlassFish runs on top of OSGi - default is Felix Runs unmodified on Equinox as well Can be embedded in existing OSGi runtime Highly modular runtime > Implemented as 200+ bundles > Customizable distribution Supports deployment of OSGi bundles
``
Provides a runtime for Hybrid Applications Implements Java EE related OSGi Services and Standards You don't have to assemble the bits. OSGi no longer under the cover > Raises visibility from GlassFish developers to GlassFish users
Runtime + OSGi glue layer Migration path for Java EE to hybrid apps Java EE 6 support Supports Java EE component model (e.g. EJB as OSGi service) And extensible (blueprint component model, declarative services, iPOJO)
http://weblogs.java.net/blog/2009/06/14/developing-hybrid-osgi-java-ee-applications-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 release.
Thin API – contains only two interfaces > HttpService – registerResource, registerServlet, unregister > HttpContext – Provides a context to a collection of servlets. GlassFish OSGi Administration Console > Based on Apache Felix Web Console http://www.osgi.org/javadoc/r4v42/org/osgi/service/http/package-summary.html
JPA supported in hybrid applications Enhancement at runtime > Works in all OSGi runtime Same packaging rules as JPA You can also deploy entities.jar as a bundle Shared persistence unit – so shared 2nd level cache
JDBC Driver as DataSourceFactory Dynamic discovery of driver details Multiple versions of same driver Wrap non-OSGi driver jars -> Bundles JDBC resource exported as OSGi Service
Web Application Bundle (WAB) > WAR + OSGi Metadata + Web-ContextPath header > Can use all enterprise APIs Including 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
EJB Jar as OSGi bundle EJB artifacts + OSGi Metadata + Export-EJB header Export-EJB: List of EJBs to be exported as OSGi services. > Special values: NONE, ALL > Support for Stateless & Singleton EJBs with Local Views Same life cycle as WAB Local EJB can cross application boundary!!!
OSGi service exported by some bundle Invoke the service from a EE component using standard @Resource injection Never use a GlassFish API !
Step by step: http://blogs.sun.com/dochez/entry/glassfish_v3_extensions_part_4
Jerome Dochez Oracle Corporation jerome.dochez@oracle.com