1.2. Enterprise JavaBeans

The Sun Enterprise JavaBeans specification (http://java.sun.com/products/ejb/docs.html) defines an architecture and interfaces for developing and deploying distributed Java server applications based on a multi-tier architecture.

The intent of this specification is to facilitate and normalize the development, deployment, and assembly of application components (called enterprise beans); such components will be deployable on EJB platforms. The resulting applications are typically transactional, database-oriented, multi-user, secured, scalable, and portable. More precisely, this EJB specification addresses the following areas:

Not only will an enterprise bean be independent of the platform and operating system (since it is written in Java), but also of the EJB platform.

1.2.1. What Does What?

The Java2 Enterprise Edition (J2EE) platform is an n-tier platform. Each tier has a specific role:

Clients. Clients are the end-users of the system and can access the J2EE server by several means. One of the most common is to use a Web browser such as Mozilla to connect to a Web server where Java Servlets or Java Server Pages (JSP) access the business logic of the J2EE server (see Figure 1-1). Another solution is to use a specific Java program that directly communicates with the J2EE server (see Figure 1-2).

Web server. The Web server is responsible for accepting client requests and sending HTML replies back to the client. HTML pages can be static files that reside on the Web server filesystem or dynamically built with Servlets or JSPs from data generated by the beans.

Servlet/JSP server. The Java Server Page (JSP) server or Servlet container can be integrated into the Web server or be a separate entity communicating with the Web server. JSP or servlets run within a Java Virtual Machine that can be the same as the one used by the J2EE server.

J2EE application server. The J2EE application server is the place where the beans are executed. JOnAS is fully implemented in Java and all the beans loaded in an instance of JOnAS run within the same Java Virtual Machine. It is possible to run several different JOnAS J2EE application servers on the same or separate machines.

Database server. The database server is used to store and retrieve data. It is accessed through the standard JDBC (Java DataBase Connectivity) API by the beans.

Figure 1-1. J2EE n-tier architecture overview

Figure 1-2. Accessing the Red Hat Application Server server business logic from a Java client

The distributed environment in the EJB world uses RMI, but JOnAS supports several distributed processing environments:

1.2.2. JOnAS Features

JOnAS implements a set of J2EE specifications. The following list shows the specifications that are implemented by JOnAS and gives a brief description of the services provided by JOnAS.

1.2.2.1. Specifications

JOnAS provides full support of the following specifications:

1.2.2.2. JOnAS Services

JOnAS offers several services that can be turned on or off as required:

  • EJB Container Service: A set of Java classes implementing the EJB specification.

  • Web Container Service: A servlet/JSP engine in the JVM (Java Virtual Machine) of the Red Hat Application Server server and the loading of web applications ("WAR files") within this engine. Currently this service can be configured to use Tomcat or Jetty, although only Tomcat is supplied with Red Hat Application Server.

  • EAR Service: A service used for deploying complete J2EE applications; that is, applications packaged in EAR files, which themselves contain ejb-jar files and/or WAR files.

  • JDBC Service: JDBC 2.0 support including XA (Distributed transaction mode for JDBC 2.0) resources and connection pooling.

  • Security Service: This service implements the authorization mechanisms for accessing EJB components, as specified in the EJB specification. EJB security is based on the notion of roles.

  • Transaction Service: This is a Java Transaction Monitor called JOnAS JTM, which ensures the coordination of distributed transactions using XA. It handles two-phase commit protocol against any number of Resource Managers (XA Resources).

  • Messaging Service: This service is in charge of launching (or establishing connection to) an integrated JMS server. JOnAS makes use of a third-party JMS implementation. Currently the JORAM open-source JMS server is integrated and delivered with JOnAS.

  • Management Service: Integration of a JMX server.

  • J2EE CA Resource Service: Allows application component access to an external EIS.

  • Mail Service: Allows application components to read or send e-mail using JavaMail.

  • Database Service: This service is responsible for handling Datasource objects. A Datasource is a standard JDBC administrative object for handling connections to a database.

  • Communication and Naming Service: This service provides the JNDI API to application components and to other services to bind and lookup remote objects (for example, EJB Homes) and resource references (JDBC Datasource, Mail, and JMS connection factories, etc.)

Configuring and starting the various services is described in Section 4.1.2 JOnAS Configuration Files.

1.2.3. Software Requirements

Here is a list of the main software components needed to run Red Hat Application Server:

Here is a list of software components that may also be needed to run JOnAS in some configurations: