Java 2 Enterprise Edition

J2EE - An Introduction

Today's enterprises need to extend their reach, reduce their costs, and lower their response times by providing easy-to-access services to their customers, employers, distributors, retailers, and suppliers to face the business competition. Typically, applications that provide these services must combine existing Enterprise Information Systems (EIS) with new business functions that deliver services to a broad range of users. These services need to be highly available, secure, reliable and scalable. These services are architected as multi-tier applications. A middle tier that implements the new services needs to integrate existing EISs with the business functions and data of the new service. The service middle tier shields first tier clients from the complexity of the enterprise. The rapidly maturing Web technologies can be used as first tier towards reducing the user administration needs dramatically.

Sun Microsystems has come out with a nice collection of solid and complete specifications for a set of exciting enterprise-oriented technologies and services for software providers to implement them. This collection, named as Java 2 Enterprise Edition (J2EE), aims to provide a standard for Java application servers, which provide solutions and tools for developing server-side, enterprise-scale, robust applications, including Web and e-commerce applications. Thus Java started to shine on the server side also. The concept of specification ensures a number of distinct advantages for Java application servers, such as, no investment in a single proprietary platform, best-of-breed implementation, and competitive price.

The Java 2 Enterprise Edition (J2EE) reduces the cost and complexity of developing these multi-tier services. Also the services thus developed can be rapidly deployed, maintained and enhanced as the enterprise responds to competitive pressures. This set of requirements are being accomplished by J2EE, which defines a standard architecture.

The J2EE architecture encompasses a J2EE runtime environment and a set of enterprise services.On the other hand, there may be issues like bad compatibility. Sun Microsystems has come out with a string of answers for this major problem. They are as follows: 1) a Compatibility Test Suite (CTS), which put every J2EE compliant product to undergo a suite of tests to guarantee that they indeed perform as the specification mandates, 2) a reference implementation is available for vendors that are in the process of building J2EE-based application servers and finally 3) binary compatibility for applications. Binary formats like WAR and EAR files can be directly moved between application servers, ensuring that not even re-compilation is required when moving application from one server to another.

Parts of J2EE

The J2EE is a specification consisting of many parts. J2EE is made up of a lot of different technologies and a specification for how these work together. The main parts of the J2EE runtime environment consists of the following: Application components, Containers, Resource manager drivers, and Database.

Application Components - There are four mandatory types of application components that a J2EE compliant product must support: 1. Application clients - these are fat clients written as normal Java applications. They normally access the application server using Remote Method Invocation (RMI).

2. Applets - these are graphical clients that normally execute within a web browser

3. Servlets and JavaServer Pages

4. Enterprise JavaBeans - these are components that execute in a container in the application server that manages them and handles much of the plumbing for them.

Containers - Every kind of component lives inside a container that provides the component with runtime services. There is one type of container for every type of component. The most interesting containers are the web container that the servlets and JavaServer Pages live in, and the EJB container that manages the EJBs.

Resource manager drivers - A resource manager driver is a driver that provides some kind of connectivity to an external component. The only driver that is being supported today is driver that implements any of the J2EE standard services.

Database - Databases are accessible via JDBC, and need to be accessible from all component types except for applets.

The J2EE platform also includes some standard services. They are HTTP, HTTPS, Java Transaction API (JTA), RMI-IIOP, JavaIDL, JDBC, Java Message Service (JMS), Java Naming and Directory Interface (JNDI), JavaMail, and JavaBeans Activation Framework (JAF).

Platform Roles

One of the important concepts in J2EE is platform roles. The J2EE standard provides separation between different roles, so that different players in the market can specialize on their role. Increased specialization will hopefully increase productivity as individuals and organizations focus on building competence in one area.

There are mainly 6 roles in the J2EE specification are:

1. J2EE Product Provider - the vendors providing application server

2. Application Component Provider - the companies building components for specific tasks, such as Web or E-commerce applications.

3. Application Assembler - the one who assembles a set of components to build an application, which is then delivered as an Enterprise Archive.

4. Deployer - the one who deploys the applications into production environments. This means that the deployer installs, configures, and executes the application

5. System Administrator - the one who monitors the application's well-being and administers the application after it has been deployed

6. Tool Provider - the one who makes tools for development and packaging of the application components.

