Java 2 Enterprise Edition (J2EE)

J2EE is an on-going standard for producing secure, scalable, and highly-available enterprise applications. The standard defines which services should be provided by servers that support J2EE. These servers will provide J2EE containers in which J2EE components will run. The containers will provide a defined set of services to the components. The J2EE specification provides a definition from which enterprise vendors can produce J2EE application servers on which J2EE-compliant applications can be deployed. An impressive list of expert group members produced the latest version of the associated Java Specification Request (JSR 58 which contains the standard definition for J2EE version 1.3), which can be found online at http://java.sun.com/j2ee/sdk1.3/index.html.

Although the J2EE specification defines a set of services and component types, it does not contain information on how to arrange the logical architecture into physical machines, environments, or address spaces.

The J2EE platform provides a common environment for building secure, scalable, and platform-independent enterprise applications. Many businesses are now delivering goods and services to customers via the Internet by using such J2EE-based servers. The requirements of such an environment demand open standards on which to build applications, for example,

  • Java 2 Platform, Standard Edition (J2SE), a platform independent language

  • Components that deliver Web-based user interfaces

  • Components to encapsulate business processes

  • Access to data in corporate data stores

  • Connectivity to other data sources and legacy systems

  • Support for XML, the language of B2B e-commerce

Components and Containers

J2EE specifies that a compliant J2EE application server must provide a defined set of containers to house J2EE components. Containers supply a runtime environment for the components. As such, Java 2 Platform, Standard Edition (J2SE) is available in each container. Application Programming Interfaces (APIs) in J2EE are also made available to provide communication between components, persistence, service discovery, and so on. Containers are implemented by J2EE application server vendors and there should be a container available for each type of J2EE component:

  • Applet Container

  • Application Client Container

  • Web Container

  • EJB Container

There are two types of components deployed, managed, and executed on a J2EE Server:

  • Web componentsA Web component interacts with a Web-based client, such as a Web browser. There are two kinds of Web components in J2EE—Servlet Component and Java Server Pages (JSP) Component. Both types handle the presentation of data to the user. Please see Days 12 and 13 for further details.

  • EJB componentsThere are three kinds of Enterprise JavaBean components—Session beans, Entity beans, and Message-Driven Beans. Please see Day 4, Day 5, “Session EJBs,” Day 6, “Entity EJBs,” and Day 10, respectively, for further information.

Figure 1.5 shows the overall relationships between the different containers and components in the J2EE environment.

Figure 1.5. J2EE logical architecture.


J2EE Standard Services

Containers must provide each type of component with a defined set of services that are covered in detail as you progress through the book. Briefly these services consist of

  • ConnectivityContainers must support connectivity to other components and to application clients. One form of required connectivity is to distributed objects through both Java Remote Method Invocation (RMI) and CORBA (as implemented by the Java IDL package and RMI over IIOP). Internet connectivity must be provided both through the Hypertext Transport Protocol (HTTP) and its secure form (HTTPS).

  • Directory servicesJ2EE servers are required to provide naming services in which components can be registered and discovered. The Java Naming and Directory Interfaces (JNDI) provide a way of accessing these services.

  • Data access and persistence— Data access is provided through the Java Database Connection API (JDBC). This API works both at the application level to interface with databases and also service providers who build drivers for specific databases.

  • Legacy connectivityThe Java Connector Architecture (JCA or Connectors) provides J2EE support in integrating Enterprise Information Servers and legacy systems, such as mainframe transaction processing and Enterprise Resource Planning (ERP) systems. This support extends to J2EE service providers who are writing adapters to connect other systems to the J2EE enterprise architecture.

  • Security— Security is built into the J2EE model. APIs, such as the Java Authentication and Authorization Service (JAAS), assist the J2EE enterprise application in imposing authentication and authorization security checks on users.

  • XML Support— The JAXP API supports the parsing of XML documents using Document Object Model (DOM), SimpleAPI for XML documents (SAX), and the eXtensible Stylesheet Language Transformations (XSLT).

  • Transactions— A J2EE server must provide transaction services for its components. The boundaries of transactions need to be specified by the container or the application. The container will usually take responsibility for transaction demarcation, although the Java Transaction API (JTA) allows the component to control its own transactions if required.

  • Messaging and e-mailThe Java Message Service (JMS) allows components to send and receive asynchronous messages, typically within an organizational boundary. The JavaMail API enables Internet mail to be sent by components and also provides functionality to retrieve e-mail from mailstores. JavaMail uses the JavaBeans Activation Framework (JAF) to support various MIME types.

