You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Overview

This section discusses the Geronimo kernel. Before getting into the higher level overview of the Geronimo architecture as a whole, it's important to understand the Geronimo kernel, since it is critical to it's architecture. Through the kernel, modules in Geronimo can communicate with the management utilities while being loosely coupled and not tied to JMX. The kernel keeps track of the various GBeans in the system along with the various attributes and methods that the GBeans provide.



The above diagram is a basic a layout of how the Kernel component works. The Geronimo Console is a web based way to start/stop applications, change JMS information etc. If a user wanted to stop an application, for example. The user would log into the web console and select the application to stop. When the action to stop the application occured, the web console wouldn't access tomcat directly. Instead the web console would communicate with the kernel and then the kernel would reflectively execute the appropriate stop function in Tomcat. Note that this allows testing of the web console, the kernel and Tomcat separately from each other.

Kernel

The Kernel interface is where it all starts. Below is a class diagram of Geronimo kernel. Note that many details have been ommitted, such as each of the methods of the Kernel interface, so as to not cloud the core concepts of the kernel.



The purpose of the kernel is to operate on GBeans that are hooked into Geronimo. In the above diagram, Kernel is an Interface and BasicKernel and KernelGBean are shown to implement that interface. The kernel is wrapped in a GBean just like Tomcat or ActiveMQ are. To achieve this, KernelGBean is a Decorator of Kernel. An instance of Kernel is passed in via the constructor and so all of the methods of Kernel are delegated to that instance. The new functionality that is added to Kernel is the getGBeanInfo method, needed to make Kernel a GBean. BasicKernel is the concrete implementation of Kernel that has the functionality to manipulate GBeans. Calling getAttribute for a given GBean will return the results of calling the getter method passed in via the method paramters (those parameters will be discussed in detail below. The invoke() methods, similar to the getAttribute() methods, will execute a particular method on the GBean. Note other normal operations that you'd want are there as well, like starting or stopping a GBean.

Registering a New GBean

In the above class diagram, the Kernel class has a method named loadGBean. This method takes an instance of GBeanData and a classloader as input. Recall from GBeans that GBeans aren't required to implement any interface. So the GBeanData object is a wrapper how the GBean should be accessed (it's name) and methods/attributes of that GBean. BasicKernel takes the GBeanData and passes it with other information to the GBeanInstance constructor. GBeanInstance is what all of the methods that relate to GBeans will operate on. GBeanInstance has all of the methods that are able to be called, links to the references and dependencies on the other GBeans etc. One of the most important pieces of information that is contained in the GBeanInstance is how it's referenced. Looking through the javadocs for the kernel (link here) will reveal that many of the methods in the interface are overridden four times. This is because there are four possible ways to reference a GBean. There is the AbstractName, the ShortName, the ObjectName and the class type.

  • No labels