...
Geronimo is in the first place a Java^TM^ 2 Platform Enterprise Edition (J2EE) application server, but can be seen as a general service container. The main focus of developing Geronimo was the managing and scaling of application servers. Geronimo's intention was never to re-implement a servlet or an EJB container, but to use existing open source applications (mainly from Apache http://www.apache.org/) whenever possible, plug it together and build a new application server.
Anchor | ||||
---|---|---|---|---|
|
The standard Geronimo distribution comes with Apache Tomcat http://tomcat.apache.org/ and EJB container (OpenEJB http://incubator.apache.org/openejb/) component. Extending Geronimo by a monitoring component, developed for this paper, is like Tomcat, or any other component as long as they are GBeans, as shown in the Figure: #Geronimo extended by a monitor component. The fundamental entity within Geronimo are Geronimo Beans (GBeans).
Geronimo Beans
Anchor | ||||
---|---|---|---|---|
|
Everything in Geronimo is basically a Geronimo Bean (GBean). Geronimo's kernel handles these GBeans and stores them in it s repository. By default Geronimo uses not a database but a file directory named repository
.
Anchor | ||||
---|---|---|---|---|
|
Users can install their own GBeans by describing them with a deployment plan and deploy them into Geronimo by using the GBeanBuilder (see Fig. #Geronimo GBeans). Every GBean must implement the
GBeanLifecycle
interface. This interface defines three methods: doStart()
, doStop()
, doFail()
as you see in the class diagram (Fig. #Class diagram of the management component example). The GBeanLifecycle
interface is the contract between the Geronimo plug-in framework and our application, the GBean. The Geronimo framework uses dependency injection (see Fowler: Inversion of control containers and the dependency injection pattern, Frod: Dependency injection in apache geronimo, part 1, Dependency injection in apache geronimo, part 2) to set GBean parameters during the deployment process. There are two ways to inject information during the deployment process of GBeans:- getter/setter injection: framework injects information using the setter and getter methods of the GBean.
- constructor injection: framework injects information using the constructor of the GBean, when it is instantiated.
The example of this article is using constructor injection to pass the servlet MBean names and the MBean server reference to the monitor GBean.
References
- Sun's java management extensions (JMX) page. http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/.
- JConsole reference. http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jconsole.html.
- JConsole manual. http://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.html.
- JSR-77: J2EE management specification. http://jcp.org/en/jsr/detail?id=77.
- Apache home page. http://www.apache.org/.
- Tomcat home page. http://tomcat.apache.org/.
- OpenEJB home page. http://incubator.apache.org/openejb/.
- Martin Fowler; Inversion of control containers and the dependency injection pattern.; http://www.martinfowler.com/articles/injection.html; January; 2004.
- Niel Frod; Dependency injection in apache geronimo, part 1: A new way to look at decoupling in j2ee applications.; http://www-128.ibm.com/developerworks/opensource/library/os-ag-ioc1/; February; 2006.
- Niel Frod; Dependency injection in apache geronimo, part 2: The next generation.; http://www-128.ibm.com/developerworks/opensource/library/os-ag-ioc2/; February; 2006.