Figure 1.6 shows the J2EE architecture updated with the services available to its containers. All of these services are discussed in more detail tomorrow.

Figure 1.6. The J2EE platform with services available.


Every J2EE-compliant server must support the services defined in this section. To provide a concrete example of how services should work, the team working on the J2EE JSR is responsible for providing a Reference Implementation (RI) of the J2EE APIs. This RI is freely available from Sun and provides a convenient platform for prototyping applications and testing technologies.

J2EE Blueprints

The J2EE Blueprints are a set of best practices that show how best to implement J2EE applications. The Blueprints provide a concrete implementation of Sun's vision for 3-tier, J2EE-based systems. There is a download available from the Sun Web site called Java Pet Store Sample Application that shows these best practices. This can be found online at http://java.sun.com/j2ee/blueprints.

The Java Pet Store is a typical online e-commerce application. The best practices cover application design and, in particular, the promotion of the following:

  • Code reuse

  • Logical functional partitioning

  • The separation of areas of high maintenance

  • Extensibility

  • Modularity

  • Security

  • Simple and consistent user interface

  • Efficient network usage

  • Data integrity

The J2EE Blueprints will show you step-by-step how to design multi-tier enterprise applications. There are explorations on the following topic areas:

  • The Client Tier

  • The Web Tier

  • The Enterprise JavaBeans Tier

  • The Enterprise Information Systems Tier

  • Design Patterns

In addition, there are discussions on how to package and deploy your enterprise applications.

J2EE Compatibility Test Suite

Enterprise service providers will sell more if their enterprise servers meet with the J2EE specification requirements. To enable them to test their products against the specification, Sun Microsystems Inc. offers a testing environment. Servers that pass all of the tests can be certified as J2EE compliant. Further details of the compatibility suite can be found online at http://java.sun.com/j2ee/compatibility.html.

The following are some examples of application vendors and their servers that have been certified by Sun Microsystems as being compatible with the J2EE specification (some of these may not yet have attained J2EE 1.3 certification, so please check on the Sun Web site).

  • Allaire (www.macromedia.com/software/coldfusion)—ColdFusion 5 comes with its own markup language (ColdFusion Markup Language) that integrates with all popular Web languages and technologies. ColdFusion works with multi-tier architectures through COM, CORBA, and EJB integration.

  • BEA Systems (www.bea.com)—BEA Weblogic Server includes support for Web Services, J2EE Connector Architecture, and updated J2EE services, with EJB 2.0, Servlet 2.3, and JSP 1.2.

  • IBM (www.ibm.com)—Websphere Commerce Business Edition supports EJB, JSP, XML, HTTP, and wireless markup language technologies.

  • iPlanet (www.iplanet.com)—iPlanet Application Server Enterprise Edition supports the J2EE platform and is integrated with transaction monitor, iPlanet Web Server, and iPlanet Directory Server. It supports XML, wireless application protocols, Simple Network Management Protocol (SNMP), LDAP, CORBA, and JDBC.

  • JBoss (www.jboss.org)—JBoss is a freeware server that houses an implementation of the EJB 1.1 (and parts of 2.0) specification. It is similar to Sun's J2EE Reference Implementation, but the JBoss core server provides only an EJB server. JBoss does not include a Web container, but JBoss is available to download with a freeware Web server.

  • Persistence (www.persistence.com)—PowerTier Release 7 for J2EE supports Java, EJB deployment, and Rational Rose integration.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.107.25