Apache Geronimo: A Peek Under the Hood - Software...
Transcript of Apache Geronimo: A Peek Under the Hood - Software...
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 1
Apache Geronimo: A Peek Under the Hood Bruce SnyderJailey Solutions, LLC
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 2
What Is Apache Geronimo?It is Not…
Yet another lightweight containerYet another web frameworkYet another AOP frameworkAn MVC framework
It is…Designed for long running serversDesigned to tolerate partial component failuresSystem oriented services
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 3
From the Ground on DownOpen Source Enterprise InfrastructureHighly modular architectureInitial manifestation as a J2EE ServerOther possible configurations
Native Spring IntegrationBi-directional PicoContainer IntegrationNative Portlet IntegrationNative Web Services Integration Deployment Chainingand many more …
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 4
Geronimo KernelFundamental Core
Small memory consumption ~150KB codeComponent ConfigurationComponent RegistrationIntegrated RepositoryLifecycle ControlDependency Manager
Components are called GBeansSimple object, plus some metadata
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 5
What Are GBeans? A J2EE managed object (MBeans)Used to bridge JSR-77 lifecycle requirementsGBean 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();
}
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 6
What Are GBeans? (Continued)
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 7
GBean ArchiveA JAR file containing:
Persisted GBean instancesGBean metadata Required Java classes reside: • Either in the jar, or• As dependencies from a central repository
Must have a unique IDCan be signed for distributionCan be executable
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 8
<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>
GBean Descriptor Example Provides IoC configuration for a GBean<gbean> elements can be placed in any descriptor - usually geronimo-application.xml
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 9
Demo (Time Permitting)Demonstrate simple GBean wrapper
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 10
RepositoryStructured 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 systemOthers allow auto-download
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 11
Basic Configuration BuilderDeployers are J2EE specific
JSR-88
Builders are Geronimo specific Create configuration objects containing GBeansSerialized to a file upon shutdown
From a pure GBean configurationVery raw – used to bootstrap a serverYou specify GBeans in an XML descriptorNot intended for end users
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 12
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
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 13
Application Builders (Continued)
Most complex Builder is J2EE deployerImplements JSR-88 deployment specificationTake EJB-jars, wars, rarsAdd in a deployment plan (XML)Output a Geronimo Configuration ARchive (.car)
Can produce very complex GBean definitionse.g. entire EJB gets mapped to a GBean
Allows for deploy-time optimizationse.g. Precompile EJBQL, MessageSelectors, etc.
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 14
Configurations
Geronimo Kernel(Lifecycle, Config Manager, Repository)
System Services(Logging, URL Handler, XML Catalog)
J2EE Configuration(Jetty, OpenEJB, ActiveMQ)
Local Environment(DataSources, etc.)
EAR EJB WAR
ColdSwap
HotSwap
RAR Pico
PicoConfig
Pico Spring App
SpringConfig
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 15
Running the Server
<config> is a specific configuration to bootWith M2, default is to restart all configurations that were running on last clean shutdownMaven Geronimo deploy plugin simplifies this greatly
$ java –jar bin/server.jar <config>
$ java –jar bin/server.jar
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 16
Geronimo Community
Geronimo
OpenEJB
Jetty
ActiveMQ
TranQL
ActiveCluster
MX4J
cglib
JOTM
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 17
Jetty Well established web containerImplements Servlet 2.4 specificationDesigned for embedding and high performance
Why not Apache Tomcat yet?No real reason, just hasn’t been done yet
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 18
OpenEJBWell established EJB containerUpgraded from 1.1 to 2.1 specification
No, it doesn’t do EJB3 (yet)
Fully integrated into GeronimoOptimized for highly concurrent workloads
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 19
ActiveMQYes, it’s another JMS implementation
Looked at OpenJMS and JORAMNeeded BSD, JMS1.1 and JCA1.5
Designed for performanceNIOContent based routingRules based routing (drools)
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 20
TranQLFramework for Persistence FrameworksCommon data model across frameworksMultiple front ends:
EJB CMP, JDO, Castor, JDBC, Groovy DO
Multiple back ends:SQL92, SQL03, XML, LDAP, JCA
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 21
MX4JWell established JMX implementation Fully compliant JMX and JMX Remote API (JSR-160)Highly robust Widely used
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 22
ObjectWeb JOTMJava Open Transaction ManagerWell established transaction managerImplements the JTA API
Full XA support • RMI/JRMP• RMI/IIOP
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 23
ActiveClusterFramework for creating cluster-based applicationsSmall, simple implementationPluggable service providers
SocketsJMSJGroupsJabber
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 24
cglibHigh performance code generation libraryWell established class enhancerProvides runtime byte code manipulation
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 25
Security Built in at low level
Secure network protocolsSupport security manager (sandbox)
JAAS and JACCPossible pluggable policy providers • HIPPA • SOX
Kerberos integration (including .NET)Apache Directory integration (LDAP)
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 26
Transactions Lightweight Transaction Manager
XA CoordinatorXATerminator for JCA transaction importLogging (HOWL) and basic recovery
Future is JOTM integration
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 27
Project Status A top-level Apache projectJ2EE 1.4 CTS testing in progress
Three people working on certification
Official unofficial release date: ?/?/2004Open Source: It’s done, when it’s done
M1 milestone release in MayM2 milestone release in August
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 28
M2 Release Features Geronimo Kernel is stableWeb integration completeOpenEJB stable
Mostly working, except some bits of CMP2.1ActiveMQ stableTransaction and Connector CompleteEnabled Hot (re)-deploymentTo-do
Finish web services, application client, CORBA
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 29
Who Is Bruce Snyder?Independent software consultantSpeaker at software conferences
JavaOneApacheConColorado Software Summit
The Castor Project (http://www.castor.org/)Apache Geronimo (http://geronimo.apache.org/)TranQL Project (http://tranql.codehaus.org/)Author
Castor Live (SourceBeat Publishing)
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 30
Project Contributors Aaron MulderBruce SnyderDavanum SrinivasDavid JencksGianny D’AmourJacek LaskowskiJan BartelJeremy BoynesRichard Monson-HaefelSrinath Perera
Alan CabreraDain SundstromDavid BlevinsGeir Magnusson JrGreg WilkinsJames StrachanJason DillonJules GosnellSimone Bordot
Colorado Software Summit: October 24 – 29, 2004 © Copyright 2004, Jailey Solutions, LLC
Bruce Snyder — Apache Geronimo: A Peek Under the Hood Page 31
Q&AOpen up for Questions and Answers