Date: 2005-01-04T14:49:26 Editor: TobyCabot Wiki: Apache Geronimo Wiki Page: GBeansArticle1 URL: http://wiki.apache.org/geronimo/GBeansArticle1
grammar tweaks (abstract and intro) Change Log: ------------------------------------------------------------------------------ @@ -6,26 +6,25 @@ == Abstract == -The Geronimo, Apache J2EE Container is build on top of a Kernel that does know nothing about J2EE. The Kernel is essentially a framework for the Components called GBeans and that framework supports Inversion of Control, IOC. The Article explains the theoretical aspects, GBean Life Cycle, GBean States and Dependency Injection with few examples and explains how to write a Simple GBean. +Geronimo is built on a Kernel that knows nothing about J2EE, rather it's a general-purpose Inversion of Control (IOC) framework for components called GBeans. This article explains the theoretical aspects of inversion of control, then describes the GBean Life Cycle, GBean States and Dependency Injection with a few examples, and then explains how to write a simple GBean. == Introduction == -Consider a platform like Linux or Windows which has a Operating System core that provides the system calls and set of application that run on top of the those system calls. Geronimo is built on top of a similar core which knows nothing about the J2EE and that core, Geronimo Kernel is essentially a framework for components called GBeans. -Any Complex System can be modeled as set of components that hold states, set of relationships among them and how each component reacts for certain events. What Geronimo Kernel does is provide a framework for the GBeans with following Services. +Consider a platform like Linux or Windows which has an operating system core that provides system calls and set of applications that run on top of the those system calls. Geronimo is built on a similar core which knows nothing about J2EE and that core, the Geronimo Kernel, is essentially a framework for components called GBeans. Any complex system can be modeled as set of components that hold states, a set of relationships among them, and how each component reacts to certain events. The Geronimo Kernel provides a framework for the GBeans with following services: - 1. GBeans can hold states either persistent or non-persistent + 1. GBeans can hold states (either persistent or non-persistent) 1. Relationships among the GBeans can be defined with them - 1. GBeans can contains logic that defines how the GBeans react to the events that occurred + 1. GBeans can contain logic that defines how they react to events -Almost Everything in Geronimo is a GBean, Containers, Connectors, adapters, application so on. GBeans generated a Mesh of component as Explained by the following figure. +Almost everything in Geronimo is a GBean: containers, connectors, adapters, applications and so on. The relationship between GBeans can be viewed as a mesh of components as explained by the following figure: http://apache.org/~hemapani/images/geronimo-gbean-archi.png -J2EE Container comprised of two types of Citizens, the first class citizens like Web Container, EJB Containers who provides the core services, And the second class citizens which are the applications deployed in the first class citizens like EJBs and Servlets. -The architecture of the Geronimo can be explained in terms of GBeans behaviors. All the time the Geronimo is set of running GBeans, and each First class Citizen is a set of GBeans that are related and they are loaded via the plans which are essentially a XML serialization of GBeans. When the plans are loaded and started the GBeans that included in the plans will be started and in simple words the EJB Containers or the Web Container will be started. -The applications that run in a J2EE Container are explained by the Deployment Descriptors and the Java Classes that are packed as a j2ee application archive. Geronimo Deployer parses those archives that explains the J2EE application and constructs GBeans out of them. When those constructed GBeans are started the j2ee application is deployed and available inside the J2EE Container. Those GBeans can be serialized and stored and as a result once an application is converted to GBean and added to the Geronimo it will be available even after the server is restarted. +Any J2EE Container is comprised of two classes of citizens; the first class citizens like Web Containers and EJB Containers that provide the core services, and the second class citizens which are the applications such as EJB's and Servlets that are deployed in the first class citizens. Geronimo's architecture can be explained in terms of GBean behaviors. Geronimo is set of running GBeans, and each first class citizen is a set of GBeans that are related to one another. They are loaded via "plans" which are essentially an XML serialization of GBeans. When the plans are loaded and started the GBeans that are included in the plans will be started, i.e. the EJB Containers and/or the Web Containers will be started. -== GBeans in a Conceptual point of View == +The applications that run in a J2EE Container are described by Deployment Descriptors and Java Classes that are packed as a J2EE application archive. The Geronimo Deployer parses those archives and constructs GBeans out of them. When the GBeans are started the application is deployed and available. The GBeans can be serialized and stored and as a result once an application is converted to GBeans and added to Geronimo it will be available even after the server is restarted. + +== GBeans from a Conceptual point of View == The concepts that provide the base for the GBeans have much longer history in the sense that the Geronimo Kernel is an inversion of Control, IOC framework where the IOC is also known as the dependency injection. The essence of IOC or the dependency injection is to create a loosely coupled architecture where the dependencies among components are managed by the framework. When a component has a dependency on other component the IOC framework will find the correct component and make it available to the first component. The dependency injection name comes from the fact that the framework automatically injects the dependencies to the component.