A Peek Under the Hood of Apache Geronimo
Total Page:16
File Type:pdf, Size:1020Kb
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Apache Geronimo: A Peek Under the Hood Bruce Snyder Jailey Solutions, LLC Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 1 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC What Is Apache Geronimo? It is Not… It is… Yet another lightweight Designed for long container running servers Yet another web Designed to tolerate framework partial component Yet another AOP failures framework System oriented An MVC framework services Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 2 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC From the Ground on Down Open Source Enterprise Infrastructure Highly modular architecture Initial manifestation as a J2EE Server Other possible configurations ¾Native Spring Integration ¾Bi-directional PicoContainer Integration ¾Native Portlet Integration ¾Native Web Services Integration ¾Deployment Chaining ¾and many more … Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 3 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Geronimo Kernel Fundamental Core ¾Small memory consumption ~150KB code ¾Component Configuration ¾Component Registration ¾Integrated Repository ¾Lifecycle Control ¾Dependency Manager Components are called GBeans ¾Simple object, plus some metadata Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 4 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC What Are GBeans? A J2EE managed object (MBeans) Used to bridge JSR-77 lifecycle requirements GBean wrappers allow just about anything to be plugged in to Geronimo Implement the GBeanLifecycle interface public interface GBeanLifecycle { void doStart() throws WaitingException, Exception; void doStop() throws WaitingException, Exception; void doFail(); } Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 5 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC What Are GBeans? (Continued) Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 6 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC GBean Archive A JAR file containing: ¾Persisted GBean instances ¾GBean metadata ¾Required Java classes reside: • Either in the jar, or • As dependencies from a central repository Must have a unique ID Can be signed for distribution Can be executable Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 7 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC GBean Descriptor Example Provides IoC configuration for a GBean <gbean> elements can be placed in any descriptor - usually geronimo-application.xml <gbean name="geronimo.system:role=LogAppender,type=ConsoleAppender" class="org.apache.geronimo.system.logging.log4j.appender.ConsoleAppenderService"> <attribute name="threshold" type="java.lang.String">INFO</attribute> <attribute name="layoutPattern" type="java.lang.String"> %d{ABSOLUTE} %-5p [%c{1}] %m%n </attribute> <attribute name="target" type="java.lang.String">System.out</attribute> </gbean> Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 8 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Demo (Time Permitting) Demonstrate simple GBean wrapper Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 9 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Repository Structured collection of jars ¾Designed to work in conjunction with Maven • Pluggable implementation ¾Every jar has a unique group and artifact ID, e.g. • geronimo-spec • geronimo-j2ee-1.4-RC2 Default repository is local file system ¾Others allow auto-download Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 10 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Basic Configuration Builder Deployers are J2EE specific ¾JSR-88 Builders are Geronimo specific ¾Create configuration objects containing GBeans ¾Serialized to a file upon shutdown From a pure GBean configuration ¾Very raw – used to bootstrap a server ¾You specify GBeans in an XML descriptor ¾Not intended for end users Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 11 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Application Builders Two stages make up deployment (JSR-88) ¾Deployment • Read the ear file and the server config(s) ¾Distribution • Send the ear file and server config(s) to the server Geronimo handles both stages in single step for the user Application-specific configurations Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 12 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Application Builders (Continued) Most complex Builder is J2EE deployer ¾Implements JSR-88 deployment specification ¾Take EJB-jars, wars, rars ¾Add in a deployment plan (XML) ¾Output a Geronimo Configuration ARchive (.car) Can produce very complex GBean definitions ¾e.g. entire EJB gets mapped to a GBean Allows for deploy-time optimizations ¾e.g. Precompile EJBQL, MessageSelectors, etc. Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 13 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Configurations EAR EJB WAR Local Environment Hot (DataSources, etc.) RAR Pico Pico Spring App Swap J2EE Configuration Pico Spring (Jetty, OpenEJB, ActiveMQ) Config Config System Services (Logging, URL Handler, XML Catalog) Cold Swap Geronimo Kernel (Lifecycle, Config Manager, Repository) Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 14 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Running the Server $ java –jar bin/server.jar <config> $ java –jar bin/server.jar <config> is a specific configuration to boot With M2, default is to restart all configurations that were running on last clean shutdown Maven Geronimo deploy plugin simplifies this greatly Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 15 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Geronimo Community Geronimo MX4J JOTM ActiveMQ OpenEJB cglib Jetty TranQL ActiveCluster Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 16 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Jetty Well established web container Implements Servlet 2.4 specification Designed for embedding and high performance Why not Apache Tomcat yet? ¾No real reason, just hasn’t been done yet Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 17 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC OpenEJB Well established EJB container Upgraded from 1.1 to 2.1 specification ¾No, it doesn’t do EJB3 (yet) Fully integrated into Geronimo Optimized for highly concurrent workloads Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 18 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC ActiveMQ Yes, it’s another JMS implementation ¾Looked at OpenJMS and JORAM ¾Needed BSD, JMS1.1 and JCA1.5 Designed for performance ¾NIO ¾Content based routing ¾Rules based routing (drools) Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 19 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC TranQL Framework for Persistence Frameworks Common data model across frameworks Multiple front ends: ¾EJB CMP, JDO, Castor, JDBC, Groovy DO Multiple back ends: ¾SQL92, SQL03, XML, LDAP, JCA Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 20 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC MX4J Well established JMX implementation Fully compliant JMX and JMX Remote API (JSR-160) Highly robust Widely used Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 21 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC ObjectWeb JOTM Java Open Transaction Manager Well established transaction manager Implements the JTA API ¾Full XA support • RMI/JRMP • RMI/IIOP Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 22 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC ActiveCluster Framework for creating cluster-based applications Small, simple implementation Pluggable service providers ¾Sockets ¾JMS ¾JGroups ¾Jabber Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 23 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC cglib High performance code generation library Well established class enhancer Provides runtime byte code manipulation Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 24 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Security Built in at low level ¾Secure network protocols ¾Support security manager (sandbox) JAAS and JACC ¾Possible pluggable policy providers • HIPPA • SOX Kerberos integration (including .NET) Apache Directory integration (LDAP) Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 25 Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC Transactions Lightweight Transaction Manager ¾XA Coordinator ¾XATerminator for JCA transaction import ¾Logging (HOWL) and basic recovery Future is