home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <article id="paper-208">
- <articleinfo>
- <title>The JOnAS Open Source J2EE Platform</title>
- <author>
- <firstname>Franč¼is</firstname>
- <surname>Exertier</surname>
- </author>
- <copyright>
- <year>2003</year>
- <holder>Bull</holder>
- </copyright>
- </articleinfo>
-
- <para>This document presents the JOnAS J2EE platform. After a short
- introduction of the J2EE concepts, and of the ObjectWeb Consortium,
- the JOnAS server architecture and
- features are presented.
- </para>
-
-
- <section>
- <title>Introduction</title>
- <section>
- <title>J2EE</title>
- <para>The <trademark>Sun</trademark>
- <ulink url="http://java.sun.com/j2ee/">J2EE specification</ulink>,
- together with its related specifications
- (<ulink url="http://java.sun.com/products/ejb/">
- <trademark>EJB</trademark></ulink>,
- <ulink url="http://java.sun.com/products/jms/">
- <trademark>JMS</trademark></ulink>,...),
- defines an architecture and interfaces for developing and deploying
- distributed internet <trademark>Java</trademark> server applications based on a
- multi-tier architecture. This
- specification intends to facilitate and normalize the development,
- deployment and assembling of applicative components; such components
- will be deployable on J2EE platforms. The resulting applications are
- typically web based, transactional, database-oriented, multi-user,
- secured, scalable and portable. More precisely, this specification
- describes two kinds of information:</para>
- <itemizedlist>
- <listitem><para>The first one is the runtime environment, called J2EE server, which
- provides the execution environment and the required system services
- such as the transaction service, the persistence service, the JMS
- service, the security service ...</para></listitem>
- <listitem><para>The second one is some kind of programmer's guide and user's guide
- explaining how an application component should be developed, deployed
- and used.</para></listitem>
- </itemizedlist>
-
- <para>Not only will an application component be independent of the platform
- and operating system (since written in Java), but also of the J2EE
- platform.
- </para>
- <para>A typical J2EE application is composed of presentation components,
- also called "web components" (<ulink url="http://java.sun.com/products/servlet">Servlets</ulink>
- and <ulink url="http://java.sun.com/products/jsp"><trademark>JSPs</trademark></ulink>),
- which define the application Web interface, and of enterprise components,
- the "Enterprise JavaBeans", which define the application business logic
- and application data. The J2EE server provides containers for hosting
- web and enterprise components. The container provides the component
- life cycle management and interfaces the components with the services
- provided by the J2EE server. There are two kinds of container, the web
- container handles Servlet and JSP components while the EJB container
- handles the Enterprise JavaBeans components.</para>
-
- <para>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="picture-208-01.gif" format="GIF"/>
- </imageobject>
- </inlinemediaobject>
- </para>
-
- </section>
- <section>
- <title>ObjectWeb</title>
- <para>JOnAS is an open source implementation of J2EE, developed within
- the ObjectWeb consortium.
- <ulink url="http://www.objectweb.org">ObjectWeb</ulink> is an open source
- initiative which may be compared to Apache or Linux, but in the area of
- <emphasis>middleware</emphasis>. The aim of ObjectWeb is to develop
- and promote open source middleware softwares.</para>
- <para>ObjectWeb is an International Consortium hosted by INRIA, officially
- founded in February 2002 by Bull, France Telecom, and INRIA. All
- softwares are available with the LGPL licence.</para>
- <para>The technical objective of this consortium is to develop a distributed
- component-based middleware technology, in line with CORBA, Java and W3C
- standards. The idea is to apply the component model, as already used at
- the application level in J2EE or in the CORBA Component Model, at the
- middleware level by itself. The functional coverage of ObjectWeb
- projects addresses naming, trading, communication (events, messages),
- availability and safety (transactions, persistence, replication,
- fault tolerance), load balancing, and security. Some transversal
- topics are also addressed, like robustness, optimisation, code quality,
- as well as benchmarks, tests, evaluations, demonstrators and
- development tools.
- </para>
- <para>Thus, the global ObjectWeb architectural model goes top down, from
- applications (as benchmarks such as Rubis from the JMOB project)
- running on middleware platforms (such as JOnAS, OpenCCM or ProActive).
- The platforms are based on technical components such as a
- Message-Oriented Middleware (JORAM which implements JMS), a
- communication framework (CAROL), a persistence framework (JORM),
- a transactional monitor (JOTM), a Object Request Broker (Jonathan).
- A technical component such as C-JDBC allows any platform to benefit
- from database clusters. JOnAS makes use of all these ObjectWeb
- components (JORAM, CAROL, Jonathan, JORM, C-JDBC, and soon JOTM), but is
- also using open source components from other communities, this is the
- case for Tomcat or Jetty, used as Web container, or for AXIS, used for
- providing the "Web Services" environment.
- </para>
- <para>ObjectWeb has already a significant number of corporate members,
- universities, and also individual members (individual membership is
- free). ObjectWeb members contribute to ObjectWeb orientations, and
- participate to all ObjectWeb working groups, meetings, workshops and
- conferences. The community of developers and users around
- ObjectWeb components and platforms is growing continuously.</para>
- </section>
- </section>
- <section>
- <title>JOnAS Features</title>
- <para>JOnAS is a pure Java open source application server conforming to the
- J2EE specification.
- However its high modularity allows to use it </para>
- <itemizedlist>
- <listitem><para>as a J2EE server, for deploying and running EAR applications (i.e.
- applications composed of both web and ejb components),</para></listitem>
- <listitem><para>as an EJB container, for deploying and running EJB components (e.g.
- for applications without web interfaces or when using JSP/Servlet
- engines that are not integrated as a JOnAS J2EE container),</para></listitem>
- <listitem><para>as a Web container, for deploying and running JSPs and Servlets
- (e.g. for applications without EJB components).</para></listitem>
- </itemizedlist>
- <section>
- <title>System Requirements</title>
- <para>JOnAS is available for JDK 1.3 or 1.4. It has been used on many
- operating systems (Linux, AIX, Windows, Solaris, HP-UX, etc.), and
- with different Databases (Oracle, PostgreSQL, MySQL, SQL server, Access,
- DB2, Versant, Informix, Interbase, etc.).</para>
- </section>
- <section>
- <title>Java Standard Conformance</title>
- <para>JOnAS is an implementation of J2EE 1.3. It
- currently conforms to EJB 2.0. Its
- current integration of Tomcat or Jetty as Web container insures
- conformity to Servlet 2.3 and JSP 1.2 specifications. The JOnAS
- server relies on or implements the following Java APIs: <trademark>JCA</trademark>
- 1.0, <trademark>JDBC</trademark> 2.0, <trademark>JTA</trademark> 1.0.1,
- <trademark>JMS</trademark> 1.1,
- <trademark>JMX</trademark> 1.0, <trademark>JNDI</trademark> 1.2.1,
- <trademark>JAAS</trademark> 1.0,
- <trademark>JavaMail</trademark> 1.3.</para>
- </section>
- <section>
- <title>Key Features</title>
- <para>In addition to the implementation of all J2EE related standards, JOnAS
- provides the following advanced and important features:</para>
- <itemizedlist>
- <listitem><para><emphasis>Management:</emphasis> JOnAS server management uses JMX and
- provides a servlet based managment console.</para></listitem>
- <listitem><para><emphasis>Services:</emphasis> The service based architecture of JOnAS
- provides a high modularity and configurability of the server. It
- allows to apply a component model approach at the middleware level,
- and makes easy the integration of new modules (e.g. for open source
- contributors). It also allows to start only the services needed
- by a particular application, thus saving useless system resources.
- JOnAS services are manageable through JMX.</para></listitem>
- <listitem><para><emphasis>Scalability:</emphasis> JOnAS integrates several optimization
- mechanisms for increasing the server scalability. This includes
- pool of stateless session beans, pool of message-driven beans, pool
- of threads, cache of entity beans, activation/passivation of entity
- beans, pool of connections (for JDBC and JMS), storage access
- optimizations (shared flag, isModified).</para></listitem>
- <listitem><para><emphasis>Clustering:</emphasis> JOnAS clustering solutions, both at
- the WEB and EJB level provide load balancing, high availability and
- failover support.</para></listitem>
- <listitem><para><emphasis>Distribution: </emphasis> JOnAS is working with several
- distributed processing environments, thanks to the integration of
- the <ulink url="http://www.objectweb.org/carol/index.html">CAROL</ulink>
- (Common Architecture for RMI ObjectWeb Layer) ObjectWeb project,
- which allows simultaneous support of several communication protocols:
- <itemizedlist>
- <listitem><para><emphasis>RMI</emphasis> using the Sun proprietary protocol JRMP,</para></listitem>
- <listitem><para><emphasis>RMI</emphasis> on IIOP,</para></listitem>
- <listitem><para><emphasis>CMI</emphasis>, the "Cluster aware" distribution protocol of
- JOnAS,</para></listitem>
- <listitem><para>or <emphasis>Jeremie</emphasis>, the RMI personality of an Object Request
- Broker called
- <ulink url="http://www.objectweb.org/jonathan/index.html">Jonathan</ulink>,
- from Objectweb. Used with Jeremie, JOnAS benefits from transparent
- local RMI calls optimization.</para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para><emphasis>Support of "Web Services":</emphasis> by the integration of
- AXIS, JOnAS allows J2EE components to access "Web services" (i.e. to
- be "Web Services" clients), and
- allows J2EE components to be deployed as "Web Services" endpoints.</para></listitem>
- </itemizedlist>
- <para>Three critical J2EE aspects have been early implemented in the JOnAS
- server:</para>
- <itemizedlist>
- <listitem><para><emphasis>JCA:</emphasis> Enterprise Information Systems (EIS) may
- be easily accessed from JOnAS applications. By supporting the Java
- Connector Architecture, JOnAS allows to deploy any JCA compliant
- Resource Adapter (connector) that will make the corresponding EIS
- available from the J2EE application components. For example, Bull
- GCOS mainframes may be accessed from JOnAS using their associated
- <ulink url="http://www.bull.com/servers/gcos8/products/interop8/hoox_pr.htm">Hoox connectors</ulink>.</para></listitem>
- <listitem><para><emphasis>JMS:</emphasis> JMS implementations may be easily plugged into
- JOnAS. They run as a JOnAS service in the same JVM or in a separate JVM
- and JOnAS provides administration facilities that hide the JMS
- proprietary administration APIs. Currently two JMS implementations may
- be used: the <ulink url="http://www.objectweb.org/joram/">JORAM</ulink>
- open source JMS implementation from Objectweb and
- <ulink url="http://www.swiftmq.com/">SwiftMQ</ulink>.
- </para></listitem>
- <listitem><para><emphasis>JTA:</emphasis> The JOnAS platform supports distributed
- transactions that involve multiple components and transactional
- resources. The JTA transactions support is provided by a Transaction
- Monitor that has been developed on top of an implementation of
- the CORBA Transaction Service (OTS).
- </para></listitem>
- </itemizedlist>
- </section>
- <section>
- <title>JOnAS Packages</title>
- <para>JOnAS is available for download with three different packagings:</para>
- <itemizedlist>
- <listitem><para>a simple packaging only contains the JOnAS application server,
- without the associated Web Container implementation. In order to
- use it for J2EE Web applications, you need to have Tomcat or Jetty
- installed (with an adequate version) and to configure it and
- JOnAS so that they can work together.</para></listitem>
- <listitem><para>a JOnAS-Tomcat package contains both JOnAS and Tomcat,
- pre-configured, and with compiled examples. This is a ready to run
- J2EE application server. This package also contains AXIS, thus
- providing pre-configured "Web Services" support.</para></listitem>
- <listitem><para>a JOnAS-Jetty package contains both JOnAS and Jetty,
- pre-configured, and with compiled examples. This is a ready to run
- J2EE application server. This package also contains AXIS, thus
- providing pre-configured "Web Services" support.</para></listitem>
- </itemizedlist>
- </section>
- </section>
- <section>
- <title>JOnAS Architecture</title>
- <para>JOnAS is architectured in term of services. A service typically
- provides system resources to containers. Most of the components of the
- JOnAS application server are pre-defined JOnAS services. However it is
- possible and easy for an advanced JOnAS user to define its own service
- and to integrate it into JOnAS. J2EE applications do not necessarily
- need all services, it is thus possible to define, at JOnAS server
- configuration time, the set of services that are to be launched at
- server start.</para>
- <para>The JOnAS architecture is illustrated in the figure below, showing
- WEB and EJB containers relying on JOnAS services (all services are
- present on this figure). Two thin clients are also shown on this
- picture, one of them being the JOnAS administration console (called
- Jadmin).</para>
-
- <para>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="picture-208-02.gif" format="GIF"/>
- </imageobject>
- </inlinemediaobject>
- </para>
-
- <section>
- <title>Communication and Naming Service</title>
- <para>This service (also called "Registry") is used for launching the
- RMI registry, the CosNaming, the CMI registry, and/or the Jeremie
- registry depending on the configuration of JOnAS (CAROL configuration
- which specifies which communication protocols are to be used). There are
- different registry launching modes, i.e. in the same JVM or not,
- automatically if not already running.</para>
- <para>This service provides the JNDI API to application components and
- to other services, in order to bind and lookup remote objects (e.g. EJB
- Homes) and resource references (JDBC DataSource, Mail and JMS connection
- factories, etc.). </para>
- </section>
- <section>
- <title>EJB Container Service</title>
- <para>This service is in charge of loading the EJB components and their
- containers. EJB containers are composed of a set of Java classes
- implementing the EJB specification and by a set of interposition classes
- interfacing the EJB components with the services provided by the
- JOnAS application server. Interposition classes are specific to
- each EJB component and are generated by the deployment tool called
- GenIC.</para>
- <para>JOnAS configuration allows to specify this service to be launched
- with a set of ejb-jar files to be loaded. Ejb-jar files may also
- be deployed at server runtime using the JOnAS administration tools.</para>
- <para>Enterprise JavaBeans (EJB) are software components implementing
- the business logic of an application (while the Servlets and JSPs
- implement the presentation). There are three kinds of Enterprise
- JavaBeans:</para>
- <itemizedlist>
- <listitem><para><emphasis>Session beans</emphasis> are objects associated to only one
- client, short-lived (one method call or a client session),
- that represent the current state of the client session. They can be
- transaction-aware, stateful or stateless.</para></listitem>
- <listitem><para><emphasis>Entity beans</emphasis> are objects that represent data in a
- database. They may be shared by several clients and are identified by
- means of a primary key. The EJB container is responsible for
- managing the persistence of such objects. The persistence management
- of such an object is entirely transparent to the client that will
- use it, and may be or may not be transparent to the bean provider that
- develops it depending if it is
- <itemizedlist>
- <listitem><para>An enterprise bean with <emphasis>Container-Managed Persistence</emphasis>.
- In such a case, the bean provider does not develop any data access
- code, persistence management is delegated to the container.
- The mapping between the bean and the persistent storage is provided
- in the deployment descriptor, in an application server specific
- way.
- </para></listitem>
- <listitem><para>An enterprise bean with <emphasis>Bean-Managed Persistence</emphasis>. In
- this case, the bean provider writes the database access operations
- in the methods of the enterprise bean that are specified for data
- creation, load, store, retrieval, and remove operations.</para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem><para><emphasis>Message-driven Beans</emphasis> are objects that may be
- considered as message listeners. They execute on receipt of a
- JMS (<ulink url="http://java.sun.com/products/jms">Java Message Service</ulink>) message,
- they are transaction aware and stateless. They implement some kind
- of asynchronous EJB method invocation.</para></listitem>
- </itemizedlist>
- <para>For implementing Container-Managed Persistence of EJB 2.0 (CMP2),
- JOnAS relies on the ObjectWeb
- <ulink url="http://www.objectweb.org/jorm">JORM</ulink> (Java Object Repository
- Mapping) framework. JORM supports complex mappings of EJBs to database
- tables, and several kinds of persistency support (relational databases,
- object databases, LDAP repositories, etc.).</para>
- </section>
- <section>
- <title>WEB Container Service</title>
- <para>This service is in charge of running a Servlet/JSP Engine in the
- JVM of the JOnAS server, and of loading web applications ("war" files)
- within this engine. Currently this service may be configured to use
- <ulink url="http://jakarta.apache.org/tomcat/">Tomcat</ulink> or
- <ulink url="http://www.jettyserver.org">Jetty</ulink>. Servlet/JSP engines
- are integrated within JOnAS as "web containers", i.e. such containers
- provide the web components with access to the system resources (of
- the application server) and to EJB components, in a J2EE compliant way.
- </para>
- <para>JOnAS configuration allows to specify this service to be launched
- with a set of war files to be loaded. War files may also
- be deployed at server runtime using the JOnAS administration tools.
- Tomcat and JOnAS users management has been unified. The class loading
- delegation policy (priority to the Webapp classloader or to the
- parent classloader) may be configured.</para>
- <para><ulink url="http://java.sun.com/products/servlet">Servlet</ulink>
- and <ulink url="http://java.sun.com/products/jsp"><trademark>JSP</trademark></ulink> are
- technologies for developing dynamic web pages. The Servlet approach
- allows the development of Java classes (HTTP Servlets) that may be
- invoked through HTTP requests and that generate HTML pages. Typically
- Servlets access the information system using Java APIs (as JDBC or the
- APIs of EJB components) in order to build the content of the HTML page
- they will generate in response to the HTTP request. The JSP technology
- is a complement of the Servlet technology. A JSP is an HTML page
- containing Java code within particular XML-like tags; this Java code is
- in charge of generating the dynamic content of the HTML page.</para>
- <para>Servlets and JSPs are considered as J2EE application components
- responsible of the application presentation logic. Such application
- components are able to access resources provided by the J2EE server
- (as JDBC datasources, JMS connection factories, EJBs, mail factories,
- ...). As for EJB components, the actual assignment of these resources
- is performed at component deployment time, and is specified in the
- deployment descriptor of each component (the component code use logical
- resources names).</para>
- </section>
- <section>
- <title>Ear Service</title>
- <para>This service is used for deploying complete J2EE applications, i.e.
- applications packaged in EAR files (themselves containing ejb-jar
- files and/or war files). This service will handle the EAR files, and
- will delegate the deployment of the war files, resp. ejb-jar files, to
- the WEB Container service, resp. to the EJB Container service. It will
- take care of creating the appropriate class loaders (as preconised in the
- J2EE specification) in order for the J2EE application to execute
- properly.</para>
- <para>For deploying J2EE applications, JOnAS must be configured to launch
- the EAR service, and the set of EAR files to be loaded may be
- specified. EAR files may also
- be deployed at server runtime using the JOnAS administration tools.</para>
- </section>
- <section>
- <title>Transaction Service</title>
- <para>This is a Java Transaction Monitor called JOnAS JTM. It is a mandatory
- service which handles distributed transactions. It provides transaction
- management for EJB components as defined in their deployment descriptors.
- It handles two-phase
- commit protocol against any number of Resource Managers (XA Resources).
- For J2EE, a transactional resource may be a JDBC connection,
- a JMS session
- or a JCA Resource Adapter connection. The transactional context is
- implicitly propagated with the distributed requests. The JTM may be
- distributed across one or more JOnAS servers; thus a transaction may
- involve several components located on different JOnAS servers. This
- service implements the JTA 1.0 specification, thus allowing to explicitly
- start and terminate transactions from application components or from
- application clients.
- Starting transactions from application components is only allowed
- from Web components or from session beans or message-driven beans
- (and only these two kinds of beans, this is called
- <emphasis>"Bean-managed transaction demarcation"</emphasis>).</para>
- <para>One of the main advantages of the EJB
- support for transactions is its declarative aspect, which means that
- transaction control is no longer hard coded in the server application,
- but is
- configured at deployment time. This is known as "<emphasis>Container-managed
- transaction demarcation</emphasis>".With "<emphasis>Container-managed transaction
- demarcation</emphasis>" the transactional behaviour of an enterprise bean
- is defined at configuration time, and is part of the deployment
- descriptor of the bean.
- The EJB container is responsible for providing the transaction
- demarcation for the enterprise beans, according to the value of
- transactional attributes associated to EJB methods which can be one of
- the following:</para>
- <itemizedlist>
- <listitem><para><emphasis>NotSupported:</emphasis> if the method is called
- within a transaction, this transaction is suspended during the time
- of the method execution.</para></listitem>
- <listitem><para><emphasis>Required</emphasis>: if the method is called
- within a transaction, the method is executed in the scope of this
- transaction, else, a new transaction is started for the execution of
- the method, and committed before the method result is sent to the
- caller.</para></listitem>
- <listitem><para><emphasis>RequiresNew:</emphasis> the method will always be
- executed within the scope of a new transaction. The new transaction is
- started for the execution of the method, and committed before the
- method result is sent to the caller. If the method is called within a
- transaction, this transaction is suspended before the new one is
- started, and resumed when the new transaction has completed.</para></listitem>
- <listitem><para><emphasis>Mandatory</emphasis>: the method should always be
- called within the scope of a transaction, else the container will throw
- the <emphasis>TransactionRequired</emphasis> exception.</para></listitem>
- <listitem><para><emphasis>Supports:</emphasis> the method is invoked within
- the caller transaction scope, if the caller does not have an associated
- transaction, the method is invoked without a transaction scope.</para></listitem>
- <listitem><para><emphasis>Never</emphasis>: with this attribute the client
- is required to call the method without a transaction context else the
- Container throws the java.rmi.RemoteException exception.
- </para></listitem>
- </itemizedlist>
- <para>The <ulink url="http://www.objectweb.org/jotm">JOTM</ulink> (Java Open
- Transaction Manager) project from ObjectWeb has been created based
- on the JOnAS transaction service. It has been enhanced to provide
- advanced transaction features, such as nested transactions, "Web
- Services" transactions (an implementation of DBTP is available). JOTM
- will be integrated in JOnAS in a near future.</para>
- </section>
- <section>
- <title>Database Service</title>
- <para>This service is responsible for handling Datasource objects. A
- Datasource is a standard JDBC administrative object for handling
- connections to a database. The Database service
- creates and loads such datasources on the JOnAS server. Datasources
- to be created and deployed may be specified at JOnAS configuration time,
- or they may be created and deployed at server runtime using the JOnAS
- administration tools. The Database service is also responsible for
- connection pooling, i.e. it manages a pool of database connections to
- be used by the application components, thus avoiding many physical
- connection creations which are time consuming operations.</para>
- </section>
- <section>
- <title>Security Service</title>
- <para>This service implements the authorization mechanisms for accessing EJB
- components, as specified in the EJB specification. EJB security is based
- on the notion of <emphasis>roles</emphasis>.
- The methods can be accessed by a given set of roles. In order to
- access the methods, the user <emphasis>must</emphasis> be at least in one of this
- set of roles.
- The mapping between roles and methods (permissions) is done in the
- deployment descriptor using the security-role and
- method-permission elements. Programmatic security management
- is also possible using two methods of the EJBContext interface, in
- order to enforce or complement security check in the bean code:
- getCallerPrincipal() and
- isCallerInRole (String roleName).
- The role names used in the EJB code (in the isCallerInRole method)
- are in fact references to actual security roles, which makes the EJB
- code independent of the security configuration described
- in the deployment descriptor. The programmer makes these role
- references available to the bean deployer or application assembler by the
- way of the security-role-ref
- elements included in the session or entity
- elements of the deployment descriptor.
- </para>
- <para>
- In JOnAS, the mapping between roles and user identification is done
- in the user identification repository. When using Tomcat for user
- authentification, this user identification repository may either be
- stored in files, in a JNDI repository (such as LDAP), or in a relational
- database. This is achieved through a JOnAS implementation of the
- Tomcat Realms, i.e. UserDatabaseRealm, MemoryRealm , JDBCRealm,
- JNDIRealm. These realms are in charge to propagate the security context
- to the EJB container during EJB calls. For Java clients authentification,
- JAAS login modules are provided.
- </para>
- </section>
- <section>
- <title>Messaging Service</title>
- <para>Asynchronous EJB method invocation is possible on Message-driven
- Beans components, as specified in the EJB 2.0 specification.
- A Message-driven Bean is an EJB component which may be considered as
- a JMS (<ulink url="http://java.sun.com/products/jms">Java Message Service</ulink>)
- MessageListener, i.e. which processes
- JMS messages asynchronously, it is associated with a JMS
- destination, its <emphasis>onMessage</emphasis> method will be activated on the
- reception of messages sent by a client application to this destination.
- It is also possible for any EJB component to use the JMS API, and this
- within the scope of transactions managed by the application server.
- </para>
- <para>For supporting Message-driven Beans, and
- JMS operations coded within application components, the JOnAS
- application server relies on a JMS implementation.
- JOnAS makes use of a third party JMS implementation: currently
- the <ulink url="http://www.objectweb.org/joram">Joram</ulink>
- opensource software is integrated and delivered with JOnAS, the
- <ulink url="http://www.swiftmq.com/">SwiftMQ</ulink> product may also be used,
- other JMS provider implementations may easily be integrated. JORAM
- provides several points of interest, in particular reliability (with
- a persistent mode), distribution (it may run as several servers,
- transparently to the JMS client, thus allowing load balancing), the
- choice of TCP or SOAP as communication protocol for transmitting
- messages.</para>
- <para>
- The JMS service is in charge of launching (or establishing connection to)
- the integrated JMS server, that may run in the same JVM as JOnAS or not.
- It also provides connection pooling, and thread pooling (for
- Message-driven Beans).
- Through this service, JOnAS provides facilities to create
- JMS administered objects such as the connection factories and the
- destinations either at server launching time, or at runtime using the
- JOnAS administration tools.</para>
- </section>
- <section>
- <title>J2EE CA Resource Service</title>
- <para>The J2EE Connector Architecture (J2EE CA) allows the connection of
- different Enterprise Information Systems (EIS) to a J2EE application
- server. It is based on the Resource Adapter (RA), an architecture
- component comparable to a software driver, connecting the EIS, the
- application server, and the enterprise application (J2EE components).
- The RA is generally provided by an EIS vendor, and
- provides a Java interface (the Common Client Interface or CCI) to the
- J2EE components for accessing the EIS (this may also be a specific
- Java interface). The RA also provides standard
- interfaces for being plugged to the application server, so that they can
- collaborate to keep all system-level mechanisms (transactions, security,
- and connection management) transparent from the application components.
- </para>
-
- <para>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="picture-208-03.gif" format="GIF"/>
- </imageobject>
- </inlinemediaobject>
- </para>
-
- <para> The application performs "business logic" operations on the EIS data
- using the RA client API (CCI), while transactions, connections
- (including pooling) and security on the EIS is managed by the
- application server through the RA (system contract).
- </para>
- <para>The JOnAS Resource service is in charge of deploying J2EE CA compliant
- Resource Adapters (connectors), packaged as RAR files, on the JOnAS
- server. RAR files may also be included in EAR files, in this case the
- connector will be loaded by the application classloader. Once Resource
- Adapters are deployed, a connection factory instance is available in
- the JNDI namespace to be looked up by application components.
- </para>
- </section>
- <section>
- <title>Management Service</title>
- <para>The Management service is needed in order to administrate a JOnAS
- server from
- the JOnAS Jadmin administration console. Each server running this
- service is visible from the administration console. This service is
- based on JMX. Standard MBeans are defined within the JOnAS application
- server, they expose the management methods of the instrumented JOnAS
- server objects such as services, containers, the server by itself. The
- Management service runs a JMX server (currently the
- MX4J one, the Sun RI one is also available). The MBeans of the JOnAS
- server are registered within this JMX server. The JOnAS administration
- console is a Web application (servlet/JSP based), which accesses the JMX
- server in order to present the managed features within
- the administration console. It is thus possible, through a simple Web
- browser, to manage one or several JOnAS application servers. The
- administration console allows to configure all JOnAS services (and to
- make the configuration persistent), to deploy any kind of applications
- (EJB-JAR, WAR, EAR) and any kind of resources (DataSources, JMS and Mail
- connection factories, J2EE CA connectors), all that without the need to
- stop/restart the server. The administration console shows many
- information allowing to monitor your servers and applications: used
- memory, used threads, number of EJB instances, which component currently
- uses which resources, etc..</para>
- </section>
- <section>
- <title>Mail Service</title>
- <para>A J2EE application component may send e-mails using
- <ulink url="http://java.sun.com/products/javamail/"><trademark>JavaMail</trademark></ulink>.
- The Mail service of the JOnAS application server provides the necessary
- resources to such application components. The same way the database
- service or the JMS service create Datasources or ConnectionFactories
- and register these objects in the JNDI namespace, the Mail service
- creates mail factories and register these resources in the JNDI
- namespace.
- There are two kinds of mail factories: <emphasis>javax.mail.Session</emphasis> and
- <emphasis>javax.mail.internet.MimePartDataSource</emphasis>.</para>
- </section>
- </section>
- <section>
- <title>JOnAS Development and Deployment Environment</title>
- <section>
- <title>JOnAS Configuration and Deployment Facilities</title>
- <para>Once JOnAS has been installed, in a directory referred by the
- JONAS_ROOT environment variable, it is possible to configure servers
- and to deploy applications into several execution environments. This
- is achieved using the JONAS_BASE environment variable. JONAS_ROOT and
- JONAS_BASE may be compared to CATALINA_HOME and CATALINA_BASE variables
- of Tomcat. While JONAS_ROOT is dedicated to JOnAS installation,
- JONAS_BASE is used to specify a particular JOnAS instance configuration.
- JONAS_BASE designates a directory containing a specific JOnAS
- configuration, and subdirectories containing the EJB-JAR, WAR, EAR, and
- RAR files that may be loaded in this application environment. There is
- an ANT target in the JOnAS build.xml file to create a new JONAS_BASE
- directory structure. So from one JOnAS installation, but just changing
- the value of the JONAS_BASE variable, it is possible to switch from
- one application environment to another. For configuring a JOnAS
- application server and for loading applications, you should use the
- administration console, or edit the configuration files. There are
- also "autoload" directories for each kind of application (EJB-JAR, WAR
- or EAR) that allow the JOnAS server to automatically load the
- applications located in these directories when starting.</para>
- <para>About deployment, JOnAS provides several facilities.</para>
- <itemizedlist>
- <listitem><para>First to write
- the deployment descriptors, plugins for Integrated Development
- Environments (IDE) provide some generation and editing features
- (Eclipse and JBuilder plugins are available). The
- NewBean JOnAS built-in tool generates template deployment descriptors.
- The Xdoclet tool also generates deployment descriptors for JOnAS.
- The <ulink url="http://debian-sf.objectweb.org/projects/apollon">Apollon</ulink>
- ObjectWeb project generates Graphical User Interfaces for editing any
- XML file, it has been
- used to generate deployment descriptor editor GUI. A tool developed
- by the ObjectWeb JOnAS community will also be available to work with
- the JSR88 compliant (J2EE 1.4) deployment APIs provided by the
- ObjectWeb
- <ulink url="http://debian-sf.objectweb.org/projects/ishmael">Ishmael</ulink>
- project.
- </para></listitem>
- <listitem><para>For the deployment by itself, the basic tools are the JOnAS GenIC
- command line tool and the corresponding ANT ejbjar task. The IDE
- plugins integrate the use of these tools for deployment operations.
- The Ishmael project main feature will be the deployment of applications
- on the JOnAS platform.
- </para></listitem>
- </itemizedlist>
- </section>
- <section>
- <title>JOnAS Development Environments</title>
- <para>There are many plugins and tools for making easier the development of
- J2EE applications to be deployed on JOnAS. IDE plugins for JBuilder and
- Eclipse allows to develop, deploy and debug J2EE components on JOnAS. The
- <ulink url="http://xdoclet.sourceforge.net/">Xdoclet</ulink> code generation
- engine is able to generate EJB interfaces, deployment descriptors
- (standard and JOnAS specific ones), taking as input the EJB
- implementation class containing specific JavaDoc tags. The JOnAS NewBean
- tool generates templates of interfaces, implementation class, and
- deployment descriptors for any kind of EJB. Many development tools may
- work with JOnAS, see the
- <ulink url="http://www.objectweb.org/jonas/tools.html">JOnAS tools page</ulink>
- for more details.
- </para>
- <para>Moreover, JOnAS is delivered with complete J2EE examples, providing
- build.xml ANT file with all necessary targets for compiling, deploying
- and installing J2EE applications.
- </para>
- </section>
- </section>
- <section>
- <title>Clustering and Performance</title>
- <para>Clustering for an application server generally brings three features:
- Load Balancing (LB), High Availability (HA) and Failover.
- Such mechanisms may be provided at the Web container level (by
- dispatching requests to several Servlet/JSP engine instances, at
- the EJB container level (by dispatching EJB requests to several
- EJB container instances), and at the database level by using several
- databases. A replicated JNDI naming is also necessary.</para>
- <para>JOnAS provides Load Balancing, HA and Failover at the WEB container
- level, using the Apache Tomcat mod_jk plugin and an HTTP in memory
- session replication mechanism based on JavaGroup. The plugin dispatches
- HTTP requests from the Apache web server towards Tomcat instances running
- as JOnAS web container. Servers going down and up are automatically taken
- into account. This plugin supports
- round-robin and weighted round-robin load balancing algorithms, with a
- sticky session option.
- </para>
- <para>
- Load balancing and HA is provided at the EJB container level in JOnAS.
- Operations invoked one EJB Home interfaces (EJB creation and retrieving)
- are dispatched on the nodes of the cluster. The mechanism is based on
- a "clustered aware" replicated JNDI registry
- using a Clustered remote Method Invocation protocol (CMI). The stubs
- contain the knowledge of the cluster, and implement the load balancing
- policy, which may be round-robin, and weighted round-robin. In a near
- future, a load balancing mechanism based on the nodes load will be
- available. Failover at the EJB level will be provided by implementing
- a stateful session bean state replication mechanism.
- </para>
- <para>
- The JOnAS clustering architecture is illustrated in the figure
- below.</para>
-
- <para>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="picture-208-04.gif" format="GIF"/>
- </imageobject>
- </inlinemediaobject>
- </para>
-
- <para>Apache is used as the font-end HTTP server, Tomcat as the JOnAS web
- container. The JOnAS servers share the same database. The mod_jk
- plug-in provides Load Balancing / High Availability at the
- Servlet/JSP level. Failover is provided through the in-memory
- session replication mechanism. Load Balancing / High Availability is
- provided at the EJB level through the CMI protocol associated with
- the replicated clustered aware JNDI registry.
- Tomcat may run in the same JVM as the EJB container or not. JOnAS
- provides some documentation for configuring such an architecture.
- </para>
- <para>The use of the
- <ulink url="http://www.objectweb.org/c-jdbc/index.html">C-JDBC</ulink>
- ObjectWeb project allows to provide load balancing and high availability
- at the database level. The use of C-JDBC is transparent to the
- application (in our case to JOnAS), as it is viewed as a usual JDBC
- driver. However this "driver" implements the cluster mechanisms
- (reads are load balanced and writes are broadcasted). The
- database is distributed and replicated among several nodes and C-JDBC
- load balances the queries between these nodes. An evaluation of C-JDBC
- using the TPC-W benchmark on a 6 nodes cluster has shown performance
- scaling linearly up to 6 nodes.</para>
- <para>In addition to clustering solutions, JOnAS provides many mechanisms,
- intrinsic to the JOnAS server, for being highly scalable and efficient.
- This includes</para>
- <itemizedlist>
- <listitem><para>Pool of stateless session bean instances</para></listitem>
- <listitem><para>Pool of entity bean instances, configurable for each entity bean,
- within its deployment descriptor</para></listitem>
- <listitem><para>Activation/passivation of entity beans, passivation may be controlled
- through the management console</para></listitem>
- <listitem><para>Pools of connections, for JDBC, JMS, J2EE CA connectors</para></listitem>
- <listitem><para>Pool of threads for message-driven beans</para></listitem>
- <listitem><para>Session bean timeout may be specified at deployment</para></listitem>
- <listitem><para>A "shared" flag in the specific deployment descriptor of an entity
- bean indicates if the persistent representation of this entity bean
- is shared by several servers/applications, or if it is dedicated
- to the JOnAS server where it is loaded. In the last case, the
- optimization done by JOnAS consists in not reloading the
- corresponding data between transactions.</para></listitem>
- <listitem><para>The usual EJB 1.1 "isModified" (or "Dirty") mechanism is available,
- avoiding to store non modified data.</para></listitem>
- </itemizedlist>
- <para>Some benchmarks and JOnAS usecases have already shown that JOnAS
- was highly scalable, see for example the
- <ulink url="http://www.cs.rice.edu/CS/Systems/DynaServer/perf_scalability_ejb.pdf">Rubis</ulink> results, or the
- <ulink url="http://openuss.sourceforge.net/openuss/">OpenUSS</ulink> usecase.
- Rubis is a benchmark for e-commerce J2EE applications, which now belongs
- to the ObjectWeb
- <ulink url="http://www.objectweb.org/jmob/index.html">JMOB</ulink> (Java
- Middleware Open Benchmarking) project. OpenUSS is an operational
- University portal with about 5000 users.
- </para>
- </section>
- <section>
- <title>Perspectives</title>
- <para>As an open source implementation of a J2EE server, JOnAS is
- continuously evolving to satisfy the user requirements and to follow
- the related standards. The main JOnAS evolutions currently planned
- are the following:
- </para>
- <itemizedlist>
- <listitem><para>A J2EE CA 1.0 Resource Adapter for JDBC is planned for the middle of
- the year. It will replace the current JOnAS database service for
- plugging JDBC drivers and managing connection pools. In addition, it
- will provide JDBC PreparedStatement pooling. At the end of the
- year, a new version of this resource adapter, compliant to J2EE CA 1.5
- (J2EE 1.4), will be available, and will provide JDBC resultsets re-use
- by the EJB container (this optimization reduces the number of SQL
- statements executed by the EJB container).</para></listitem>
- <listitem><para>The support of EJB 2.1 (J2EE 1.4) specification will be provided by
- the end of the year. This will include a "Timer" service.</para></listitem>
- <listitem><para>The support of "Web Services" will be completed, in order
- to support standard deployment, as specified in J2EE 1.4. Tools
- for developing "Web Services" and an open source UDDI implementation
- will be integrated.</para></listitem>
- <listitem><para>Deployment APIs as specified in JSR88 (J2EE 1.4) will be supported
- by the end of the year, thanks to the Ishmael project.</para></listitem>
- <listitem><para>JOnAS administration will be enhanced by introducing the concept of
- management domain.</para></listitem>
- <listitem><para>The ObjectWeb JOTM project will be integrated within the JOnAS
- Transaction service. This will allow to support nested transactions,
- CORBA transactions and "Web Services" transactions.</para></listitem>
- </itemizedlist>
- </section>
- <section><title/>
- <para><emphasis>Sun, Java, and all
- Java-based trademarks are trademarks or registered trademarks of Sun
- Microsystems, Inc. in the U.S. and other countries.</emphasis></para>
- </section>
- </article>
-
-