Thus J2EE specification follows the policy of divide and conquer to design enterprise applications.

Platform Contracts

The J2EE platform communicates with the outside world in a few different ways as following:

1. Application Programming Interfaces - the J2EE APIs defines the interface between the application components and the platform.

2. Network Protocols - for access by outside applications, specific network protocols such as HTTP, HTTPS and RMI, have to be implemented by the J2EE product.

3. Deployment Descriptors - the deployer specifies the behavior and configuration of a J2EE application using deployment descriptors. These are a standard way to specify the configurations of all the application components using XML.

Also the J2EE platform provides mechanisms for any large scale application to be able to survive large numbers of users, high loads, and even server failures without collapsing. This is possible through having clusters of J2EE application servers. This mechanism ensures transparent failure handling and load balancing across a cluster of servers.

Here comes the list of J2EE services being provided by J2EE-compliant application servers.

Enterprise JavaBeans (EJBs) provide a robust framework for creating component-based server-side applications.

Java Server Pages (JSPs) bring flexibility to the user interface layer

Java Servlets and JSPs combined together well to provide dynamic interaction between the user interface layer and the backend application.

Java Naming Directory Interface (JNDI) provides connectivity from Java programs to any naming and directory services. The JNDI API has two parts: an application-level interface used by the application components to access naming and directory services and a service provider interface to attach a provider of a naming and directory service.

RMI-IIOP allows for the use of RMI-style programming that is independent of the underlying protocol, as well as an implementation of these APIs that supports both the J2SE native RMI protocol and the CORBA IIOP protocol. J2EE applications can use IIOP protocol to access CORBA services that are compatible with the RMI programming restrictions.

JavaIDL allows J2EE application components to invoke external CORBA objects using the IIOP protocol. These CORBA objects may be coded in any programming language and typically live outside a J2EE product. J2EE applications may use JavaIDL to act as clients of CORBA services.

Java Database Connectivity (JDBC) provides an interface for Java client applications to access any relational databases. The JDBC API has two parts: an application-level interface used by the application components to access a database, and a service provider interface to attach a JDBC driver to the J2EE platform.

Java Message Service (JMS) provides a messaging API for any two applications to communicate asynchronously through messages. The messaging supports reliable point-to-point messaging as well as the publish-subscribe model.

Java Transaction API (JTA) and Java Transaction Service (JTS) provide transaction services

Java Mail provide e-mail facility to J2EE applications. The J2EE platform includes the JavaMail API along with a JavaMail service provider that allows an application component to send Internet mail. The API has two parts: an application-level interface used by the application components to send mail, and a service provider interface used at the J2EE SPI level.

Interoperability of J2EE Applications

The J2EE applications have to be interoperable. The J2EE platform will be used by enterprise environments that support clients of many different types. These enterprise environments will add new services to their existing EISs. These enterprise environments will be utilizing different hardware platforms and various software applications written in different programming languages.

The J2EE platform provides indirect support for various types of clients, different hardware platforms, and a multitude of software applications through its interoperability requirements. For an application component developer or system administrator in an enterprise environment, the interoperability features of the J2EE platform facilitate the underlying disparate systems to work together seamlessly. Also J2EE helps to hide much of the complexity involved in integrating these pieces.

The interoperability requirements for the J2EE platform allows:

J2EE applications to connect legacy systems using CORBA or low-level socket interfaces.

J2EE applications to connect to other J2EE applications across multiple J2EE products. The J2EE products can be from multiple product providers or they can be from the same provider.

Interoperability Protocols - The J2EE specification requires that a J2EE product support a standard set of protocols and formats to ensure interoperability. They are Internet protocols, OMG protocols, RMI protocols, and Data formats. The protocols allow communication between J2EE application components.

The J2EE platform requires support for the following Internet protocols: TCP/IP, HTTP 1.1 and SSL 3.0 and the OMG protocol, IIOP (Internet Inter-ORB Protocol). Finally the J2EE platform should support the Java Remote Method Invocation Protocol (JRMP).

The last requirement is that J2EE platform should support a number of data formats. These formats provide a definition for data that is exchanged between components. The required data formats are HTML 4, Image file formats, JAR files, and Class file format.

Click for an overview of Java.

Click for Enterprise Computing Page

Back to my Home Page