280 likes | 541 Views
Dive into Apache Geronimo 3.0. Xu Haihong Apache Geronimo PMC xuhaihong@apache.com 2010-08-16. Agenda. Apache Geronimo History Apache Geronimo Architecture Apache Geronimo 3.0 New Features Apache Geronimo Outlook Q&A. What Is Apache Geronimo.
E N D
Dive into Apache Geronimo 3.0 Xu Haihong Apache Geronimo PMC xuhaihong@apache.com 2010-08-16
Agenda • Apache Geronimo History • Apache Geronimo Architecture • Apache Geronimo 3.0 New Features • Apache Geronimo Outlook • Q&A
What Is Apache Geronimo [Don't] think of Geronimo as just another J2EE server but as the start of a system framework that can be used to build a whole variety of tailored infrastructure services. Jeremy Boynes, principal founder of Gluecode Software
Apache Geronimo History • Apache Geronimo Project formed • V1.0-M5 released, J2EE 1.4 certification • V2.0-M6 released, Java EE 5 certification • … • … • V2.1 Released • V2.2 Released • V 3.0 Web Profile M1 Released • V 3.0 Web Profile • 3.* Full Profile August2003 Oct2005 Jun 2007 Feb 2008 Dec 2009 Jun 2010 Ongoing … …
Apache Geronimo Status • 2.1.* Branch • Java EE 5 Certified • Apache Geronimo 2.1.6 • 2.2.* Branch • Java EE 5 Certified • Apache Geronimo 2.2.0 • Trunk • Java EE 6 Certified is ongoing ! • Apache Geronimo 3.0-SNAPSHOT (Under active development)
Agenda • Apache Geronimo History • Apache Geronimo Architecture • Apache Geronimo 3.0 • Architecture • New features • Apache Geronimo Outlook • Q&A
Geronimo GBean Architecture • What is GBean ? • A block ? • A bond ? • Technically speaking • A Simple Java Class • May implement some lifecycle interfaces • Declare attributes/methods/references • Managed by Geronimo kernel ( IOC Container ) • Geronimo Kernel vs Spring Container
GBean Use Scenario : Adapter • Control the third-party components’ lifecycles • Configure and initialize third-party components • ……
Integration GBean Sample • org.apache.geronimo.tomcat.HostGBean • public class HostGBean extends … implements … { • private final Host host; • private final EngineGBean engine; • public HostGBean(……) { • host = (Host)Class.forName(className).newInstance(); • …… • } • public void doStart() { • engine.addHost(host); • } • public void doStop() { • engine.removeHost(host); • } • }
GBean Use Scenario : Service • One GBean could expose some services, and other GBeans could take advantage of them.
Service GBean Sample • org.apache.geronimo.tomcat.deployment. TomcatModuleBuilder • public TomcatModuleBuilder( • ...... • @ParamReference(name="WebServiceBuilder“,……) WebServiceBuilder webServiceBuilder • ) { • …… • } • public void addGBeans( …… ) { • …… • serviceBuilder.configurePOJO(servletData, servletName, module, servletClassName, moduleContext)) • …… • }
Agenda • Apache Geronimo History • Apache Geronimo Architecture • Apache Geronimo 3.0 New features • Java EE 6 Support • OSGi Enablement • EBA Support • Apache Geronimo Outlook • Q&A
Java EE 6 Support • Java EE 6 Spec was finally released in Dec 2009 • Major components • Servlet 3.0 -> Tomcat 7.0 / Jetty 8.0 • JSP 2.2 -> Jasper 7.0 • EJB 3.1 -> OpenEJB 3.2.* • JAX-WS 2.2 -> Axis2 2.* / CXF 2.3.* • Web Beans -> OpenWebBeans 1.* • ……
OSGi Enablement • Geronimo 3.0 is totally based on OSGi • All Geronimo components are bundles running in the OSGi environment • Start Order now: • Start OSGi runtime • Start Apache Karaf • Start Geronimo • All the user applications will be running in the OSGi environment as bundles • Support Apache Felix/Equinox OSGi runtime
What major changes bring by OSGi • Classloader Architecture Changes • Past : Multi-parent Classloader • One Classloader could have more than one parent classloaders • Now : OSGi Bundle Classloader • One Bundle/Jar One Classloader
…… System/Application Classloader JSF Classloader JPA Classloader WebService Classloader Application A Classloader Application C Classloader Application B Classloader Multi-parent Classloader Architecture
Multi-parent Classloader • Disadvantage • Complex Classloader Hierarchy Tree • Classloader efficiency • Classloader related Exception • ClassNotFoundException • LinkageError • ClassCastException
OSGi Bundle Classloader Tomcat Shared Tomcat Util … Tomcat catalina Tomcat Plugin JAX-WS API Annotation API Jasper Servlet API JAXB API
OSGi Bundle Classloader • Import-Package/Export-Packages defines the mapping relation between different bundles, and improve the classloader efficiency • Usually, the same class loading request is routed to the same bundle
EBA Support • Enterprise Bundle Application • Programming Model for developing, assembling and deploying, as OSGi bundles, modular applications that exploit Java EE and OSGi technologies. • Geronimo 3.0 integrates Apache Aries , and support EBA packages deployment.
Agenda • Apache Geronimo History • Apache Geronimo Architecture • Apache Geronimo 3.0 New features • Apache Geronimo Outlook • Q&A
Apache Geronimo Outlook • Integration Style Change • Use the third-components’ initial configuration style • Take advantages of more OSGi functions • Use OSGi for the underlying service provider, like JNDI etc. • Use blueprint to “replace” GBean • Usability improvement • Plan to re-organize Geronimo Admin Console • Plan to add more pages for OSGi bundle management
Reference • Apache Geronimo • Apache Geronimo project resources