During the application development phase, freeing developers from having to think about non-functional services is an important aim. One of the main methods to achieve this is the ‘container’ approach. Application components are wrapped in containers, which also handle connections and calls to technical services. The Java EE containers (both Web and EJB) are a good example. Recently, the EJB container has been specified for version 3.0 of Java EE, and is taking the abstraction of technical services one stage further. The task of the developer is becoming even simpler as a result.
In response to the demand for simple and flexible Java containers, under the auspices of the ObjectWeb consortium, Bull has developed ‘EasyBeans’ in Open Source, a light JavaBeans Enterprise container that is innovative, modular and supports the new EJB 3 specification (for more information, see Florent Benoit’s article in Bull Direct dated April 2006). Using the new container makes it easier to develop business components used in distributed applications. Thanks to its modularity, the container can also be plugged into existing application servers such as JOnAS and Tomcat.
Nevertheless, the current trend is to go as far as possible towards middleware that is flexible, adaptable and easy to implement. To achieve this, the EasyBeans container has now been packaged in OSGi ‘bundles’ that enables it to be run above this service framework. For an EJB container, this is a world first in Open Source.
The OSGi specification defines a Java platform that supports the implementation of delivery units, referred to as bundles, within the operational environment. This environment enables the components within bundles to inter-operate using a service-oriented approach. It provides mechanisms to facilitate the continuous updating of applications, including the installation, activation, de-activation, updating and removal of bundles. It is, therefore, a highly dynamic environment. In addition, the OSGi framework handles the management of the necessary code dependencies (for example, the use of libraries) following installation of a new bundle for it to be activated. Once this occurs, it triggers the creation of the instance of the component deployed in the bundle.
This new version of EasyBeans for OSGi features new capacities and properties. EasyBeans has been made modular, so each component is packaged independently (in its own ‘JAR’, Java Archive) and can be deployed as and when needed. This in turn saves system resources, because only the technical resources necessary to run current applications are brought into play, but the option of deploying others subsequently is retained. This feature is especially useful when using EJB on-board hardware, when only limited resources are available. Thanks to this design, EasyBeans is also becoming easier to operate with plug-in systems such as Eclipse (which also depends on OSGi), also providing EJB development assistance tools in the process (since EJB can then be tested much more easily without exiting Eclipse).
Another advantage of this evolution is that EasyBeans can benefit from any eco-system of tools and services already available on OSGi (systems administration console, implementation tools, any OSGi service already in existence, etc). The OSGi deployment facilities mean that the user no longer has to access the file system, as OSGi handles downloading, cache deposits and execution of bundles: a single URL is all that is needed!
All this is achieved without any significant increase in EJB development costs. When it comes to application software, all you need to do is to add a meta-data file (MANIFEST) to the ‘JAR’ containing the beans (without the need for any alteration to the code or the XML description file).
For further information, read the article in InfoQ
Further information about EasyBeans (French only)